Doxygen Source Code Documentation
plug_3ddup.c File Reference
#include "afni.h"
Go to the source code of this file.
Functions | |
char * | DUP_main (PLUGIN_interface *plint) |
DEFINE_PLUGIN_PROTOTYPE PLUGIN_interface * | PLUGIN_init (int ncall) |
Variables | |
char | helpstring [] |
Function Documentation
|
Definition at line 61 of file plug_3ddup.c. References ADN_none, ADN_prefix, ADN_warp, ADN_warp_parent, DSET_ONDISK, EDIT_dset_items(), EDIT_empty_copy(), IDENTITY_WARP, ISVALID_3DIM_DATASET, myXtNew, PLUTO_add_dset(), PLUTO_find_dset(), PLUTO_prefix_ok(), THD_write_3dim_dataset(), tross_Append_History(), and tross_Copy_History(). Referenced by PLUGIN_init().
00062 { 00063 THD_3dim_dataset *dset_in , *dset_out ; 00064 THD_warp *warp , *twarp ; 00065 MCW_idcode *idc ; 00066 char *new_prefix ; 00067 00068 if( plint == NULL ) return " \nDUP_main: NULL input!\n" ; 00069 00070 PLUTO_next_option(plint) ; 00071 idc = PLUTO_get_idcode(plint) ; 00072 dset_in = PLUTO_find_dset(idc) ; 00073 if( dset_in == NULL ) 00074 return "****************************\n" 00075 "DUP_main: bad input dataset\n" 00076 "****************************" ; 00077 if( !DSET_ONDISK(dset_in) ) 00078 return "********************************\n" 00079 "DUP_main: illegal input dataset\n" 00080 "********************************" ; 00081 00082 PLUTO_next_option(plint) ; 00083 new_prefix = PLUTO_get_string(plint) ; 00084 if( ! PLUTO_prefix_ok(new_prefix) ) 00085 return "*********************\n" 00086 "DUP_main: bad prefix\n" 00087 "*********************" ; 00088 00089 /*** copy header info ***/ 00090 00091 dset_out = EDIT_empty_copy( dset_in ) ; 00092 if( !ISVALID_3DIM_DATASET(dset_out) ) 00093 return "****************************\n" 00094 "DUP_main: can't duplicate?!\n" 00095 "****************************" ; 00096 00097 EDIT_dset_items( dset_out , ADN_prefix,new_prefix , ADN_none ) ; 00098 00099 tross_Copy_History( dset_in , dset_out ) ; 00100 tross_Append_History( dset_out , "Warp-on-Demand duplicate from plug_3ddup." ) ; 00101 00102 warp = myXtNew(THD_warp) ; *warp = IDENTITY_WARP ; 00103 00104 EDIT_dset_items( dset_out , 00105 ADN_warp , warp , 00106 ADN_warp_parent , dset_in , 00107 ADN_none ) ; 00108 00109 /*** done! ***/ 00110 00111 THD_write_3dim_dataset( NULL , NULL , dset_out , False ) ; 00112 PLUTO_add_dset( plint , dset_out , DSET_ACTION_MAKE_CURRENT ) ; 00113 00114 return NULL ; 00115 } |
|
Definition at line 31 of file plug_3ddup.c. References ANAT_ALL_MASK, DUP_main(), FUNC_ALL_MASK, helpstring, and PLUTO_add_hint().
00032 { 00033 PLUGIN_interface * plint ; 00034 00035 if( ncall > 0 ) return NULL ; /* only one interface */ 00036 00037 /*-- set titles and call point --*/ 00038 00039 plint = PLUTO_new_interface( "Dataset Dup" , "Warp-on-Demand duplicate" , helpstring , 00040 PLUGIN_CALL_VIA_MENU , DUP_main ) ; 00041 00042 PLUTO_add_hint( plint , "Warp-on-Demand duplicate" ) ; 00043 00044 /*-- first line of input: Dataset --*/ 00045 00046 PLUTO_add_option( plint , "Input" , "Input" , TRUE ) ; 00047 PLUTO_add_dataset(plint , "Dataset" , 00048 ANAT_ALL_MASK , FUNC_ALL_MASK , 00049 DIMEN_ALL_MASK | BRICK_ALLTYPE_MASK ) ; 00050 00051 /*-- second line of input: Prefix for output dataset --*/ 00052 00053 PLUTO_add_option( plint , "Output" , "Output" , TRUE ) ; 00054 PLUTO_add_string( plint , "Prefix" , 0,NULL , 19 ) ; 00055 00056 return plint ; 00057 } |
Variable Documentation
|
Initial value: " Purpose: Make a 'warp-on-demand' duplicated of a dataset.\n" "\n" " Inputs:\n" " Dataset = A dataset in the current session (not warp-on-demand itself).\n" " Prefix = Name for the new dataset.\n" "\n" " Note: output dataset will be in the AFNI .HEAD format.\n" "\n" " RWCox - 06 Aug 2003 - cf. 3ddup." Definition at line 11 of file plug_3ddup.c. Referenced by PLUGIN_init(). |