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  

editvol.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002    Major portions of this software are copyrighted by the Medical College
00003    of Wisconsin, 1994-2000, and are released under the Gnu General Public
00004    License, Version 2.  See the file README.Copyright for details.
00005 ******************************************************************************/
00006 
00007 #ifndef _MCW_EDITVOL_
00008 #define _MCW_EDITVOL_
00009 
00010 #undef CLUST_DEBUG
00011 
00012 #ifdef SPARKY
00013 #undef _POSIX_SOURCE
00014 #endif
00015 
00016 #include <sys/types.h>      /* to fix a bug in gcc */
00017 #include <stddef.h>
00018 #include <X11/Intrinsic.h>  /* only for XtFree, etc */
00019 #include <stdarg.h>         /* for variable number of arguments processing */
00020 
00021 #include "mrilib.h"
00022 #include "afni_warp.h"
00023 
00024 #ifndef myXtFree
00025 #define myXtFree(xp) (XtFree((char *)(xp)) , (xp)=NULL)
00026 #endif
00027 
00028 #ifndef myXtNew
00029 #define myXtNew(type) ((type *) XtCalloc(1,(unsigned) sizeof(type)))
00030 #endif
00031 
00032 #define INC_CLUSTER 8
00033 
00034 /*! In a cluster struct, the (i,j,k) indexes for each voxel
00035     are stored in a single integer ijk (to save space).
00036     The macros below translate between (i,j,k) [THREE] and ijk. */
00037 
00038 #define IJK_TO_THREE(ijk,i,j,k,nx,nxy) \
00039   ( (k) = (ijk)/(nxy) , (j)=((ijk)%(nxy))/(nx) , (i)=(ijk)%(nx) )
00040 
00041 /*! \see IJK_TO_THREE() */
00042 
00043 #define THREE_TO_IJK(i,j,k,nx,nxy) ((i)+(j)*(nx)+(k)*(nxy))
00044 
00045 /*! Struct to store a cluster.
00046 
00047     The cluster structure was modified to store the individual coordinate
00048     indices for each voxel.  This avoids ambiguity in voxel identification.
00049      \date BDW, 06 March 1997.
00050 */
00051 
00052 typedef struct {
00053    int num_pt  ;    /*!< Number of points in cluster */
00054    int num_all ;    /*!< Number of points allocated for cluster */
00055    short * i;       /*!< x index */
00056    short * j;       /*!< y index */
00057    short * k;       /*!< z index */
00058    float * mag ;    /* stores value at each voxel in cluster */
00059 } MCW_cluster ;
00060 
00061 /*! Initialize a MCW_cluster. */
00062 
00063 #define INIT_CLUSTER(cc)               \
00064   ( (cc) = XtNew(MCW_cluster) ,        \
00065     (cc)->num_pt = (cc)->num_all = 0 , \
00066     (cc)->i = NULL , (cc)->j = NULL , (cc)->k = NULL ,(cc)->mag = NULL )
00067 
00068 /*! Delete an MCW_cluster. */
00069 
00070 #define KILL_CLUSTER(cc)       \
00071   do{ if( cc != NULL ){        \
00072          myXtFree((cc)->i) ;   \
00073          myXtFree((cc)->j) ;   \
00074          myXtFree((cc)->k) ;   \
00075          myXtFree((cc)->mag) ; \
00076          myXtFree((cc)) ;      \
00077          (cc) = NULL ;         \
00078       } break ; } while(0)
00079 
00080 #ifdef CLUST_DEBUG
00081 #  define DBMALL(n) printf(" -- Realloc-ing cluster: %d\n",(n))
00082 #else
00083 #  define DBMALL(n)
00084 #endif
00085 
00086 /*! Add point (ii,jj,kk) with magnitude mm to a MCW_cluster. */
00087 
00088 #define ADDTO_CLUSTER(cc,ii,jj,kk,m) \
00089   do{ int nn ;                                              \
00090       if( (cc)->num_pt == (cc)->num_all ){                  \
00091          (cc)->num_all = 1.25*(cc)->num_all + INC_CLUSTER ; \
00092          nn = (cc)->num_all ;                               \
00093          (cc)->i=(short *)   XtRealloc((char *)(cc)->i,sizeof(short)*nn  );\
00094          (cc)->j=(short *)   XtRealloc((char *)(cc)->j,sizeof(short)*nn  );\
00095          (cc)->k=(short *)   XtRealloc((char *)(cc)->k,sizeof(short)*nn  );\
00096          (cc)->mag=(float *) XtRealloc((char *)(cc)->mag,sizeof(float)*nn);\
00097          DBMALL(nn) ; }                      \
00098       nn = (cc)->num_pt ; ((cc)->num_pt)++ ; \
00099       (cc)->i[nn] = (ii) ; (cc)->j[nn] = (jj) ; (cc)->k[nn] = (kk) ; \
00100       (cc)->mag[nn] = (m) ; break ; } while(0)
00101 
00102 #define ISOVALUE_MODE  1
00103 #define ISOMERGE_MODE  2
00104 
00105 /*----------------------------------------------------------------------------*/
00106 
00107 /*! Struct to store a bunch of MCW_cluster stuff. */
00108 
00109 typedef struct {
00110    int num_clu , num_all ;
00111    MCW_cluster ** clar ;
00112 } MCW_cluster_array ;
00113 
00114 /*! Initialize a MCW_cluster_array. */
00115 
00116 #define INIT_CLARR(cl)                \
00117   ( (cl) = XtNew(MCW_cluster_array) , \
00118     (cl)->num_clu = (cl)->num_all = 0 , (cl)->clar = NULL )
00119 
00120 /*! Add a MCW_cluster to a MCW_cluster_array. */
00121 
00122 #define ADDTO_CLARR(cl,cc)                  \
00123   do{ int nn ;                              \
00124       if( (cl)->num_clu == (cl)->num_all ){ \
00125          (cl)->num_all += INC_CLUSTER ; nn = (cl)->num_all ;           \
00126          (cl)->clar = (MCW_cluster **) XtRealloc( (char *)(cl)->clar , \
00127                                                  sizeof(MCW_cluster *) * nn ) ;\
00128       } \
00129       (cl)->clar[((cl)->num_clu)++] = (cc) ; break ; } while(0)
00130 
00131 /*! Delete a MCW_cluster_array (including all MCW_cluster inside). */
00132 
00133 #define DESTROY_CLARR(cl) \
00134   do{ int ii ; if( cl != NULL ){                    \
00135          for( ii=0 ; ii < (cl)->num_clu ; ii++ )    \
00136             KILL_CLUSTER( (cl)->clar[ii] ) ;        \
00137          myXtFree((cl)->clar) ; (cl) = NULL ; \
00138       } break ; } while(0)
00139 
00140 /*! Determine if 2 MCW_cluster are ordered. */
00141 
00142 #define CLUST_ORDERED(c1,c2) ( (c1)->num_pt >= (c2)->num_pt )
00143 
00144 /*! Swap 2 MCW_cluster. */
00145 
00146 #define CLUST_SWAP(c1,c2) (ct=(c1),(c1)=(c2),(c2)=ct,sss=1)
00147 
00148 /*! Bubble sort a MCW_cluster_array. */
00149 
00150 #define SORT_CLARR(name) \
00151    if( (name) != NULL && (name)->num_clu > 1 ){                             \
00152       int iic , jjc , sss ; MCW_cluster * ct ;                              \
00153       for( iic=0 ; iic < (name)->num_clu ; iic++ ){                         \
00154          sss = 0 ;                                                          \
00155          for( jjc=1 ; jjc < (name)->num_clu ; jjc++ ){                      \
00156             if( !CLUST_ORDERED( (name)->clar[jjc-1] , (name)->clar[jjc] ) ) \
00157                CLUST_SWAP( (name)->clar[jjc-1] , (name)->clar[jjc] ) ;      \
00158    } if( !sss ) break ; }}
00159 
00160 /*----------------------------------------------------------------------------*/
00161 
00162 extern MCW_cluster_array * MCW_find_clusters( int,int,int , float,float,float ,
00163                                               int , void * , float ) ;
00164 
00165  /* 30 Apr 2002 */
00166 extern MCW_cluster_array * NIH_find_clusters( int,int,int , float,float,float ,
00167                                               int , void * , float , int ) ;
00168 
00169 extern void MCW_cluster_to_vol( int,int,int, int,void *, MCW_cluster * ) ;
00170 
00171 extern void MCW_scale_to_max( int,int,int, int,void * );
00172 
00173 extern float MCW_vol_amax( int,int,int , int,void *) ;
00174 
00175 /* 11 Sept 1996 */
00176 extern MCW_cluster * MCW_build_mask (int, int, int,
00177                                      float, float, float, float);
00178 
00179 /* 16 June 1998 */
00180 extern void MCW_erode_clusters (int, int, int, float, float, float, int,
00181                                   void *, float, float, int);
00182 
00183 extern void MCW_sort_cluster( MCW_cluster * ) ; /* 10 Jul 2001 */
00184 
00185 /*----------------------------------------------------------------------------*/
00186 #undef ALLOW_SCALE_TO_MAX
00187 char * EDIT_options_help(void) ;  /* was a string, now a prototype */
00188 /*----------------------------------------------------------------------------*/
00189 
00190 /*! Data structure filled in EDIT_check_argv,
00191     and used to control EDIT_one_dataset (options applied in order given).
00192     \see INIT_EDOPT()
00193 */
00194 
00195 typedef struct EDIT_options {
00196    int thtoin ;                   /*!< copy thresh data over intensity data */
00197    int noneg ;                    /*!< throw away negative intensities      */
00198    int abss ;                     /*!< take absolute values of intensities  */
00199 
00200    float clip_bot ;               /*!< zero out voxels with value in clip_bot..clip_top */
00201    float clip_top ;               /*!< zero out voxels with value in clip_bot..clip_top */
00202    int   clip_unscaled ;          /*!< clip without scaling? [09 Aug 1996]  */
00203 
00204    float thresh ;                 /*!< zero out if threshold < thresh     */
00205    float clust_rmm ;              /*!< cluster data with rmm radius       */
00206    float clust_vmul ;             /*!< remove clusters smaller than vmul  */
00207    float blur ;                   /*!< Gaussian blur data with sigma = blur */
00208    float thrblur ;                /*!< Gaussian blur threshold data,
00209                                       with sigma = thrblur (4 Oct 1996)    */
00210 
00211    float erode_pv;                /*!< erosion percentage   (16 June 1998)  */
00212    int dilate;                    /*!< dilation option      (16 June 1998)  */
00213 
00214 
00215    int edit_clust;                /*!< edit cluster option  (10 Sept 1996)  */
00216 
00217    float filter_rmm;              /*!< filter radius        (11 Sept 1996)  */
00218    int   filter_opt;              /*!< filter option        (11 Sept 1996)  */
00219 
00220    float thrfilter_rmm;           /*!< threshold filter radius (1 Oct 1996) */
00221    int   thrfilter_opt;           /*!< threshold filter option (1 Oct 1996) */
00222 
00223    int   scale ;                  /*!< linearly scale data so max = 10000   */
00224 
00225    float mult ;                   /*!< multiply all voxels by this          */
00226 
00227    int   do_zvol ;                /*!< zero out a 3D sub-volume             */
00228    float zv_x1 ;                  /*!< dimensions of sub-volume to massacre */
00229    float zv_x2 ;                  /*!< dimensions of sub-volume to massacre */
00230    float zv_y1 ;                  /*!< dimensions of sub-volume to massacre */
00231    float zv_y2 ;                  /*!< dimensions of sub-volume to massacre */
00232    float zv_z1 ;                  /*!< dimensions of sub-volume to massacre */
00233    float zv_z2 ;                  /*!< dimensions of sub-volume to massacre */
00234 
00235    int   iv_fim ;                 /*!< use this sub-brick for voxel values */
00236    int   iv_thr ;                 /*!< use this sub-brick for threshold    */
00237 
00238    int   zscore ;                 /*!< 17 Sep 1998 --> convert statistic to Z   */
00239 
00240    int   verbose ;                /*!< 01 Nov 1999 --> verbose output during editing */
00241 
00242    int   nfmask ;                 /*!< 09 Aug 2000 --> filter mask */
00243    byte * fmask ;
00244    char * fexpr ;                 /*!< 09 Aug 2000 --> filter expression */
00245 
00246    int fake_dxyz ;                /*!< 11 Sep 2000 -> use dx=dy=dz=1.0? */
00247 
00248 } EDIT_options ;
00249 
00250 /*--- cluster editing options ---*/   /* 10 Sept 1996 */
00251 #define ECFLAG_NONE   0
00252 #define ECFLAG_SAME   1
00253 #define ECFLAG_MEAN   2
00254 #define ECFLAG_MAX    3
00255 #define ECFLAG_AMAX   4
00256 #define ECFLAG_SMAX   5
00257 #define ECFLAG_SIZE   6
00258 #define ECFLAG_ORDER  7         /* 09 June 1998 */
00259 
00260 /*--- filtering options ---*/   /* 11 Sept 1996 */
00261 #define FCFLAG_NONE   0
00262 #define FCFLAG_MEAN   1
00263 #define FCFLAG_NZMEAN 2
00264 #define FCFLAG_MAX    3
00265 #define FCFLAG_AMAX   4
00266 #define FCFLAG_SMAX   5
00267 
00268 #define FCFLAG_AVER   66        /*  7 Jan 1998 */
00269 #define FCFLAG_EXPR   77        /* 09 Aug 2000 */
00270 
00271 #define FCFLAG_ONE_STEP 100000
00272 #define FCFLAG_WINSOR   (2*FCFLAG_ONE_STEP)  /* 11 Sep 2000 */
00273 
00274 /*! Initialize an EDIT_options struct. */
00275 
00276 #define INIT_EDOPT(edopt)              \
00277       ( (edopt)->thtoin        = 0   , \
00278         (edopt)->noneg         = 0   , \
00279         (edopt)->abss          = 0   , \
00280         (edopt)->clip_bot      = 0.0 , \
00281         (edopt)->clip_top      = 0.0 , \
00282         (edopt)->thresh        = 0.0 , \
00283         (edopt)->clust_rmm     = -1.0, \
00284         (edopt)->clust_vmul    = 0.0 , \
00285         (edopt)->edit_clust    = 0   , \
00286         (edopt)->erode_pv      = 0.0 , \
00287         (edopt)->dilate        = 0   , \
00288         (edopt)->filter_rmm    = 0.0 , \
00289         (edopt)->filter_opt    = 0   , \
00290         (edopt)->thrfilter_rmm = 0.0 , \
00291         (edopt)->thrfilter_opt = 0   , \
00292         (edopt)->blur          = 0.0 , \
00293         (edopt)->thrblur       = 0.0 , \
00294         (edopt)->scale         = 0   , \
00295         (edopt)->mult          = 0.0 , \
00296         (edopt)->do_zvol       = 0   , \
00297         (edopt)->clip_unscaled = 0   , \
00298         (edopt)->iv_fim        = -1  , \
00299         (edopt)->iv_thr        = -1  , \
00300         (edopt)->zscore        = 0   , \
00301         (edopt)->verbose       = 0   , \
00302         (edopt)->nfmask        = 0   , \
00303         (edopt)->fmask         = NULL, \
00304         (edopt)->fexpr         = NULL, \
00305         (edopt)->fake_dxyz     = 0   , \
00306        0 )
00307 
00308 extern void EDIT_one_dataset( THD_3dim_dataset * dset , EDIT_options * edopt ) ;
00309 
00310 extern void EDIT_blur_volume( int,int,int , float,float,float , int,void * , float ) ;
00311 extern void EDIT_blur_volume_3d( int,int,int , float,float,float , int,void * , float, float, float ) ;
00312 
00313 /*! Convert Gaussian blur RMS width to sigma [1/sqrt(3)] */
00314 #define RMS_TO_SIGMA(rms) (0.57735027*(rms))
00315 
00316 /*! Convert Gaussian blur FWHM width to sigma [1/sqrt(log(2)*8)] */
00317 #define FWHM_TO_SIGMA(fh) (0.42466090*(fh))
00318 
00319 extern int EDIT_check_argv( int , char * argv[] , int , EDIT_options * ) ;
00320 
00321 extern void EDIT_coerce_type      ( int , int,void * , int,void * ) ;
00322 extern void EDIT_coerce_scale_type( int , float , int,void * , int,void * ) ;
00323 extern float EDIT_coerce_autoscale( int , int,void * , int,void * ) ;
00324 
00325 extern void EDIT_aver_fvol( int, int, int,
00326                             float, float, float, float *, float) ;
00327 
00328 extern void EDIT_zscore_vol( int,int,float,void *,int,float * ) ;
00329 
00330 extern void EDIT_clip_float( float , int , float * ) ;
00331 
00332 extern byte * EDT_calcmask( char * , int * ) ;  /* 16 Mar 2000 */
00333 
00334 extern void * EDIT_volpad( int,int,int,int,int,int ,
00335                            int,int,int , int,void * ) ; /* 09 Feb 2001 */
00336 
00337 #define EDIT_zeropad EDIT_volpad                        /* 14 Feb 2001 */
00338 
00339 #define EDIT_volpad_even(px,py,pz,nx,ny,nz,ft,vv) \
00340    EDIT_volpad( (px),(px), (py),(py), (pz),(pz), (nx),(ny),(nz), (ft),(vv) )
00341 
00342 /********************* New routines for AFNI-96 ****************************/
00343 
00344 /**----------------------- prototypes -----------------------**/
00345 
00346 extern THD_3dim_dataset * EDIT_empty_copy( THD_3dim_dataset * ) ;
00347 extern THD_3dim_dataset * EDIT_full_copy ( THD_3dim_dataset * , char * ) ;
00348 extern int                EDIT_dset_items( THD_3dim_dataset * , ... ) ;
00349 extern THD_3dim_dataset * EDIT_wod_copy( THD_3dim_dataset * ) ; /* 31 Jul 2002 */
00350 extern THD_datablock *    EDIT_empty_datablock(void) ;          /* 11 Mar 2005 */
00351 
00352 extern void EDIT_add_bricklist( THD_3dim_dataset *,int,int *,float *,void *sbr[] ) ;
00353 
00354 extern void EDIT_add_brick( THD_3dim_dataset * , int , float , void * ) ;
00355 
00356 extern void EDIT_substitute_brick( THD_3dim_dataset * ,  int,int , void * ) ;
00357 
00358 /* 10 Sept 1996 */
00359 extern void EDIT_cluster_array (MCW_cluster_array * , int, float, float);
00360 
00361 /* 11 Sept 1996 */
00362 extern void EDIT_filter_volume (int, int, int, float, float, float,
00363                                 int, void *, int, float , byte * , char * );
00364 
00365 /**---------------- AFNI Dataset item Names ----------------**/
00366 
00367 #define ADN_none                 0
00368 
00369 /** values in the diskptr **/
00370 
00371 #define ADN_prefix               6001     /*=  char *  =*/
00372 #define ADN_directory_name       6002     /*=  char *  =*/
00373 
00374 /** values in the datablock **/
00375 
00376 #define ADN_brick_fac            6011     /*=  float *  =*/
00377 #define ADN_malloc_type          6012     /*=  int      =*/
00378 #define ADN_datum_all            6013     /*=  int      =*/
00379 #define ADN_datum_array          6014     /*=  int *    =*/
00380 #define ADN_nvals                6016     /*=  int      =*/
00381 
00382 /** values in the dataxes **/
00383 
00384 #define ADN_nxyz                 6020     /*=  THD_ivec3  =*/
00385 #define ADN_xyzdel               6021     /*=  THD_fvec3  =*/
00386 #define ADN_xyzorg               6022     /*=  THD_fvec3  =*/
00387 #define ADN_xyzorient            6023     /*=  THD_ivec3  =*/
00388 #define ADN_to_dicomm            6024     /*=  THD_mat33  =*/
00389 
00390 /** values in the timeaxis **/
00391 
00392 #define ADN_ntt                  6031     /*=  int    =*/
00393 #define ADN_ttorg                6032     /*=  float  =*/
00394 #define ADN_ttdel                6033     /*=  float  =*/
00395 #define ADN_ttdur                6034     /*=  float  =*/
00396 
00397 #define ADN_nsl                  6035     /*=  int      =*/
00398 #define ADN_zorg_sl              6036     /*   float    =*/
00399 #define ADN_dz_sl                6037     /*   float    =*/
00400 #define ADN_toff_sl              6039     /*=  float *  =*/
00401 #define ADN_tunits               6040     /*=  int      =*/  /* 21 Oct 1996 */
00402 
00403 /** values in the 3dim_dataset itself **/
00404 
00405 #define ADN_type                 6051     /*=  int     =*/
00406 #define ADN_view_type            6052     /*=  int     =*/
00407 #define ADN_func_type            6053     /*=  int     =*/
00408 #define ADN_label1               6054     /*=  char *  =*/
00409 #define ADN_label2               6055     /*=  char *  =*/
00410 #define ADN_self_name            6056     /*=  char *  =*/
00411 #define ADN_keywords_replace     6057     /*=  char *  =*/
00412 #define ADN_keywords_append      6058     /*=  char *  =*/
00413 
00414 #define ADN_warp_parent          6061     /*=  THD_3dim_dataset *  =*/
00415 #define ADN_anat_parent          6062     /*=  THD_3dim_dataset *  =*/
00416 #define ADN_stat_aux             6063     /*=  float *             =*/
00417 #define ADN_warp                 6064     /*=  THD_warp *          =*/
00418 #define ADN_anatpar_idcode       6065     /*=  MCW_idcode * [13 Dec 1999] =*/
00419 
00420 /* 30 Nov 1997 */
00421 #define ADN_ONE_STEP            100000
00422 #define ADN_brick_label_one             (2*ADN_ONE_STEP)  /*=  char *   =*/
00423 #define ADN_brick_fac_one               (3*ADN_ONE_STEP)  /*=  float    =*/
00424 #define ADN_brick_stataux_one           (4*ADN_ONE_STEP)  /*=  float *  =*/
00425 #define ADN_brick_keywords_replace_one  (5*ADN_ONE_STEP)  /*=  char *   =*/
00426 #define ADN_brick_keywords_append_one   (6*ADN_ONE_STEP)  /*=  char *   =*/
00427 
00428 /*-----------------------------------------------------------------
00429    These 2 macros added 14 Dec 1999
00430 -------------------------------------------------------------------*/
00431 
00432 /*! Copy anat parent from old datasets ods to new dataset nds. */
00433 
00434 #define EDIT_COPY_ANATOMY_PARENT_ID(nds,ods)                   \
00435   do{ if( ISVALID_DSET(nds) && ISVALID_DSET(ods) )              \
00436          (nds)->anat_parent_idcode = (ods)->anat_parent_idcode ; \
00437     } while(0)
00438 
00439 /*! Null out the anat parent of dataset nds. */
00440 
00441 #define EDIT_ZERO_ANATOMY_PARENT_ID(nds)                 \
00442   do{ if( ISVALID_DSET(nds) )                             \
00443          ZERO_IDCODE((nds)->anat_parent_idcode); } while(0)
00444 
00445 /*------------------------------------------------------------------*/
00446 
00447 /*! Change statistical parameters in dataset ds, sub-brick iv,
00448     to statistical type ft, with paramters a,b,c,d.
00449 */
00450 
00451 #define EDIT_STATAUX4(ds,iv,ft,a,b,c,d)                     \
00452  do{ float sqq[6] ;                                           \
00453      if( ISVALID_DSET(ds) &&                                    \
00454          (iv) >= 0 && (iv) < DSET_NVALS(ds) &&                    \
00455          (ft) >= 0 && (ft) <= LAST_FUNC_TYPE   ){                   \
00456         sqq[0] = (ft) ; sqq[1] = FUNC_need_stat_aux[ft] ;             \
00457         sqq[2] = (a) ; sqq[3] = (b) ; sqq[4] = (c) ; sqq[5] = (d) ;     \
00458         EDIT_dset_items( (ds),ADN_brick_stataux_one+(iv),sqq,ADN_none ) ; \
00459      } } while(0)
00460 
00461 /*! Convert sub-brick iv of dataset ds to a no-statistic [16 Jun 2003] */
00462 
00463 #define EDIT_BRICK_TO_NOSTAT(ds,iv) \
00464   EDIT_STATAUX4(ds,iv,FUNC_FIM_TYPE,0,0,0,0)
00465 
00466 /*! Convert sub-brick iv of dataset ds to a fico (correlation) statistic. */
00467 
00468 #define EDIT_BRICK_TO_FICO(ds,iv,nsam,nfit,nort) \
00469   EDIT_STATAUX4(ds,iv,FUNC_COR_TYPE,nsam,nfit,nort,0)
00470 
00471 /*! Convert sub-brick iv of dataset ds to a fitt (t test) statistic. */
00472 
00473 #define EDIT_BRICK_TO_FITT(ds,iv,ndof) \
00474   EDIT_STATAUX4(ds,iv,FUNC_TT_TYPE,ndof,0,0,0)
00475 
00476 /*! Convert sub-brick iv of dataset ds to a fift (F test) statistic. */
00477 
00478 #define EDIT_BRICK_TO_FIFT(ds,iv,ndof,ddof) \
00479   EDIT_STATAUX4(ds,iv,FUNC_FT_TYPE,ndof,ddof,0,0)
00480 
00481 /*! Convert sub-brick iv of dataset ds to a fizt (z score) statistic. */
00482 
00483 #define EDIT_BRICK_TO_FIZT(ds,iv) \
00484   EDIT_STATAUX4(ds,iv,FUNC_ZT_TYPE,0,0,0,0)
00485 
00486 /*! Convert sub-brick iv of dataset ds to a fict (chi square) statistic. */
00487 
00488 #define EDIT_BRICK_TO_FICT(ds,iv,ndof) \
00489   EDIT_STATAUX4(ds,iv,FUNC_CT_TYPE,ndof,0,0,0)
00490 
00491 /*! Convert sub-brick iv of dataset ds to a fibt (beta variable) statistic. */
00492 
00493 #define EDIT_BRICK_TO_FIBT(ds,iv,a,b) \
00494     EDIT_STATAUX4(ds,iv,FUNC_BT_TYPE,a,b,0,0)
00495 
00496 /*! Convert sub-brick iv of dataset ds to a fibn (binomial variable) statistic. */
00497 
00498 #define EDIT_BRICK_TO_FIBN(ds,iv,ntrial,prob) \
00499     EDIT_STATAUX4(ds,iv,FUNC_BN_TYPE,ntrial,prob,0,0)
00500 
00501 /*! Convert sub-brick iv of dataset ds to a figt (gamma variable) statistic. */
00502 
00503 #define EDIT_BRICK_TO_FIGT(ds,iv,shape,scale) \
00504     EDIT_STATAUX4(ds,iv,FUNC_GT_TYPE,shape,scale,0,0)
00505 
00506 /*! Convert sub-brick iv of dataset ds to a fipt (Poisson variable) statistic. */
00507 
00508 #define EDIT_BRICK_TO_FIPT(ds,iv,mean) \
00509     EDIT_STATAUX4(ds,iv,FUNC_PT_TYPE,mean,0,0,0)
00510 
00511 /*------------------------------------------------------------------*/
00512 
00513 /*! Change the iv-th sub-brick label in dataset ds to str. */
00514 
00515 #define EDIT_BRICK_LABEL(ds,iv,str) \
00516      EDIT_dset_items( (ds), ADN_brick_label_one+(iv), (str), ADN_none )
00517 
00518 /*! Change the iv-th sub-brick scale factor in dataset ds to fac
00519     (factor=0 means "don't scale"). */
00520 
00521 #define EDIT_BRICK_FACTOR(ds,iv,fac) \
00522      EDIT_dset_items( (ds), ADN_brick_fac_one+(iv), (fac), ADN_none )
00523 
00524 /*! Add a keyword to sub-brick #iv of dataset ds. */
00525 
00526 #define EDIT_BRICK_ADDKEY(ds,iv,str) \
00527      EDIT_dset_items( (ds), ADN_brick_keywords_append_one+(iv), (str), ADN_none )
00528 
00529 /*------------------------------------------------------------------*/
00530 
00531 #endif /* _MCW_EDITVOL_ */
 

Powered by Plone

This site conforms to the following standards: