Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

plug_3Ddump_V2.c File Reference

#include "afni.h"
#include "afni_plugin.h"

Go to the source code of this file.


Data Structures

struct  extract_data

Defines

#define NUM_YN_STRINGS   (sizeof(yn_strings)/sizeof(char *))
#define YUP   1
#define NOPE   0
#define ERROR_FILEWRITE   2
#define ERROR_OPTIONS   3

Functions

int filexists (char *)
char * DUMP_main (PLUGIN_interface *)
int Dumpit (extract_data *, THD_3dim_dataset *)
void write_ud (extract_data *)
char ** allocate2D (int rows, int cols, int element_size)
void free2D (char **a, int rows)
int equal_strings (char *s1, char *s2)
DEFINE_PLUGIN_PROTOTYPE PLUGIN_interface * PLUGIN_init (int ncall)

Variables

char helpstring []
char * yn_strings [] = { "n" , "y" }

Define Documentation

#define ERROR_FILEWRITE   2
 

Definition at line 114 of file plug_3Ddump_V2.c.

#define ERROR_OPTIONS   3
 

Definition at line 115 of file plug_3Ddump_V2.c.

#define NOPE   0
 

Definition at line 112 of file plug_3Ddump_V2.c.

Referenced by DUMP_main(), and Dumpit().

#define NUM_YN_STRINGS   (sizeof(yn_strings)/sizeof(char *))
 

Definition at line 109 of file plug_3Ddump_V2.c.

#define YUP   1
 

Definition at line 111 of file plug_3Ddump_V2.c.

Referenced by DUMP_main(), and Dumpit().


Function Documentation

char ** allocate2D int    rows,
int    cols,
int    element_size
[static]
 

Definition at line 651 of file plug_3Ddump_V2.c.

References calloc, cols, free, i, and rows.

Referenced by Dumpit().

00653 {
00654     int i, j;
00655     char **A;
00656 
00657 /* try to allocate the request */
00658     switch(element_size) {
00659         case sizeof(short): {    /* integer matrix */
00660             short **int_matrix;
00661             int_matrix = (short **)calloc(rows,sizeof(short *));
00662             if(!int_matrix) {
00663                 printf("\nError making pointers in %dx%d int matrix\n"
00664                             ,rows,cols);
00665                 return(NULL);
00666                 /*                exit(1);*/
00667             }
00668             for(i = 0 ; i < rows ; i++) {
00669                 int_matrix[i] = (short *)calloc(cols,sizeof(short));
00670                 if(!int_matrix[i]) {
00671                     printf("\nError making row %d in %dx%d int matrix\n"
00672                             ,i,rows,cols);
00673                     for(j=0;j<=i;j++) {
00674                       if(int_matrix[j])
00675                         free(int_matrix[j]);
00676                     }
00677                     free(int_matrix);
00678                     return(NULL);
00679                     /*                    exit(1);*/
00680                 }
00681             }
00682             A = (char **)int_matrix;
00683             break;
00684         }
00685         case sizeof(float): {    /* float matrix */
00686             float **float_matrix;
00687             float_matrix = (float **)calloc(rows,sizeof(float *));
00688             if(!float_matrix) {
00689                 printf("\nError making pointers in %dx%d float matrix\n"
00690                             ,rows,cols);
00691                 return(NULL);
00692                 /*                exit(1);*/
00693             }
00694             for(i = 0 ; i < rows ; i++) {
00695                 float_matrix[i] = (float *)calloc(cols,sizeof(float));
00696                 if(!float_matrix[i]) {
00697                     printf("\nError making row %d in %dx%d float matrix\n"
00698                             ,i,rows,cols);
00699                     for(j=0;j<=i;j++) {
00700                       if(float_matrix[j])
00701                         free(float_matrix[j]);
00702                     }
00703                     free(float_matrix);
00704                     return(NULL);
00705                     /*                    exit(1);*/
00706                 }
00707             }
00708             A = (char **)float_matrix;
00709             break;
00710         }
00711         case sizeof(double): {   /* double matrix */
00712             double **double_matrix;
00713             double_matrix = (double **)calloc(rows,sizeof(double *));
00714             if(!double_matrix) {
00715                 printf("\nError making pointers in %dx%d double matrix\n"
00716                             ,rows,cols);
00717                 return(NULL);
00718                 /*                exit(1);*/
00719             }
00720             for(i = 0 ; i < rows ; i++) {
00721                 double_matrix[i] = (double *)calloc(cols,sizeof(double));
00722                 if(!double_matrix[i]) {
00723                     printf("\nError making row %d in %dx%d double matrix\n"
00724                             ,i,rows,cols);
00725                     for(j=0;j<=i;j++) {
00726                       if(double_matrix[j])
00727                         free(double_matrix[j]);
00728                     }
00729                     free(double_matrix);
00730                     return(NULL);
00731 
00732                     /*                    exit(1);*/
00733                 }
00734             }
00735             A = (char **)double_matrix;
00736             break;
00737         }
00738         default:
00739             printf("\nERROR in matrix_allocate: unsupported type\n");
00740             return(NULL);
00741             /*            exit(1);*/
00742     }
00743     return(A);
00744 }

