コード例 #1
0
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;
   static char *yn[2] = {"No", "Yes"};

   if( ncall > 0 ) return NULL ;  /* only one interface */

   /*-- set titles and call point --*/

   /* Initialize variables so we can be a 1D transformer*/
   low_fc=0; high_fc = 0; ignore=1; autocorr=FALSE; retrend=FALSE; output_prefix=NULL; idc=NULL;
   PLUTO_register_1D_function( "Fourier", fourier_1D );


   plint = PLUTO_new_interface( "Fourier Stuff" , "Filtering, autocorrelation and other stuff done with FFTs" , helpstring ,
                                 PLUGIN_CALL_VIA_MENU , Fourier_Main  ) ;

   PLUTO_add_hint( plint , "Filtering, autocorrelation and other stuff done with FFTs" ) ;

   PLUTO_set_sequence( plint , "z:Ross" ) ;
   /*-- first line of input: Dataset --*/

   PLUTO_add_option( plint , "Input" , "Input" , FALSE ) ;
   PLUTO_add_dataset(plint , "Dataset" ,
                                    ANAT_ALL_MASK , FUNC_ALL_MASK ,
                                    DIMEN_4D_MASK | BRICK_ALLREAL_MASK ) ;

   /*-- second line of input: Prefix for output dataset --*/

   PLUTO_add_option( plint , "Output" , "Output" , FALSE ) ;
   PLUTO_add_string( plint , "Prefix" , 0, NULL , 19 ) ;

   /*-- third line of input: Preprocessing --*/

   PLUTO_add_option( plint , "Preprocess" , "Preprocess" , TRUE ) ;
   PLUTO_add_number( plint , "Ignore" ,  0, 10,  0, 1 , FALSE) ;
   PLUTO_add_string( plint, "Re-trend", 2, yn, 0); 

   /*-- fourth line of input: Lowpass option --*/

   PLUTO_add_option( plint , "Lowpass" , "Lowpass" , FALSE ) ;
   PLUTO_add_number( plint , "Fc" ,  0, 5000,  3, 0 , TRUE) ;

   /*-- fifth line of input: Highass option --*/

   PLUTO_add_option( plint , "Highpass" , "Highpass" , FALSE ) ;
   PLUTO_add_number( plint , "Fc" ,  0, 5000,  3, 0 , TRUE) ;

   /*-- sixt line of input: Autocorrelation option --*/