char * DUMP_main PLUGIN_interface *    [static]
 

Definition at line 258 of file plug_3Ddump_V2.c.

References calloc, extract_data::DoInd, extract_data::DoInt, extract_data::DoThres, DSET_FILECODE, DSET_NVALS, DSET_PREFIX, extract_data::dsetname, Dumpit(), equal_strings(), filexists(), extract_data::fimonly, FUNC_FIM_TYPE, THD_3dim_dataset::func_type, extract_data::intind, extract_data::isanat, ISANAT, extract_data::isfunc, ISFUNC, extract_data::maxi, extract_data::maxth, extract_data::mini, extract_data::minth, NOPE, extract_data::Nsub, extract_data::nxx, extract_data::nyy, extract_data::outfile, extract_data::outlogfile, PLUTO_find_dset(), extract_data::strout, extract_data::thrind, and YUP.

Referenced by PLUGIN_init().

00259 {
00260    extract_data uda,*ud;
00261    MCW_idcode * idc ;
00262    THD_3dim_dataset * xset , * yset ;
00263    char * tag ;
00264    int demean ,ndmp,nprf;
00265    char *str, *nprfxstr, *mssg;
00266    float minx , maxx , minthr , maxthr ;
00267         
00268         str = (char *) calloc (PLUGIN_MAX_STRING_RANGE+10,sizeof(char));
00269         nprfxstr         = (char *) calloc (PLUGIN_MAX_STRING_RANGE+20,sizeof(char));
00270         /* Do not allocate more space for mssg, because AFNI would choke on it*/
00271         mssg = (char *) calloc (PLUGIN_MAX_STRING_RANGE,sizeof(char));
00272         
00273         if (str == NULL || nprfxstr == NULL || mssg == NULL ) 
00274                                                                           return "********************\n"
00275                                                                                                 "Could not Allocate\n"
00276                                                                                                 "a teeni weeni bit of\n"
00277                                                                                                 "Memory ! \n"
00278                                                                                                 "********************\n";
00279 
00280         ud = &uda;              /* ud now points to an allocated space */
00281    
00282    /*--------------------------------------------------------------------*/
00283    /*----- Check inputs from AFNI to see if they are reasonable-ish -----*/
00284         tag = PLUTO_get_optiontag(plint) ;
00285    
00286    if (tag == NULL)
00287         {
00288                 return "************************\n"
00289              "Bad 1st line option \n"
00290              "************************"  ;
00291         }       
00292         
00293    
00294    idc  = PLUTO_get_idcode(plint) ;     /* get 1st dataset item */
00295    xset = PLUTO_find_dset(idc) ;                   /* get ptr to dataset */
00296    if( xset == NULL )
00297       return "**********************\n"
00298              "Cannot find Dataset #1\n"
00299              "**********************"  ;
00300         
00301         ud->dsetname = DSET_FILECODE (xset);
00302         ud->Nsub = DSET_NVALS (xset);
00303         
00304         /*--------- loop over ramining options ---------*/
00305         ud->DoInt = NOPE;
00306         ud->DoThres = NOPE;
00307         ud->DoInd = NOPE;
00308         
00309         ud->intind = 1; /* The first subbrick is numbered 1 here, it makes more sense to the user.*/
00310         ud->thrind = 2; 
00311         
00312         do
00313                 {
00314                         tag = PLUTO_get_optiontag(plint) ;
00315                         if (tag == NULL) break;
00316                         
00317                         if (equal_strings (tag, "Index") == 1)
00318                                 {
00319                                         ud->DoInd = YUP;
00320                                         ud->intind = PLUTO_get_number(plint) ; 
00321                                         ud->thrind = PLUTO_get_number(plint) ;
00322                                         continue; 
00323                                 }
00324                         
00325                         if (equal_strings (tag, "Intensity") == 1)
00326                                 {
00327                                         ud->DoInt = YUP;
00328                                         ud->mini = PLUTO_get_number(plint) ; 
00329                                         ud->maxi = PLUTO_get_number(plint) ;
00330                                         continue;
00331                                 }
00332                         
00333                         if (equal_strings (tag, "Threshold") == 1)
00334                                 {
00335                                         ud->DoThres = YUP;
00336                                         ud->minth = PLUTO_get_number(plint) ; 
00337                                         ud->maxth = PLUTO_get_number(plint) ;
00338                                         continue;
00339                                 }
00340                         
00341                         if (equal_strings (tag, "Output") == 1)
00342                                         {
00343                                                 ud->strout = PLUTO_get_string(plint) ; 
00344                                                 continue;
00345                                         }
00346                         
00347                         
00348                 } while (1);
00349                 
00350         if ( ISFUNC(xset) ) ud->isfunc = YUP;
00351                 else ud->isfunc = NOPE;
00352         
00353         if ( ISANAT(xset) ) ud->isanat = YUP;
00354                 else ud->isanat = NOPE;
00355         
00356         if (xset->func_type == FUNC_FIM_TYPE)
00357                         ud->fimonly = 1;
00358                 else
00359                         ud->fimonly = 0;
00360         
00361         if (ud->isanat && (ud->DoThres== YUP || ud->DoInd == YUP))
00362                 {
00363                         return "*************************************\n"
00364                 "Can't use threshold or index options \n" 
00365                 "for fim or ANAT type bricks !\n"
00366                 "*************************************"  ;
00367                 }
00368         
00369 
00370         if (ud->DoInd == YUP && (ud->fimonly == YUP && ud->isfunc == YUP))
00371                 {
00372                         return "*******************************\n"
00373                 "Can't specify Indices for fim\n" 
00374                 "type bricks, they only have one !\n"
00375                 "*******************************"  ;
00376                 }
00377                         
00378 
00379         /* Check for plausibility of input parameters */
00380         if ((ud->DoInt && (ud->maxi < ud->mini)) || (ud->DoThres && (ud->maxth < ud->minth)))
00381                 {
00382                 return "**********************\n"
00383              "Something's wrong with\n" 
00384              "min and max  values.\n"
00385              "**********************"  ;
00386                 }
00387         if (ud->DoInd && (ud->intind > ud->Nsub || ud->thrind > ud->Nsub))
00388                 {
00389                 
00390                 return "**********************\n"
00391              "One or both of the indices\n" 
00392              "is larger than the maximum\n"
00393                                  "number of sub-bricks\n"
00394              "**********************"  ;
00395                 }
00396 
00397         /*------------------------------------------------------*/
00398    /*----- Open the output file for writing operation -----*/
00399    
00400         /*if strout is null or of length 0, use the a default name */
00401         if (ud->strout == NULL)
00402         nprf = 0;
00403    else
00404         nprf = 1;
00405         
00406         
00407    if (nprf == 1 && (int)strlen(ud->strout) == 0)
00408         nprf = 0;
00409                 
00410         
00411    if (nprf == 0)
00412         {
00413                         sprintf (nprfxstr,"%s.3Ddump",DSET_PREFIX(xset));
00414                         ud->strout = nprfxstr;
00415         }
00416 
00417    
00418         sprintf (str,"%s.log",ud->strout);      
00419                 
00420    if ((filexists(ud->strout) == 1) || (filexists(str) == 1))
00421         {
00422                 return "**************************************\n"
00423                        "Output file(s) exists, can't overwrite\n"
00424                        "**************************************\n";
00425         }
00426         
00427         ud->outfile = fopen (ud->strout,"w");
00428         ud->outlogfile = fopen (str,"w");
00429         
00430         if ((ud->outfile == NULL) || (ud->outlogfile == NULL))
00431                 {
00432                         return "*****************************************\n"
00433                        "Could not open Output file(s) for writing\n"
00434                        "Check permissions.\n"
00435                        "*****************************************\n";
00436                 }
00437         
00438    /*------------------------------------------------------*/
00439    /*---------- At this point, the inputs are OK ----------*/
00440 
00441    /*-- do the actual work --*/
00442    ndmp = Dumpit( ud ,  xset ) ;
00443 
00444    if( ndmp < -1.0 )
00445       {
00446                         switch (ndmp)
00447                                 {
00448                                         case -2:
00449                                                 return  "********************************************\n"
00450                                                 "Fatal Error: Could not allocate memory\n"
00451                                                                         "(this is a message brought to you by Dumpit)\n"
00452                                                 "********************************************\n"  ;
00453                                                 break;
00454                                         default:
00455                                                 return  "*********************************\n"
00456                                                 "Error while dumping data\n"
00457                                                 "*********************************"  ;
00458 
00459                                                 break;
00460                         
00461                                 }
00462                 }
00463 
00464    /*-- put the output to the screen --*/
00465 
00466    /* That output message was too long. AFNI was crashing, must ask Bob to allow more verbose messages */ 
00467          
00468    /*sprintf(mssg , "            Dataset %s was dumped.\n"
00469                  "%d voxels (%5f %% of total) met the boundary conditions.\n"
00470                   , DSET_FILECODE(xset) , ndmp , (float)ndmp/(float)(ud->nxx * ud->nyy * ud-> nzz)*100.0) ;*/
00471                                                 
00472    /* That's shorter */
00473         sprintf(mssg , "%d voxels (%5f %% of total) were dumped.\n" 
00474                          , ndmp , (float)ndmp/(float)(ud->nxx * ud->nyy * ud-> nzz)*100.0) ;
00475 
00476         PLUTO_popup_message( plint , mssg ) ;
00477         
00478         
00479         
00480         fclose (ud->outfile);
00481         fclose (ud->outlogfile);
00482         free (nprfxstr);        
00483         free (str);
00484         free (mssg); 
00485          
00486    return NULL ;  /* null string returned means all was OK */
00487 }

int Dumpit extract_data  ,
THD_3dim_dataset  
[static]
 

Definition at line 490 of file plug_3Ddump_V2.c.

References allocate2D(), NOPE, write_ud(), and YUP.

Referenced by DUMP_main().

00491 {
00492    void  *  xar  ;
00493    void  * thar ;
00494    float * fxar  ;
00495         float ** Storear;
00496    int ii , jj, nxyz , fxar_new = 0  ,xpos,ypos,zpos , ndmp, pass;
00497 
00498         ndmp = -1;
00499         
00500    /*-- get datasets sizes --*/
00501 
00502         ud->nxx = xset->daxes->nxx;
00503         ud->nyy = xset->daxes->nyy;
00504         ud->nzz = xset->daxes->nzz;
00505         
00506    nxyz = xset->daxes->nxx * xset->daxes->nyy * xset->daxes->nzz ;
00507 
00508    /* Allocate space for data storage */
00509         fxar = (float *) malloc( sizeof(float) * nxyz ) ; fxar_new = 1 ;
00510    Storear = (float **) allocate2D (ud->Nsub ,nxyz ,sizeof(float)); /* changed from :  allocate2D (nxyz  ,ud->Nsub,sizeof(float)) */
00511         
00512         if (fxar == NULL || Storear == NULL)
00513                 {
00514                         return -2;
00515                 }
00516         
00517         /*-- load the first dataset into memory --*/
00518 
00519                 DSET_load( xset ) ;
00520                 
00521         /* Store Bricks in 2D array */  
00522    for (ii = 0;ii < ud->Nsub; ++ii)
00523                 {
00524                 xar   = DSET_ARRAY(xset,ii) ;        /* get the array */
00525                 EDIT_coerce_scale_type (nxyz,DSET_BRICK_FACTOR(xset,ii),
00526                                                         DSET_BRICK_TYPE(xset,ii), xar,  MRI_float,fxar ) ;   
00527                         
00528                         /* Store the iith sub-brick in Storear array */
00529                         for (jj = 0; jj < nxyz; ++jj)
00530                                         Storear[ii][jj] = fxar[jj]; /* changed from : Storear[jj][ii] */
00531                 }
00532                 
00533    DSET_unload( xset ) ;  /* don't need this in memory anymore */
00534         
00535         /* Dump the input info data to the log file */
00536         write_ud (ud);
00537         
00538 
00539    /* Now dump the data that meets the threshold */
00540 
00541    if( 1 ){
00542       for( ii=0 ; ii < nxyz ; ii++ ){
00543         pass = YUP;
00544         if (pass && ud->DoInt)
00545                 {
00546                         if (Storear[ud->intind-1][ii] < ud->mini || Storear[ud->intind-1][ii] > ud->maxi) /* changed both from : Storear[ii][ud->intind-1]*/
00547                                 pass = NOPE;
00548                 }
00549         
00550         if (pass && ud->DoThres)   
00551                 {
00552                         if (Storear[ud->thrind-1][ii] < ud->minth || Storear[ud->thrind-1][ii] > ud->maxth)/* changed both from : Storear[ii][ud->intind-1]*/
00553                                 pass = NOPE;
00554                 }
00555         
00556         if (pass)
00557         {
00558                 zpos = (int)ii / (int)(xset->daxes->nxx * xset->daxes->nyy);
00559                                 ypos = (int)(ii - zpos * xset->daxes->nxx * xset->daxes->nyy) / xset->daxes->nxx;
00560                                 xpos = ii - ( ypos * xset->daxes->nxx ) - ( zpos * xset->daxes->nxx * xset->daxes->nyy ) ;
00561                 
00562                 fprintf (ud->outfile,"%d\t%d\t%d\t%d\t",ii,xpos,ypos,zpos);
00563                         
00564                                 for (jj = 0; jj < ud->Nsub; ++jj)
00565                                         fprintf (ud->outfile," %f\t",Storear[jj][ii]); /* changed from: Storear[ii][jj] */
00566                                         
00567                                 fprintf (ud->outfile,"\n");
00568                                                 
00569                                 ++ndmp;
00570          }
00571         }
00572                 
00573                 /* increment by one because I want it to start at 0 */
00574         ++ndmp;
00575    }
00576         
00577         
00578         fprintf (ud->outlogfile,"\n%d voxel points met the threshold conditions\n",ndmp);
00579         
00580    /*-- free up arrays --*/
00581 
00582         
00583    if( fxar_new ) 
00584                 {
00585                 free(fxar) ;
00586                 }
00587          else 
00588                 {
00589                         DSET_unload(xset) ;
00590                 }
00591         
00592         
00593         free2D ((char **)Storear,ud->Nsub);     /* changed from free2D ((char **)Storear,nxyz); */
00594 
00595         
00596    return ndmp ;
00597 }