/*
   PLUTO_add_option( plint , "Autocorrelate" , "Autocorrelate" , FALSE ) ;
 */
   return plint ;
}
コード例 #2
0
ファイル: plug_maskave.c プロジェクト: ccraddock/afni
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;

   if( ncall > 0 ) return NULL ;  /* only one interface */

   CHECK_IF_ALLOWED("ROIAVERAGE","ROI Average") ;  /* 30 Sep 2016 */

   /*-- set titles and call point --*/

   plint = PLUTO_new_interface( "ROI Average" , "Average Dataset over ROI" , helpstring ,
                                 PLUGIN_CALL_VIA_MENU , MASKAVE_main  ) ;

   PLUTO_add_hint( plint , "Average Dataset over ROI" ) ;

   PLUTO_set_sequence( plint , "A:afniinfo:dset" ) ;

   /*-- first line of input --*/

   PLUTO_add_option( plint , "Source" , "Source" , TRUE ) ;
   PLUTO_add_dataset(plint , "Dataset" ,
                                    ANAT_ALL_MASK , FUNC_ALL_MASK ,
                                    DIMEN_ALL_MASK | BRICK_ALLREAL_MASK ) ;

   PLUTO_add_number( plint , "Sub-brick" , -1,9999,0 , 0,1 ) ;

   /*-- second line of input --*/

   PLUTO_add_option( plint , "Mask" , "Mask" , TRUE ) ;
   PLUTO_add_dataset( plint , "Dataset" ,
                                 ANAT_ALL_MASK , FUNC_ALL_MASK ,
                                 DIMEN_ALL_MASK | BRICK_ALLREAL_MASK ) ;
   PLUTO_add_number( plint , "Sub-brick" , 0,9999,0 , 0,1 ) ;  /* 06 Aug 1998 */

   /*-- third line of input --*/

   PLUTO_add_option( plint , "Range"  , "Range" , FALSE ) ;
   PLUTO_add_number( plint , "Bottom" , -99999,99999, 1, 0,1 ) ;
   PLUTO_add_number( plint , "Top"    , -99999,99999,-1, 0,1 ) ;

   /*-- 4th line of input (06 Aug 1998) --*/

   PLUTO_add_option( plint , "1D Save" , "1D Save" , FALSE ) ;
   PLUTO_add_string( plint , "Name" , 0,NULL , 12 ) ;
   PLUTO_add_string( plint , "To Disk?" , NUM_yesno_list , yesno_list , 1 ) ;

   return plint ;
}
コード例 #3
0
ファイル: plug_rename.c プロジェクト: LJWilliams/Neuroimaging
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;

   if( ncall > 0 ) return NULL ;  /* only one interface */

   /*-- set titles and call point --*/

   plint = PLUTO_new_interface( "Dataset Rename" , "Dataset Renaming" , helpstring ,
                                 PLUGIN_CALL_VIA_MENU , RENAME_main  ) ;

   PLUTO_add_hint( plint , "Rename a Dataset" ) ;

   PLUTO_set_sequence( plint , "A:afnicontrol:dset" ) ;

   PLUTO_set_runlabels( plint , "Rename+Keep" , "Rename+Close" ) ;  /* 04 Nov 2003 */

   /*-- first line of input: Dataset --*/

   PLUTO_add_option( plint , "Input" , "Input" , TRUE ) ;
   PLUTO_add_dataset(plint , "Dataset" ,
                                    ANAT_ALL_MASK , FUNC_ALL_MASK ,
                                    WARP_ON_DEMAND_MASK | DIMEN_ALL_MASK |
                                    SESSION_ALL_MASK    | BRICK_ALLTYPE_MASK ) ;

   /*-- second line of input: Prefix for output dataset --*/

   PLUTO_add_option( plint , "Output" , "Output" , TRUE ) ;
   PLUTO_add_string( plint , "Prefix" , 0,NULL , 19 ) ;

   return plint ;
}
コード例 #4
0
ファイル: plug_L1fit.c プロジェクト: ccraddock/afni
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   int ii ;
   PLUGIN_interface * plint ;     /* will be the output of this routine */

   if( ncall > 0 ) return NULL ;
   CHECK_IF_ALLOWED("L1FIT","L1_Fit & Dtr") ;  /* 30 Sep 2016 */

   /*---------------- set titles and call point ----------------*/

   plint = PLUTO_new_interface( "L1_Fit & Dtr" ,
                                "Control L1_Fit and L1_Dtr Functions" ,
                                helpstring ,
                                PLUGIN_CALL_VIA_MENU , L1F_main ) ;

   global_plint = plint ;  /* make global copy */

   PLUTO_set_sequence( plint , "A:funcs:fitting" ) ;

   PLUTO_add_hint( plint , "Control L1_Fit and L1_Dtr Functions" ) ;

   PLUTO_set_runlabels( plint , "Set+Keep" , "Set+Close" ) ;  /* 04 Nov 2003 */

   /*----- Parameters -----*/

   PLUTO_add_option( plint , "Parameters" , "Parameters" , TRUE ) ;

   PLUTO_add_string( plint , "Baseline" , NBASE , baseline_strings , 1 ) ;

   PLUTO_add_number( plint , "Ignore" , 0,20,0,3 , FALSE ) ;

   /*----- Sinusoid -----*/

   for( ii=0 ; ii < NRMAX_SIN ; ii++ ){
      PLUTO_add_option( plint , "Sinusoid" , "Sinusoid" , FALSE ) ;
      PLUTO_add_number( plint , "Period" , 0,99999,0,20, TRUE ) ;
      PLUTO_add_number( plint , "Harmonics" , 1,HARM_MAX,0,1 , FALSE ) ;
   }

   /*----- Timeseries -----*/

   for( ii=0 ; ii < NRMAX_TS ; ii++ ){
      PLUTO_add_option( plint , "Timeseries" , "Timeseries" , FALSE ) ;
      PLUTO_add_timeseries( plint , "File" ) ;
   }

   /*--------- done with interface setup ---------*/

   PLUTO_register_1D_funcstr( "L1_Fit" , L1F_fitter ) ;
   PLUTO_register_1D_funcstr( "L1_Dtr" , L1F_detrend ) ;

   return plint ;
}
コード例 #5
0
ファイル: plug_hemisub.c プロジェクト: ccraddock/afni
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
    PLUGIN_interface * plint ;

    if( ncall > 0 ) return NULL ;  /* only one interface */
    CHECK_IF_ALLOWED("HEMISUBTRACT","Hemi-subtract") ;  /* 30 Sep 2016 */

    /* create the new interface */

    plint = PLUTO_new_interface( "Hemi-subtract", "hemisphere subtraction",
		helpstring, PLUGIN_CALL_VIA_MENU , HEMISUB_main );

    PLUTO_add_hint( plint,
	"from each voxel's value, subtract that of the reflected voxel" );

    PLUTO_set_sequence( plint , "z:Reynolds" ) ;

    /*-- first line of input: input dataset --*/

    PLUTO_add_option( plint, "Input" , "Input" , TRUE );
    PLUTO_add_hint( plint, "choose dataset for input" );
    PLUTO_add_dataset(plint, "Dataset" , ANAT_ALL_MASK , FUNC_ALL_MASK,
					 DIMEN_3D_MASK | BRICK_SHORT_MASK );

    /*-- second line of input: prefix for output dataset --*/

    PLUTO_add_option( plint, "Output" , "prefix" , TRUE );
    PLUTO_add_hint( plint, "option: choose dataset prefix for output" );
    PLUTO_add_string( plint, "Prefix", 0, NULL, 19 );

    /*-- third line of input: threshold type option --*/

    PLUTO_add_option( plint, "Thresh Type", "Thresh Type", FALSE );
    PLUTO_add_string( plint, "Type", NUM_T_OPTS, thresh_opts, 0 );

    return plint;
}
コード例 #6
0
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;     /* will be the output of this routine */
   int meth ;

   if( ncall > 0 ) return NULL ;  /* only one interface */

   /*---------------- set titles and call point ----------------*/

   plint = PLUTO_new_interface( "Coord Order" ,
                                "Coordinate Order Display" ,
                                helpstring ,
                                PLUGIN_CALL_VIA_MENU , CORD_main  ) ;

   PLUTO_add_hint( plint , "Coordinate Order Display" ) ;

   PLUTO_set_sequence( plint , "A:afnicontrol:display" ) ;

   PLUTO_set_runlabels( plint , "Set+Keep" , "Set+Close" ) ;  /* 04 Nov 2003 */

   /*---------- 2nd line: other inputs ----------*/

   PLUTO_add_option( plint ,
                     "Input" ,  /* label at left of input line */
                     "Input" ,  /* tag to return to plugin */
                     TRUE       /* is this mandatory? */
                   ) ;

   meth = PLUTO_string_index( GLOBAL_library.cord.orcode ,
                              NUM_CORD_STRINGS ,
                              cord_strings ) ;
   if( meth < 0 || meth >= NUM_CORD_STRINGS ) meth = 0 ;

   PLUTO_add_string( plint ,
                     "Order" ,          /* label next to chooser button */
                     NUM_CORD_STRINGS , /* number of strings to choose among */
                     cord_strings ,     /* list of strings to choose among */
                     meth               /* index of default string */
                   ) ;

   /*--------- done with interface setup ---------*/

   return plint ;
}
コード例 #7
0
ファイル: plug_stavg.c プロジェクト: LJWilliams/Neuroimaging
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;     /* will be the output of this routine */

   if( ncall > 0 ) return NULL ;  /* one interfaces */

   /*---------------- set titles and call point ----------------*/

   plint = PLUTO_new_interface( "SingleTrial Avg" ,
                                "Averaging of epochs in Single Trial data" ,
                                helpstring ,
                                PLUGIN_CALL_VIA_MENU , STAVG_main  ) ;

   PLUTO_add_hint( plint , "Averaging of epochs in Single Trial data" ) ;

   global_plint = plint ;  /* make global copy */

   PLUTO_set_sequence( plint , "z:Birn" ) ;

   /*--------- 1st line ---------*/

   PLUTO_add_option( plint ,
                     "Datasets" ,  /* label at left of input line */
                     "Datasets" ,  /* tag to return to plugin */
                     TRUE          /* is this mandatory? */
                   ) ;

   PLUTO_add_dataset(  plint ,
                       "Input" ,          /* label next to button   */
                       ANAT_ALL_MASK ,    /* take any anat datasets */
                       FUNC_FIM_MASK ,    /* only allow fim funcs   */
                       DIMEN_4D_MASK |    /* need 3D+time datasets  */
                       BRICK_ALLREAL_MASK /* need real-valued datasets */
                    ) ;
   PLUTO_add_hint( plint , "Input 3d+t dataset" ) ;

   PLUTO_add_string( plint ,
                     "Output" ,  /* label next to textfield */
                     0,NULL ,    /* no fixed strings to choose among */
                     19          /* 19 spaces for typing in value */
                   ) ;
   PLUTO_add_hint( plint , "Name of output dataset" ) ;

   /*---------- 2nd line --------*/

   PLUTO_add_option( plint ,
                     "Timing" ,
                     "Timing" ,
                     TRUE
                   ) ;


   PLUTO_add_timeseries(plint, "Stim. Timing");
   PLUTO_add_hint( plint , "Stimulus Timing (0 = no task, 1 = task)" ) ;

   PLUTO_add_number( plint ,
                     "delta" ,   
                     -1000 ,    
                     1000 ,  
                     0 ,    
                     0 ,   
                     TRUE
                   ) ;
   PLUTO_add_hint( plint , "Shift data timecourse by delta before splitting and averaging" ) ;

   /*---------- 3rd line: computation ----------*/

   PLUTO_add_option( plint ,
                     "Compute" ,  /* label at left of input line */
                     "Compute" ,  /* tag to return to plugin */
                     TRUE         /* is this mandatory? */
                   ) ;

   PLUTO_add_string( plint ,
                     "Method" ,           /* label next to chooser button */
                     _STAVG_NUM_METHODS,  /* number of strings in list */
                     method_strings ,     /* list of strings to choose among */
                     _STAVG_METH_MEAN     /* index of default string */
                   ) ;

   PLUTO_add_hint( plint , "Choose statistic to compute" ) ;

   /*---------- 4th line --------*/

   PLUTO_add_option( plint ,
                     "Parameters" ,  /* label at left of input line */
                     "Parameters" ,  /* tag to return to plugin */
                     FALSE            /* is this mandatory? */
                   ) ;

   PLUTO_add_number( plint ,
                     "maxlength" ,    /* label next to chooser */
                     0 ,         /* smallest possible value */
                     1000 ,        /* largest possible value */
                     0 ,         /* decimal shift (none in this case) */
                     15 ,         /* default value */
                     TRUE       /* allow user to edit value? */
                   ) ;
   PLUTO_add_hint( plint , "maximum # of timepoints of output dataset" ) ;

   PLUTO_add_string( plint ,
                     "no1?" ,               /* label next to chooser button */
                     2  ,               /* number of strings to choose among */
                     yes_no_strings ,  /* list of strings to choose among */
                     1                  /* index of default string */
                   ) ;

   PLUTO_add_hint( plint , "ignore timepoints where only one image is in average" ) ;


   /*--------- done with interface setup ---------*/

   return plint ;
}
コード例 #8
0
ファイル: plug_extract.c プロジェクト: ccraddock/afni
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;     /* will be the output of this routine */

   if( ncall > 0 ) return NULL ;  /* only one interface */
   CHECK_IF_ALLOWED("3DEXTRACT","3D+t Extract") ;  /* 30 Sep 2016 */

   /*---------------- set titles and call point ----------------*/

   plint = PLUTO_new_interface( "3D+t Extract" ,
                                "Extract voxel time courses given their index or XYZ coordinates" ,
                                helpstring ,
                                PLUGIN_CALL_VIA_MENU , EXTRACT_main  ) ;

   global_plint = plint ;  /* make global copy */

   /*--------- 1st line: Input dataset and mask files ---------*/

   PLUTO_add_option( plint ,
                     "Data" ,  /* label at left of input line */
                     "Data" ,  /* tag to return to plugin */
                     TRUE       /* is this mandatory? */
                   ) ;

   PLUTO_add_dataset(  plint ,
                       "3D+time" ,        /* label next to button   */
                       ANAT_ALL_MASK ,    /* take only EPI datasets */
                       FUNC_ALL_MASK ,    /*  No fim funcs   */
                       DIMEN_4D_MASK |    /* need 3D+time datasets  */
                       BRICK_ALLREAL_MASK /* need real-valued datasets */
                    ) ;
  
   PLUTO_add_number( plint ,
                    "Ignore" ,  /* label next to chooser */
                    0 ,         /* smallest possible value */
                    50 ,        /* largest possible value (inactivated for now)*/
                    0 ,         /* decimal shift (none in this case) */
                    0 ,         /* default value */
                    FALSE       /* allow user to edit value? */
                  ) ;
	PLUTO_add_string( plint ,
                     "Dtrnd" ,  /* label next to textfield */
                     2,yn_strings,    /* strings to choose among */
                     1         /* Default option */
                   ) ;
	
	/*---------- 2nd line: Mask file info  ----------*/
   PLUTO_add_option( plint ,
                     "Mask file" ,  /* label at left of input line */
                     "Mask" ,  /* tag to return to plugin */
                     TRUE       /* is this mandatory? */
                   ) ;
   
   PLUTO_add_string( plint , "Mask File" , 0 , NULL , 19 ) ;
   
   PLUTO_add_number( plint ,
                    "N Columns" ,  /* label next to chooser */
                    1 ,         /* smallest possible value */
                    1000 ,        /* largest possible value (inactivated for now)*/
                    0 ,         /* decimal shift (none in this case) */
                    3 ,         /* default value */
                    TRUE       /* allow user to edit value? */
                  ) ;
						
	PLUTO_add_number( plint ,
                    "Pass Value" ,  /* label next to chooser */
                    -10000 ,         /* smallest possible value */
                    10000 ,        /* largest possible value (inactivated for now)*/
                    0 ,         /* decimal shift (none in this case) */
                    1 ,         /* default value */
                    TRUE       /* allow user to edit value? */
                  ) ;
	
   

   /*---------- 3rd line: index mask location ----------*/
   
   PLUTO_add_option( plint ,
                     "Index Mask ?" ,  /* label at left of input line */
                     "Index" ,  /* tag to return to plugin */
                     FALSE       /* is this mandatory? */
                   ) ;
   
   PLUTO_add_number( plint ,
                    "i col." ,  /* label next to chooser */
                    1 ,         /* smallest possible value */
                    1000 ,        /* largest possible value (inactivated for now)*/
                    0 ,         /* decimal shift (none in this case) */
                    1 ,         /* default value */
                    TRUE       /* allow user to edit value? */
                  ) ;
	
                   
   /*---------- 4th line: xyz mask location ----------*/

   PLUTO_add_option( plint ,
                     "XYZ Mask ?" ,  /* label at left of input line */
                     "XYZ" ,  /* tag to return to plugin */
                     FALSE       /* is this mandatory? */
                   ) ;

   PLUTO_add_number( plint ,
                    "x col." ,  /* label next to chooser */
                    1 ,         /* smallest possible value */
                    1000 ,        /* largest possible value */
                    0 ,         /* decimal shift (none in this case) */
                    2 ,         /* default value */
                    TRUE       /* allow user to edit value? */
                  ) ;
	
	PLUTO_add_number( plint ,
                    "y col." ,  /* label next to chooser */
                    1 ,         /* smallest possible value */
                    1000 ,        /* largest possible value */
                    0 ,         /* decimal shift (none in this case) */
                    3 ,         /* default value */
                    TRUE       /* allow user to edit value? */
                  ) ;
                  

	PLUTO_add_number( plint ,
                    "z col." ,  /* label next to chooser */
                    1 ,         /* smallest possible value */
                    1000 ,      /* largest possible value */
                    0 ,         /* decimal shift (none in this case) */
                    4 ,         /* default value */
                    TRUE       /* allow user to edit value? */
                  ) ;
                  
   /*---------- 5th line: output stuff ----------*/

   PLUTO_add_option( plint ,
                     "Output" ,  /* label at left of input line */
                     "Output" ,  /* tag to return to plugin */
                     TRUE        /* is this mandatory? */
                   ) ;

   PLUTO_add_string( plint ,
                     "AFNI Prfx" ,  /* label next to textfield */
                     0,NULL ,    /* no fixed strings to choose among */
                     19          /* 19 spaces for typing in value */
                   ) ;
   
   
   PLUTO_add_string( plint , "Filename" , 0 , NULL , 19 ) ;
              
   PLUTO_add_string( plint ,
                     "Format" ,  /* label next to textfield */
                     2,format_strings,    /* strings to choose among */
                     0          /* Default option */
                   ) ;
   
   return plint ;
}
コード例 #9
0
ファイル: plug_aslA3D3.c プロジェクト: ccraddock/afni
PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;     /* will be the output of this routine */

   if( ncall > 1 ) return NULL ;  /* two interfaces */
   CHECK_IF_ALLOWED("ASL","ASL a3/d3") ;  /* 30 Sep 2016 */

#ifdef ALLOW_TESTING
   if( ncall == 1 ) return TEST_init() ;
#else
   if( ncall == 1 ) return NULL ;
#endif

   /*---------------- set titles and call point ----------------*/

   plint = PLUTO_new_interface( "ASL a3/d3" ,
                                "ASL a3/d3 of a 3D+time Dataset" ,
                                helpstring ,
                                PLUGIN_CALL_VIA_MENU , POWER_main  ) ;

   PLUTO_add_hint( plint , "ASL a3/d3 of a 3D+time Dataset" ) ;

   PLUTO_set_sequence( plint , "A:newdset:statistics" ) ;

   /*--------- 1st line: Input dataset ---------*/

   PLUTO_add_option( plint ,
                     "Input" ,  /* label at left of input line */
                     "Input" ,  /* tag to return to plugin */
                     TRUE       /* is this mandatory? */
                   ) ;

   PLUTO_add_dataset(  plint ,
                       "---->>" ,         /* label next to button   */
                       ANAT_ALL_MASK ,    /* take any anat datasets */
                       FUNC_FIM_MASK ,    /* only allow fim funcs   */
                       DIMEN_4D_MASK |    /* need 3D+time datasets  */
                       BRICK_ALLREAL_MASK /* need real-valued datasets */
                    ) ;

   /*---------- 2nd line: Output dataset ----------*/

   PLUTO_add_option( plint ,
                     "Output" ,  /* label at left of input line */
                     "Output" ,  /* tag to return to plugin */
                     TRUE        /* is this mandatory? */
                   ) ;

   PLUTO_add_string(   plint ,
                       "Prefix" ,  /* label next to textfield */
                       0,NULL ,    /* no fixed strings to choose among */
                       19          /* 19 spaces for typing in value */
                   ) ;

   PLUTO_add_string(   plint ,
                       "Datum" ,          /* label next to chooser button */
                       NUM_TYPE_STRINGS , /* number of strings to choose among */
                       type_strings ,     /* list of strings to choose among */
                       0                  /* index of default string */
                   ) ;

   /*--------- Other lines: Parameters ---------*/

   PLUTO_add_option( plint , "Ignore" , "Ignore" , TRUE ) ;

   PLUTO_add_number( plint ,
                     "Count" ,   /* label next to chooser */
                     0 ,         /* smallest possible value */
                     999 ,       /* largest possible value */
                     0 ,         /* decimal shift (none in this case) */
                     4 ,         /* default value */
                     TRUE        /* allow user to edit value? */
                   ) ;
   PLUTO_add_string(   plint ,
                       "Image Output" ,     /* label next to chooser button */
                       NUM_TYPE_STRINGSX , /* number of strings to choose among */
                       type_stringsx ,     /* list of strings to choose among */
                       0                  /* index of default string */
                   ) ;

   PLUTO_add_option( plint , "Scale" , "Scale" , TRUE ) ;

   PLUTO_add_number( plint ,
                     "Scale Factor" ,   /* label next to chooser */
                     0 ,         /* smallest possible value */
                     999 ,       /* largest possible value */
                     0 ,         /* decimal shift (none in this case) */
                     1 ,         /* default value */
                     TRUE        /* allow user to edit value? */
                   ) ;

   return plint ;
}
コード例 #10
0
ファイル: plug_clust.c プロジェクト: LJWilliams/Neuroimaging
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;
 
   /*----- plugin option labels -----*/                      /* 19 June 1998 */
   char * boolean_types[2] = {"False", "True"};
   char * cluster_types[7] = {"Keep", "Mean", "Max", "AMax", "SMax", "Size",
			      "Order"};                      

   if( ncall > 0 ) return NULL ;  /* only one interface */

   /*-- set titles and call point --*/

   plint = PLUTO_new_interface( "3D Cluster" , "Dataset Clustering" , helpstring ,
                                 PLUGIN_CALL_VIA_MENU , CLUST_main  ) ;

   PLUTO_add_hint( plint , "Dataset Clustering" ) ;

   PLUTO_set_sequence( plint , "A:afniinfo:dsetcluster" ) ;

   /*-- first line of input: Dataset --*/

   PLUTO_add_option( plint , "Dataset" , "Dataset" , TRUE ) ;
   PLUTO_add_dataset(plint , "Function" ,
                                    ANAT_ALL_MASK , FUNC_ALL_MASK ,
                                    DIMEN_3D_MASK | BRICK_ALLREAL_MASK ) ;
   PLUTO_add_hint( plint , "Choose input dataset" ) ;

   /*-- second line of input: Cluster Parameters --*/

   PLUTO_add_option( plint , "Params" , "Params" , TRUE ) ;
   PLUTO_add_hint( plint , "Find and reject small clusters" ) ;
   PLUTO_add_string (plint, "Type", 7, cluster_types, 0);    /* 19 June 1998 */
   PLUTO_add_hint( plint , "How to process data inside clusters" ) ;
   PLUTO_add_number( plint , "Radius(mm)" , 0, 100,1 , 20,TRUE ) ;
   PLUTO_add_hint( plint , "Max distance between 'neighbors'" ) ;
   PLUTO_add_number( plint , "MinVol(ul)" , 0,1000,-1,100,TRUE ) ;
   PLUTO_add_hint( plint , "Min size for cluster to survive" ) ;


   /*---- 3rd line of input: Erosion/Dilation option ----*/  /* 19 June 1998 */
   PLUTO_add_option (plint, "Erode/Dilate", "Erode/Dilate", FALSE);
   PLUTO_add_hint (plint , "Sever narrow connecting paths between clusters");
   PLUTO_add_number (plint, "% Voxels", 0, 100, 0, 50, TRUE);
   PLUTO_add_hint (plint , 
		   "Min % of active 'neighbors' for a voxel to survive");
   PLUTO_add_string (plint, "Dilate?",  2, boolean_types, 0);
   PLUTO_add_hint (plint , "Restore voxels near main body of cluster");


   /*-- fourth line of input: Threshold (optional) --*/

   PLUTO_add_option( plint , "Threshold" , "Threshold" , FALSE ) ;
   PLUTO_add_hint( plint , "Zero out if threshold brick too small" ) ;
   PLUTO_add_number( plint , "Cutoff"    , 0,1000,2 , 50,TRUE ) ;
   PLUTO_add_hint( plint , "Threshold values < this => 0" ) ;

   /*-- fifth line of input: Prefix for output dataset --*/

   PLUTO_add_option( plint , "Output" , "Output" , FALSE ) ;
   PLUTO_add_string( plint , "Prefix" , 0,NULL , 19 ) ;
   PLUTO_add_hint( plint , "Name output dataset" ) ;

   return plint ;
}
コード例 #11
0
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init(int ncall)
{
   PLUGIN_interface * plint ;

   if( ncall > 0 ) return NULL ;  /* only one interface */

   /*-- set titles and call point --*/

   plint = PLUTO_new_interface( "Histogram: BFit" ,
                                "Betafit Histogram" ,
                                helpstring ,
                                PLUGIN_CALL_VIA_MENU , BFIT_main  ) ;

   PLUTO_add_hint( plint , "Histogram: Betafit" ) ;

   PLUTO_set_sequence( plint , "A:afniinfo:dsethistog" ) ;

   /*-- first line of input --*/

   PLUTO_add_option( plint , "Source" , "Source" , TRUE ) ;

   PLUTO_add_dataset(  plint ,
                       "Dataset" ,        /* label next to button   */
                       ANAT_ALL_MASK ,    /* take any anat datasets */
                       FUNC_ALL_MASK ,    /* only allow fim funcs   */
                       DIMEN_3D_MASK |    /* need 3D+time datasets  */
                       BRICK_ALLREAL_MASK /* need real-valued datasets */
                    ) ;
   PLUTO_add_number( plint , "Brick"  , 0,9999,0, 0,1 ) ;
   PLUTO_add_string( plint , "Square" , NYESNO , YESNO_strings , 1 ) ;

   /*-- second line of input --*/

   PLUTO_add_option( plint , "a Params" , "Params" , TRUE ) ;
   PLUTO_add_number( plint , "a bot" , 2,50 ,1 ,  5 , 1 ) ;
   PLUTO_add_number( plint , "a top" , 2,500,1 , 20 , 1 ) ;

   PLUTO_add_option( plint , "b Params" , "Params" , TRUE ) ;
   PLUTO_add_number( plint , "b bot" , 10,400 ,0 ,  10 , 1 ) ;
   PLUTO_add_number( plint , "b top" , 10,9999,0 , 200 , 1 ) ;
   PLUTO_add_number( plint , "H last", 0,1000,-1 , 0,1 ) ;

   PLUTO_add_option( plint , "Misc" , "Params" , TRUE ) ;
   PLUTO_add_number( plint , "N ran" , 10,1000,-2 , 100 , 1 ) ;
   PLUTO_add_number( plint , "% cut" , 20,90,0 , 70,1 ) ;
   PLUTO_add_string( plint , "HSqrt"  , NYESNO , YESNO_strings , 0 ) ;

   /*-- (optional) line of input --*/

   PLUTO_add_option( plint , "Mask" , "Mask" , FALSE ) ;
   PLUTO_add_dataset( plint , "Dataset" ,
                                    ANAT_ALL_MASK , FUNC_ALL_MASK ,
                                    DIMEN_ALL_MASK | BRICK_ALLREAL_MASK ) ;
   PLUTO_add_number( plint , "Brick" , 0,9999,0 , 0,1 ) ;

   /*-- (optional) line of input --*/

   PLUTO_add_option( plint , "Range"  , "Range" , FALSE ) ;
   PLUTO_add_number( plint , "Bottom" , -99999,99999, 1, 0,1 ) ;
   PLUTO_add_number( plint , "Top"    , -99999,99999,-1, 0,1 ) ;

   /*-- (optional) line of input --*/

   PLUTO_add_option( plint , "Extra"  , "Extra" , FALSE ) ;
   PLUTO_add_number( plint , "a" , 2,50,1 ,  5 , 1 ) ;
   PLUTO_add_number( plint , "b" , 10,999,0 , 200 , 1 ) ;

   return plint ;
}
コード例 #12
0
ファイル: plug_delay_V2.c プロジェクト: neurodebian/afni
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
   PLUGIN_interface * plint ;     /* will be the output of this routine */

   if( ncall > 0 ) return NULL ;  /* only one interface */

   /*---------------- set titles and call point ----------------*/

   plint = PLUTO_new_interface( "Hilbert Delay98" ,
               "Time delay between FMRI and reference time series" ,
               helpstring ,
               PLUGIN_CALL_VIA_MENU , DELAY_main  ) ;

   global_plint = plint ;  /* make global copy */

   /*--------- 1st line: Input dataset ---------*/

   PLUTO_add_option( plint ,
    "Data" ,  /* label at left of input line */
    "Data" ,  /* tag to return to plugin */
    TRUE       /* is this mandatory? */
                   ) ;

   PLUTO_add_dataset(  plint ,
      "3D+time" ,        /* label next to button   */
      ANAT_ALL_MASK ,    /* take only EPI datasets */
      FUNC_ALL_MASK ,    /*  No fim funcs   */
      DIMEN_4D_MASK |    /* need 3D+time datasets  */
      BRICK_ALLREAL_MASK /* need real-valued datasets */
   ) ;
						 
	PLUTO_add_number( plint ,
   "Nort" ,  /* label next to chooser */
   1 ,         /* smallest possible value */
   100 ,        /* largest possible value (inactivated for now)*/
   0 ,         /* decimal shift (none in this case) */
   2 ,         /* default value */
   FALSE       /* allow user to edit value? */
                  ) ;
	
   /*---------- 2nd line: Input time series ----------*/
   
   PLUTO_add_option( plint ,
    "Ref." ,  /* label at left of input line */
    "Ref." ,  /* tag to return to plugin */
    TRUE       /* is this mandatory? */
                   ) ;

   PLUTO_add_timeseries(plint,"Ref. Vect."); 
   
   PLUTO_add_number( plint ,
   "Ignore" ,  /* label next to chooser */
   0 ,         /* smallest possible value */
   50 ,        /* largest possible value (inactivated for now)*/
   0 ,         /* decimal shift (none in this case) */
   0 ,         /* default value */
   FALSE       /* allow user to edit value? */
                  ) ;
	
	PLUTO_add_string( plint ,
    "Dsamp" ,  /*label next to textfield */
    2,yn_strings,  /*   strings to choose among */
    1          /* Default option */
                   ) ; 
                   
   /*---------- 3rd line: sampling frequency ----------*/

   PLUTO_add_option( plint ,
    "Sig." ,  /* label at left of input line */
    "Sig." ,  /* tag to return to plugin */
    TRUE       /* is this mandatory? */
                   ) ;

   PLUTO_add_number( plint ,
   "fs in Hz" ,  /* label next to chooser */
   0 ,         /* smallest possible value */
   2000 ,        /* largest possible value */
   1 ,         /* decimal shift (none in this case) */
   5 ,         /* default value */
   TRUE       /* allow user to edit value? */
                  ) ;
	
	PLUTO_add_number( plint ,
   "Tstim sec" ,  /* label next to chooser */
   0.0 ,         /* smallest possible value */
   500 ,        /* largest possible value */
   0 ,         /* decimal shift (none in this case) */
   40 ,         /* default value */
   TRUE       /* allow user to edit value? */
                  ) ;

	PLUTO_add_number( plint ,
   "C-Off" ,  /* label next to chooser */
   -10 ,         /* smallest possible value */
   10 ,        /* largest possible value */
   1 ,         /* decimal shift  */
   5 ,         /* default value */
   TRUE       /* allow user to edit value? */
                  ) ;
   
   
   PLUTO_add_string( plint ,
    "No-bias" ,  /*label next to textfield */
    2,yn_strings,  /*   strings to choose among */
    1          /* Default option */
                   ) ; 
                  

	
   /*---------- 4th line: Delay Units ----------*/

   PLUTO_add_option( plint ,
    "Alg." ,  /* label at left of input line */
    "Alg." ,  /* tag to return to plugin */
    TRUE        /* is this mandatory? */
                   ) ;

   PLUTO_add_number( plint ,
   "N seg." ,  /* label next to chooser */
   1 ,         /* smallest possible value */
   1 ,        /* largest possible value (turned Off for the moment, supporting code is present)*/
   0 ,         /* decimal shift (none in this case) */
   1 ,         /* default value */
   FALSE       /* allow user to edit value? */
                  ) ;
	
	PLUTO_add_number( plint ,
   "% ovrlp" ,  /* label next to chooser */
   0 ,         /* smallest possible value */
   0 ,        /* largest possible value (not implemented)*/
   0 ,         /* decimal shift (none in this case) */
   0 ,         /* default value */
   FALSE       /* allow user to edit value? */
                  ) ;

	
   PLUTO_add_string( plint ,
    "Units" ,  /* label next to textfield */
    3,method_strings,    /* strings to choose among */
    0          /* Default option */
                   ) ;
   
   PLUTO_add_string( plint ,
    "Phz Wrp" ,  /* label next to textfield */
    2,yn_strings,    /* strings to choose among */
    0          /* Default option */
                   ) ;
                  

   /*---------- 5th line: Output dataset ----------*/

   PLUTO_add_option( plint ,
    "Output" ,  /* label at left of input line */
    "Output" ,  /* tag to return to plugin */
    TRUE        /* is this mandatory? */
                   ) ;

   PLUTO_add_string( plint ,
    "AFNI Prfx" ,  /* label next to textfield */
    0,NULL ,    /* no fixed strings to choose among */
    19          /* 19 spaces for typing in value */
                   ) ;
	
	PLUTO_add_string( plint ,
    "Write" ,  /* label next to textfield */
    2,yn_strings ,    
    1          
                   ) ;
                   
   PLUTO_add_string( plint , "Filename" , 0 , NULL , 19 ) ;
   
   PLUTO_add_string( plint ,
    "Write ts" ,  /* label next to textfield */
    2,yn_strings ,    
    1          
                   ) ;

   /*--------- done with interface setup ---------*/
   return plint ;
}
コード例 #13
0
ファイル: afni_pplug_env.c プロジェクト: Gilles86/afni
PLUGIN_interface * ENV_init(void)
{
   PLUGIN_interface *plint ;     /* will be the output of this routine */

   char *helpstring=NULL , *ept , *eval ;
   int ii ;

   /*------- some environment variables for AFNI ------*/

   { static char buf[VAL_NMAX] = "AFNI_CWD=" ;      /* 22 Feb 2001 */
     ept = getcwd( buf+9 , VAL_NMAX-9 ) ;
     if( ept != NULL ){
        putenv(buf) ;
        ENV_add_string( "AFNI_CWD" ,
                        "Current working directory (gets output files)" ,
                        0,NULL , ENV_cwd ) ;
     }
   }

   ENV_add_string( "AFNI_ENFORCE_ASPECT" ,
                   "To make AFNI enforce image window aspect ratio?" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   ENV_add_numeric( "AFNI_FIM_PERCENT_LIMIT" ,
                    "Upper limit on % Change in FIM" ,
                    10,1000,0,100 , NULL              ) ;

   ENV_add_numeric( "AFNI_IMAGE_MINFRAC" ,
                    "Minimum size of image window" ,
                    0,10,2,2 , NULL                 ) ;

   ENV_add_string( "AFNI_LEFT_IS_LEFT" ,
                   "To show subject's left on image left?" ,
                   NUM_yesno_list , yesno_list , ENV_leftisleft  ) ;

   ENV_add_string( "AFNI_NO_SIDES_LABELS" ,
                   "Skip showing image window left-side label?" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   ENV_add_string( "AFNI_VIEW_ANAT_BRICK" ,
                   "Show OverLay brick whenever possible" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   ENV_add_string( "AFNI_VIEW_FUNC_BRICK" ,
                   "Show UnderLay brick whenever possible" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   ENV_add_string( "AFNI_ORIENT" ,
                   "Coordinate display orientation" ,
                   NUM_cord_strings,cord_strings , ENV_coorder ) ;

   ENV_add_string( "AFNI_MARKERS_NOQUAL" ,
                   "Skip markers quality checking?" ,
                   NUM_yesno_list , yesno_list , ENV_marksquality  ) ;

   ENV_add_string( "AFNI_COMPRESSOR" ,
                   "Output BRIK compression method" ,
                   NUM_COMPRESS_elist,COMPRESS_elist , ENV_compressor ) ;

   ENV_add_string( "AFNI_AUTOGZIP" ,
                   "Use gzip on output if BRIK seems highly compressible" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

#if 0
   ENV_add_string( "AFNI_BYTEORDER" ,
                   "Byte ordering for output BRIKs" ,
                   NUM_byteorder_list , byteorder_list , ENV_byteorder ) ;
#endif

#if 0
   ENV_add_string( "AFNI_NOMMAP" ,
                   "Whether to read BRIKs using mmap()" ,
                   NUM_yesno_list , yesno_list , NULL    ) ;
#endif

   ENV_add_string( "AFNI_FLOATSCAN" ,
                   "Scan floating BRIKs for errors on input?" ,
                   NUM_yesno_list , yesno_list , NULL          ) ;

#ifdef USE_SESSTRAIL
   ENV_add_numeric( "AFNI_SESSTRAIL" ,
                    "# directory levels seen in Switch Session, etc." ,
                    0,9,0,SESSTRAIL , ENV_sesstrail ) ;
#endif

   ENV_add_string( "AFNI_PBAR_IMXY" ,
                   "Sizes of 'Save to PPM' for color pbars" ,
                   0,NULL , NULL ) ;

   ENV_add_string( "AFNI_PSPRINT" ,
                   "Command to send stdin to PostScript printer" ,
                   0,NULL , NULL ) ;

   ENV_add_string( "AFNI_TRUSTHOST" ,
                   "Name of host to trust for plugouts and realtime data" ,
                   0,NULL , ENV_trusthost ) ;

   ENV_add_string( "AFNI_IMAGE_LABEL_COLOR" ,
                   "Name of color for image overlay labels" , /* 21 Sep 2001 */
                   0,NULL , NULL ) ;

   ENV_add_numeric( "AFNI_IMAGE_LABEL_SETBACK" ,
                    "Size of setback for image overlay labels" ,
                    0 , 40 , 3 , 3 , NULL ) ;

   if( SUMA_ENABLED ){
     ENV_add_string( "AFNI_SUMA_BOXCOLOR" ,                   /* 21 Sep 2001 */
                     "Color name for surface node overlays [or none]" ,
                     0,NULL , NULL ) ;

     ENV_add_numeric( "AFNI_SUMA_BOXSIZE" ,                   /* 10 Mar 2002 */
                      "Box size for surface node overlays" ,
                      1 , 10 , 1 , 2 , NULL ) ;

     ENV_add_string( "AFNI_SUMA_LINECOLOR" ,                  /* 10 Mar 2002 */
                     "Color name for surface line overlays [or none]" ,
                     0,NULL , NULL ) ;

     ENV_add_numeric( "AFNI_SUMA_LINESIZE" ,                  /* 15 Jan 2003 */
                      "Line thickness for surface intersection overlay" ,
                      0 , 30 , 3 , 0 , NULL ) ;
   }

#ifndef NO_FRIVOLITIES
   ENV_add_string( "AFNI_IMAGE_PGMFILE" ,
                   "Image file for AFNI splash window" ,
                   0,NULL , NULL ) ;
#endif

   /* 08 Aug 2001 */

   ENV_add_yesno( "AFNI_DONT_MOVE_MENUS" ,
                  "Move popup menus to enhance visibility?" ) ;

   /* 07 Mar 2002 */

   ENV_add_numeric( "AFNI_GRAPH_TEXTLIMIT" ,
                    "Max rows in Graph Button-3 popup" ,
                    1 , 99 , 0 , 40 , NULL ) ;

   /* 16 Mar 2002 */

   ENV_add_string( "AFNI_KEEP_PANNING" ,
                   "Keep 'pan' turned on in image viewers?" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   /* 18 Mar 2002 */

   ENV_add_string( "AFNI_VALUE_LABEL" ,
                   "Turn on the Define Overlay dataset value label?" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   /* 22 Mar 2002 */

   ENV_add_string( "AFNI_CROSSHAIR_LINES" ,
                   "Draw crosshairs with lines, not overlay voxels?" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   /* 25 Mar 2002 */

   ENV_add_string( "AFNI_CROP_ZOOMSAVE" ,
                   "Crop zoomed images when saving to disk?" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   /* 23 Aug 2003 */

   ENV_add_numeric( "AFNI_MAX_OPTMENU" ,
                    "Max buttons in an Option Menu" ,
                    100 , 100000 , 0 , 255 , NULL ) ;

   /* 23 Oct 2003 */

   ENV_add_numeric( "AFNI_STROKE_THRESHOLD" ,
                    "Coarseness of grayscale stroking" ,
                    8 , 99 , 0 , 32 , NULL ) ;

   ENV_add_string( "AFNI_STROKE_AUTOPLOT" ,
                   "To automatically draw grayscale-data value plot?" ,
                   NUM_yesno_list , yesno_list , NULL  ) ;

   /* 04 Nov 2003 */

   ENV_add_string( "AFNI_IMAGE_MINTOMAX" ,
                   "Set new image viewers to do min-to-max grayscaling?" ,
                   NUM_yesno_list , yesno_list , ENV_redisplay  ) ;

   ENV_add_string( "AFNI_IMAGE_GLOBALRANGE" ,
   "Set image viewers to use 3D global data range by slice, volume or dataset min-max?",
              NUM_globalrange_strings , globalrange_strings , ENV_globalrange_view  ) ;


   /* 19 Nov 2003 */

   ENV_add_numeric( "AFNI_DRAW_UNDOSIZE" ,
                    "Megabytes allowed for Drawing Undo" ,
                    1 , 999 , 0 , 6 , NULL ) ;

#if !defined(NO_FRIVOLITIES) && defined(DARWIN)
   ENV_add_yesno( "AFNI_SPEECH" , "Allow speech synthesis?" ) ; /* 03 Dec 2003 */
#endif

   ENV_add_numeric( "AFNI_VIDEO_DELAY" ,                        /* 04 Dec 2003 */
                    "Image redraw interval for 'V' or 'v' (ms)." ,
                    1,9000,0,1 , NULL              ) ;

   ENV_add_numeric( "AFNI_IMAGE_ENTROPY" ,
                    "Entropy threshold: below this, 2%-98% is off." ,
                    0,10,1,0 , NULL ) ;

   ENV_add_string( "AFNI_THRESH_LOCK" ,                           /* 06 Feb 2004 */
                   "Lock Threshold slider values together?" ,
                   NUM_threshlock_list , threshlock_list , ENV_thresh_lock  ) ;

   ENV_add_string( "AFNI_GRAPH_CX2R" ,                            /* 18 Apr 2011 */
                   "Graph display of complex time series" ,
                   NUM_cx2r_list , cx2r_list , NULL  ) ;

   ENV_add_string( "AFNI_GRAPH_BOXLAB" ,                          /* 18 Apr 2011 */
                   "Box graph display of brick labels" ,
                   NUM_boxlab_list , boxlab_list , NULL  ) ;

   ENV_add_yesno( "AFNI_PBAR_LOCK" , "Lock Color Pbars together?" ) ; /* 07 Feb 2004 */
   ENV_add_yesno( "AFNI_RANGE_LOCK", "Lock OLay Ranges together?" ) ; /* 23 Feb 2004 */

   ENV_add_yesno( "AFNI_DISP_SCROLLBARS" , "Image Disp menu get scrollbars?" ) ;

   /* 23 Feb 2004 [rickr] */
   ENV_add_yesno( "AFNI_IMAGE_ZOOM_NN" ,
	           "Use Nearest Neighbor interpolation for image Zoom?" ) ;

   /* 22 Mar 2004 [RWCox] */
   ENV_add_yesno( "AFNI_SLAVE_FUNCTIME" , "Time Index affects functional overlay?" ) ;
#if 0
   ENV_add_yesno( "AFNI_SLAVE_THRTIME"  , "Time Index affects threshold overlay?" ) ;
#endif

   ENV_add_string( "AFNI_REALTIME_MP_HOST_PORT" ,     /* 31 Mar 2004 [rickr] */
                   "Supply host:port string for realtime motion parameters." ,
                   0,NULL , NULL ) ;

   /* 07 Apr 2004 [RWCox] */
   ENV_add_yesno( "AFNI_X11_REDECORATE" , "Try to set X11 window 'decorations'?" ) ;

   /* 21 Dec 2004 [RWCox] */
   ENV_add_string( "AFNI_TITLE_LABEL2" ,
                   "Use 'label2' field for window titles?" ,
                   NUM_yesno_list , yesno_list , ENV_redraw_titles ) ;

   /* 21 Mar 2005 [RWCox] */
   ENV_add_string( "AFNI_EDGIZE_OVERLAY" ,
                   "Display color overlay as edges?" ,
                   NUM_yesno_list , yesno_list , ENV_redisplay ) ;

   /* 11 Dec 2014 [RWCox] */
   ENV_add_string( "AFNI_EDGIZE_COLOR" ,
                   "Name of color for EDGIZE+Alpha overlays." , /* 21 Sep 2001 */
                   0,NULL , NULL ) ;

   /* 08 Apr 2005 [rickr] */
   ENV_add_numeric( "AFNI_NIFTI_DEBUG" ,
                    "Set nifti_io debug level (should then do Rescan:This)" ,
                    0,5,0,0 , NULL ) ;

   /* 20 Apr 2005 [RWCox] */
   ENV_add_string( "AFNI_OVERLAY_ZERO" ,
                   "Do 0 values get color in an Overlay?" ,
                   NUM_yesno_list , yesno_list , ENV_redisplay ) ;

   /* 20 Oct 2005 [RWCox] */
   ENV_add_yesno("AFNI_TTATLAS_CAUTION","Add caution to 'Where Am I' output?");

   /* 10 May 2006 [drg] */
   ENV_add_numeric( "AFNI_JPEG_COMPRESS" ,
                    "JPEG compression quality %" ,
                    1,100,0,95 , ENV_setjpegquality ) ;

   /* 21 Feb 2007 [RWCox] */
   ENV_add_yesno( "AFNI_DATASET_BROWSE" , "Switch datasets upon selection?" ) ;

   /* 05 Mar 2007 [RWCox] */
   ENV_add_yesno( "AFNI_THRESH_AUTO" , "Reset threshold on Switch Overlay?" ) ;

   /* 18 Sep 2007 [RWCox] */
   ENV_add_string( "AFNI_IMAGE_CLIPPED" ,
                   "Set new image viewers to do clipped grayscaling?" ,
                   NUM_yesno_list , yesno_list , ENV_redisplay  ) ;

   ENV_add_numeric( "AFNI_IMAGE_CLIPBOT" ,
                    "Set clipped grayscale bottom = fraction of top default" ,
                    0,50,2,25 , ENV_redisplay ) ;

   ENV_add_numeric( "AFNI_IMAGE_CLIPTOP" ,
                    "Set clipped grayscale top = fraction of default" ,
                    60,190,2,100 , ENV_redisplay ) ;

   ENV_add_numeric( "AFNI_1DPLOT_THIK" ,
                    "Set 1dplot-style line thickness" ,
                    0,20,3,3 , NULL ) ;

#if 0
   /* 20 Dec 2007 [RWCox] */
   ENV_add_string( "AFNI_CLUSTER_PREFIX" ,
                   "Prefix for Clusterize 1D file Saves" , 0 , NULL , NULL ) ;
#endif

   /* 10 Jan 2008 [RWCox] */
   ENV_add_numeric( "AFNI_CLUSTER_REPMAX" ,
                    "Max number rows in Clusterize Rpt table" ,
                    10,99,0,15 , NULL ) ;

   /* 04 Aug 2010 [RWCox] */
   ENV_add_numeric( "AFNI_CLUSTER_WAMIMAX" ,
                    "Max clusters sent to 'whereami'" ,
                    1,99,0,20 , NULL ) ;

   /* 28 Feb 2011 [RWCox] */
   ENV_add_yesno( "AFNI_CLUSTER_EBAR" ,
                  "Error bars in Clusterize plots?" ) ;

   /* 03 Jun 2008 [RWCox] */
   ENV_add_yesno( "AFNI_IMAGE_TICK_DIV_IN_MM" ,
                  "Image tick divisions count is in mm?" ) ;

   /* 09 Feb 2009 [RWCox] */
   ENV_add_numeric( "AFNI_ANIM_DUP" ,
                    "Duplication factor for MPEG save" ,
                    1,99,0,1 , NULL ) ;

   /* 29 Apr 2009 [RWCox] */
   { static char *fsize[3] = { "Normal" , "Big" , "Small" } ;
     ENV_add_string( "AFNI_TTATLAS_FONTSIZE" ,
                     "Size of 'Where am I?' window font" ,
                     3 , fsize , NULL  ) ;
   }

   /* 11 May 2009 [RWCox] */
   ENV_add_yesno( "AFNI_INSTACORR_FDR" ,
                  "Compute FDR curve for InstaCorr correlations?" ) ;

   /* 27 Aug 2009 [RWCox] */
   ENV_add_numeric( "AFNI_IMAGE_CROPSTEP" ,
                    "Cropped image panning step size" ,
                    -9,9,0,1 , NULL ) ;

   /* 06 Oct 2010 [RWCox] */
   ENV_add_string( "AFNI_IDEAL_COLORS" ,
                   "Colors for the FIM Ideal in AFNI Graph viewer" ,
                   0,NULL , NULL ) ;
   ENV_add_string( "AFNI_ORT_COLORS" ,
                   "Colors for the FIM Ort in AFNI Graph viewer" ,
                   0,NULL , NULL ) ;

   /* 27 Jun 2011 [DRG] */
   ENV_add_numeric( "AFNI_WHEREAMI_DEC_PLACES" ,
                    "Number of decimal places for whereami output" ,
                    0,4,0,0 , NULL ) ;
   ENV_add_numeric( "AFNI_WHEREAMI_MAX_FIND" ,
                    "Maximum limit for structures from an atlas for whereami output" ,
                    1,50,0,9 , ENV_wami_maxfind ) ;
   ENV_add_string( "AFNI_WHEREAMI_MAX_SEARCH_RAD" ,
                "Maximum radius for structures from an atlas for whereami output" ,
                 0, NULL, ENV_wami_maxrad ) ;
   /* 01 Jul 2011 [DRG] */
   ENV_add_string( "AFNI_ATLAS_COLORS" ,
          "Atlas to use in Atlas colors, Draw Dataset,  Go to atlas location" ,
                 0, NULL, ENV_atlas_reset ) ;

   /* 08 Nov 2011 [RWC] */
   ENV_add_string( "AFNI_IMAGE_COLORANGLE" ,
                   "Image view color scale angle" ,
                   NUM_angle_strings,angle_strings , ENV_angle_string ) ;

   /* 23 Dec 2011 [RWC] */
   ENV_add_string( "AFNI_IMAGE_LABEL_STRING" ,
                   "Extra string for image view overlay labels" ,
                   0,NULL , NULL ) ;

   /* 21 Feb 2013 [RWC] */
   ENV_add_yesno( "AFNI_HISTOG_CUMULATIVE" ,
                  "Show cumulative histogram in plugins?" ) ;

   /* 25 Jun 2013 [RWC] */
   ENV_add_numeric( "AFNI_PBAR_TICK" ,
                    "Number of tick marks for colorscale" ,
                    0,63,0,9 , NULL ) ;

   /* 23 Jul 2013 [RWC] */
   ENV_add_yesno( "AFNI_RECENTER_VIEWING" ,
                  "Re-center xhairs when switching UnderLay?" ) ;
  
   ENV_add_string( "AFNI_JUMPTO_SPACE" ,
          "Space name to use in Jump to (spacename)" ,
                 0, NULL, ENV_jumpspace_reset ) ;

   /*--------- Sort list of variables [21 Feb 2007]  -----------*/

   if( !AFNI_yesenv("AFNI_DONT_SORT_ENVIRONMENT") )
     qsort( env_var , (size_t)NUM_env_var , sizeof(ENV_var) , ENV_compare ) ;

   /*---------------- compute helpstring -----------------------*/

   helpstring = THD_zzprintf( helpstring , "%s\n" , help_start ) ;

   for( ii=0 ; ii < NUM_env_fixed ; ii++ ){
      ept = getenv(env_fixed[ii]) ;
      if( ept == NULL )
         eval = "(Not set)" ;
      else if( ept[0] == '\0' )
         eval = "(Set to empty string)" ;
      else
         eval = ept ;
      helpstring = THD_zzprintf( helpstring, " %-25.25s= %s\n",
                                             env_fixed[ii],eval  ) ;
   }

   helpstring = THD_zzprintf( helpstring , "%s\n" , help_mid ) ;

   for( ii=0 ; ii < NUM_env_var ; ii++ ){
      helpstring = THD_zzprintf( helpstring, " %-25.25s: %s\n" ,
                                 env_var[ii].vname , env_var[ii].vhint ) ;
   }

   helpstring = THD_zzprintf( helpstring , "%s\n" , help_end ) ;

   /*---------------- set titles and call point ----------------*/

   plint = PLUTO_new_interface( "Environment" ,
                                "Environment variables control" ,
                                helpstring ,
                                PLUGIN_CALL_VIA_MENU , ENV_main  ) ;
   free(helpstring) ;

   PLUTO_add_hint( plint , "Environment variables control" ) ;

   PLUTO_set_runlabels( plint , "Set+Keep" , "Set+Close" ) ;  /* 04 Nov 2003 */

   /*--------- make interface lines: 1 for each variable -----------*/

   for( ii=0 ; ii < NUM_env_var ; ii++ ){

      PLUTO_add_option( plint ,
                        "" ,                 /* label at left of input line */
                        env_var[ii].vname ,  /* tag to return to plugin */
                        FALSE                /* is this mandatory? */
                      ) ;

      ept = getenv( env_var[ii].vname ) ;

      switch( env_var[ii].vtype ){

         default: break ;  /* should never happen */

         case ENV_NUMBER_FIXED:
         case ENV_NUMBER_EDITABLE:{
            double dval=env_var[ii].vdef ; int ival ;

            if( ept != NULL ){
               dval = strtod(ept,NULL) ;
               AV_SHIFT_VAL(-env_var[ii].vdecim,dval) ;
            }
            ival = rint(dval) ;
                 if( ival < env_var[ii].vbot ) ival = env_var[ii].vbot ;
            else if( ival > env_var[ii].vtop ) ival = env_var[ii].vtop ;

            PLUTO_add_number( plint ,
                              env_var[ii].vname ,
                              env_var[ii].vbot  ,
                              env_var[ii].vtop  ,
                              env_var[ii].vdecim,
                              ival,(env_var[ii].vtype==ENV_NUMBER_EDITABLE) ) ;
            PLUTO_add_hint( plint , env_var[ii].vhint ) ; /* 8 Apr 2005 rickr */
         }
         break ;

         case ENV_STRING:{
            if( env_var[ii].vcount <= 0 ){
               PLUTO_add_string( plint ,
                                 env_var[ii].vname ,
                                 0 , &ept , NAME_NMAX ) ;
               PLUTO_add_hint( plint , env_var[ii].vhint ) ;
            } else {
               int dval , jj ;
               char ** sval ;

               dval = 1 + PLUTO_string_index( ept , env_var[ii].vcount ,
                                                    env_var[ii].vlist   ) ;

               sval = (char **) malloc( sizeof(char *)*(1+env_var[ii].vcount) ) ;
               sval[0] = "(Not set)" ;
               for( jj=0 ; jj < env_var[ii].vcount ; jj++ )
                  sval[jj+1] = env_var[ii].vlist[jj] ;

               PLUTO_add_string( plint ,
                                 env_var[ii].vname  ,
                                 1+env_var[ii].vcount , sval , dval ) ;
               PLUTO_add_hint( plint , env_var[ii].vhint ) ;
               free(sval) ;
            }
         }
         break ;
      } /* end of switch over variable type */

   } /* end of loop over variables */

   /*--------- done with interface setup ---------*/

   return plint ;
}
コード例 #14
0
ファイル: plug_imreg.c プロジェクト: ccraddock/afni
DEFINE_PLUGIN_PROTOTYPE

PLUGIN_interface * PLUGIN_init( int ncall )
{
    PLUGIN_interface * plint ;     /* will be the output of this routine */

    if( ncall > 0 ) return NULL ;  /* only one interface */
    CHECK_IF_ALLOWED("2DREGISTRATION","2D Registration") ;  /* 30 Sep 2016 */

    /*---------------- set titles and call point ----------------*/

    plint = PLUTO_new_interface( "2D Registration" ,
                                 "2D Registration of a 3D+time Dataset" ,
                                 helpstring ,
                                 PLUGIN_CALL_VIA_MENU , IMREG_main  ) ;

    PLUTO_add_hint( plint , "2D Registration of a 3D+time Dataset" ) ;

    global_plint = plint ;  /* make global copy */

    PLUTO_set_sequence( plint , "A:newdset:reg" ) ;

    /*--------- 1st line ---------*/

    PLUTO_add_option( plint ,
                      "Datasets" ,  /* label at left of input line */
                      "DAtasets" ,  /* tag to return to plugin */
                      TRUE          /* is this mandatory? */
                    ) ;

    PLUTO_add_dataset(  plint ,
                        "Input" ,          /* label next to button   */
                        ANAT_ALL_MASK ,    /* take any anat datasets */
                        FUNC_FIM_MASK ,    /* only allow fim funcs   */
                        DIMEN_4D_MASK |    /* need 3D+time datasets  */
                        BRICK_ALLREAL_MASK /* need real-valued datasets */
                     ) ;

    PLUTO_add_string( plint ,
                      "Output" ,  /* label next to textfield */
                      0,NULL ,    /* no fixed strings to choose among */
                      19          /* 19 spaces for typing in value */
                    ) ;

    /*---------- 2nd line --------*/

    PLUTO_add_option( plint ,
                      "Parameters" ,  /* label at left of input line */
                      "Parameters" ,  /* tag to return to plugin */
                      TRUE            /* is this mandatory? */
                    ) ;

    PLUTO_add_number( plint ,
                      "Base" ,    /* label next to chooser */
                      0 ,         /* smallest possible value */
                      98 ,        /* largest possible value */
                      0 ,         /* decimal shift (none in this case) */
                      3 ,         /* default value */
                      FALSE       /* allow user to edit value? */
                    ) ;

    /*---------- 3rd line --------*/

    PLUTO_add_option( plint ,
                      "Fine Fit" ,
                      "Fine Fit" ,
                      FALSE
                    ) ;

    PLUTO_add_number( plint , "Blur" , 0 , 40 , 1 , 10 , FALSE ) ;
    PLUTO_add_number( plint , "Dxy"  , 1 , 20 , 2 ,  7 , FALSE ) ;
    PLUTO_add_number( plint , "Dphi" , 1 , 50 , 2 , 21 , FALSE ) ;

    /*--------- done with interface setup ---------*/

    return plint ;
}