int equal_strings char *    s1,
char *    s2
[static]
 

Definition at line 769 of file plug_3Ddump_V2.c.

References i, and s2.

00771  {
00772    int i=0;
00773    
00774    if (s1 == NULL && s2 == NULL) return (-2);
00775    
00776    if ((s1 == NULL && s2 != NULL) || (s1 != NULL && s2 == NULL)) return (-1);
00777    
00778    while (s1[i] == s2[i] 
00779                         && s1[i] != '\0' && s2[i] != '\0') ++i;
00780                         
00781         if (s1[i] == '\0' && s2[i] == '\0') return (1);
00782          else return (0);
00783  
00784  }

int filexists char *    [static]
 

Definition at line 604 of file plug_3Ddump_V2.c.

00605 {/*filexists*/
00606         FILE *outfile;
00607         
00608         outfile = fopen (f_name,"r");
00609         if (outfile == NULL)
00610                 return (0);
00611         else 
00612                 fclose (outfile);
00613                 return (1);
00614                 
00615 }/*filexists*/

void free2D char **    a,
int    rows
[static]
 

Definition at line 749 of file plug_3Ddump_V2.c.

References a, free, i, and rows.

00751 {
00752     int i;
00753     
00754 /* free each row of data */
00755     for(i = 0 ; i < rows ; i++) free(a[i]);
00756 
00757 /* free each row pointer */
00758     free((char *)a);
00759     a = NULL;           /* set to null for error */
00760     
00761         return;
00762 }

DEFINE_PLUGIN_PROTOTYPE PLUGIN_interface* PLUGIN_init int    ncall
 

Definition at line 139 of file plug_3Ddump_V2.c.

References ANAT_ALL_MASK, DUMP_main(), FUNC_ALL_MASK, helpstring, and PLUTO_set_runlabels().

00140 {
00141    PLUGIN_interface * plint ;
00142 
00143    if( ncall > 0 ) return NULL ;  /* only one interface */
00144 
00145    /*-- set titles and call point --*/
00146 
00147    plint = PLUTO_new_interface( "3D Dump98" , "Ascii dump of 3D Dataset" , helpstring ,
00148                                  PLUGIN_CALL_VIA_MENU , DUMP_main  ) ;
00149 
00150    PLUTO_set_runlabels( plint , "Dump+Keep" , "Dump+Close" ) ;  /* 04 Nov 2003 */
00151 
00152    /*-- first line of input: Dataset --*/
00153 
00154    PLUTO_add_option( plint , "Dataset" , "Dataset" , TRUE ) ;
00155    PLUTO_add_dataset(plint , "3D brick" ,
00156                                     ANAT_ALL_MASK  ,  FUNC_ALL_MASK ,
00157                                     SESSION_ALL_MASK |
00158                                     DIMEN_3D_MASK    | BRICK_ALLREAL_MASK ) ;
00159    
00160         /*-- second line of input: intensity and threshold brick indices --*/
00161    
00162    
00163         PLUTO_add_option( plint ,
00164                      "SubBrik info" ,  /* label at left of input line */
00165                      "Index" ,  /* tag to return to plugin */
00166                      FALSE       /* is this mandatory? */
00167                    ) ;
00168         PLUTO_add_number( plint ,
00169                     "Intensity" ,  /* label next to chooser */
00170                     1 ,         /* smallest possible value */
00171                     10000 ,        /* largest possible value (inactivated for now)*/
00172                     0 ,         /* decimal shift (none in this case) */
00173                     0 ,         /* default value */
00174                     FALSE       /* allow user to edit value? */
00175                   ) ;
00176                                 
00177         PLUTO_add_number( plint ,
00178                     "Threshold" ,  /* label next to chooser */
00179                     1 ,         /* smallest possible value */
00180                     10000 ,        /* largest possible value (inactivated for now)*/
00181                     0 ,         /* decimal shift (none in this case) */
00182                     2 ,         /* default value */
00183                     FALSE       /* allow user to edit value? */
00184                   ) ;   
00185         /*-- Third line of input: intensity mask --*/
00186    
00187    PLUTO_add_option( plint ,
00188                      "Intensity Mask" ,  /* label at left of input line */
00189                      "Intensity" ,  /* tag to return to plugin */
00190                      FALSE       /* is this mandatory? */
00191                    ) ;
00192    
00193    PLUTO_add_number( plint ,
00194                     "Minimum" ,  /* label next to chooser */
00195                     -100000 ,         /* smallest possible value */
00196                     100000 ,        /* largest possible value (inactivated for now)*/
00197                     0 ,         /* decimal shift (none in this case) */
00198                     0 ,         /* default value */
00199                     TRUE       /* allow user to edit value? */
00200                   ) ;
00201                   
00202         PLUTO_add_number( plint ,
00203                     "Maximum" ,  /* label next to chooser */
00204                     -10000 ,         /* smallest possible value */
00205                     10000 ,        /* largest possible value (inactivated for now)*/
00206                     0 ,         /* decimal shift (none in this case) */
00207                     0 ,         /* default value */
00208                     TRUE       /* allow user to edit value? */
00209                   ) ;
00210    
00211    /*-- Fourth line of input: threshold mask --*/
00212    
00213    PLUTO_add_option( plint ,
00214                      "Threshold Mask" ,  /* label at left of input line */
00215                      "Threshold" ,  /* tag to return to plugin */
00216                      FALSE       /* is this mandatory? */
00217                    ) ;
00218    
00219    PLUTO_add_number( plint ,
00220                     "Minimum" ,  /* label next to chooser */
00221                     -10000 ,         /* smallest possible value */
00222                     10000 ,        /* largest possible value (inactivated for now)*/
00223                     0 ,         /* decimal shift (none in this case) */
00224                     0.5 ,         /* default value */
00225                     TRUE       /* allow user to edit value? */
00226                   ) ;
00227                   
00228         PLUTO_add_number( plint ,
00229                     "Maximum" ,  /* label next to chooser */
00230                     -10000 ,         /* smallest possible value */
00231                     10000 ,        /* largest possible value (inactivated for now)*/
00232                     0 ,         /* decimal shift (none in this case) */
00233                     1 ,         /* default value */
00234                     TRUE       /* allow user to edit value? */
00235                   ) ;
00236    
00237    /*---------- 5th line: output stuff ----------*/
00238 
00239    PLUTO_add_option( plint ,
00240                      "Output" ,  /* label at left of input line */
00241                      "Output" ,  /* tag to return to plugin */
00242                      TRUE        /* is this mandatory? */
00243                    ) ;
00244 
00245    PLUTO_add_string( plint ,
00246                      "Filename" ,  /* label next to textfield */
00247                      0,NULL ,    /* no fixed strings to choose among */
00248                      19          /* 19 spaces for typing in value */
00249                    ) ;
00250                   
00251    return plint ;
00252 }

void write_ud extract_data   [static]
 

Definition at line 621 of file plug_3Ddump_V2.c.

References extract_data::DoInd, extract_data::DoInt, extract_data::DoThres, extract_data::dsetname, extract_data::fimonly, extract_data::intind, extract_data::maxi, extract_data::maxth, extract_data::mini, extract_data::minth, extract_data::Nsub, extract_data::nxx, extract_data::nyy, extract_data::nzz, extract_data::outlogfile, extract_data::strout, and extract_data::thrind.

Referenced by Dumpit().

00622         {
00623                 fprintf (ud->outlogfile,"\n\nUser Data Values \n");
00624                 fprintf (ud->outlogfile,"Input data set file name= %s\n",ud->dsetname);
00625                 fprintf (ud->outlogfile,"Is the file fim only type ? = %d\n",ud->fimonly);
00626                 fprintf (ud->outlogfile,"Number of Subbricks : %d\n",ud->Nsub);
00627                 fprintf (ud->outlogfile,"output file name = %s\n",ud->strout);
00628                 fprintf (ud->outlogfile,"Number of voxels in X direction = %d\n",ud->nxx);
00629                 fprintf (ud->outlogfile,"Number of voxels in Y direction = %d\n",ud->nyy);
00630                 fprintf (ud->outlogfile,"Number of voxels in Z direction = %d\n",ud->nzz);
00631                 fprintf (ud->outlogfile,"Do intensity mask ? = %d\n",ud->DoInt);
00632                 fprintf (ud->outlogfile,"Minimum intensity = %f\n",ud->mini);
00633                 fprintf (ud->outlogfile,"Maximum intensity = %f\n",ud->maxi);
00634                 fprintf (ud->outlogfile,"Do threshold mask ? = %d\n",ud->DoThres);
00635                 fprintf (ud->outlogfile,"Minimum threshold = %f\n",ud->minth);
00636                 fprintf (ud->outlogfile,"Maximum threshold = %f\n",ud->maxth);
00637                 fprintf (ud->outlogfile,"Select Intensity and Threshold indices = %d\n",ud->DoInd);
00638                 fprintf (ud->outlogfile,"Intensity index = %d\n",ud->intind);
00639                 fprintf (ud->outlogfile,"Threshold index = %d\n",ud->thrind);
00640                 fprintf (ud->outlogfile,"\nThe format for the output file is the following:\n");
00641            fprintf (ud->outlogfile,"VI\tX\tY\tZ\tSb1\tSb2\t... Sbn\n\n");
00642                 
00643                 
00644                 return;
00645         }

Variable Documentation

char helpstring[] [static]
 

Definition at line 47 of file plug_3Ddump_V2.c.

Referenced by PLUGIN_init().

char* yn_strings[] = { "n" , "y" } [static]
 

Definition at line 107 of file plug_3Ddump_V2.c.

 

Powered by Plone

This site conforms to the following standards: