Doxygen Source Code Documentation
edt_zscore.c File Reference
#include "mrilib.h"Go to the source code of this file.
| Functions | |
| void | EDIT_zscore_vol (int nvox, int vtype, float vfac, void *var, int statcode, float *stataux) | 
Function Documentation
| 
 | ||||||||||||||||||||||||||||
| 
 Definition at line 16 of file edt_zscore.c. References ENTRY, FUNC_IS_STAT, FUNC_ZT_SCALE_SHORT, THD_stat_to_zscore(), and var. Referenced by EDIT_one_dataset(). 
 00019 {
00020    register int ii ;
00021 
00022 ENTRY("EDIT_zscore_vol") ;
00023 
00024    /*-- sanity checks --*/
00025 
00026    if( nvox < 1                 ||                  /* no data? */
00027        var == NULL              ||                  /* no data? */
00028        ! FUNC_IS_STAT(statcode) ||                  /* not a statistic? */
00029        statcode == FUNC_ZT_TYPE ||                  /* already a z-score? */
00030        ( vtype != MRI_short && vtype != MRI_float ) /* illegal type of data? */
00031    ) EXRETURN ;
00032 
00033    /*-- what type of data? --*/
00034 
00035    switch( vtype ){
00036 
00037       case MRI_float:{
00038          register float * bar = (float *) var ;
00039          register float   fac = (vfac != 0.0 ) ? vfac : 1.0 ;
00040 
00041          for( ii=0 ; ii < nvox ; ii++ )
00042             bar[ii] = THD_stat_to_zscore( fac*bar[ii] , statcode , stataux ) ;
00043       }
00044       break ;
00045 
00046       case MRI_short:{
00047          register short * bar = (short *) var ;
00048          register float   fac = (vfac != 0.0 ) ? vfac : 1.0 ;
00049 
00050          for( ii=0 ; ii < nvox ; ii++ )
00051             bar[ii] = (short) (  FUNC_ZT_SCALE_SHORT
00052                                * THD_stat_to_zscore(fac*bar[ii],statcode,stataux) ) ;
00053       }
00054       break ;
00055    }
00056 
00057    EXRETURN ;
00058 }
 | 
 
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
                             
 
 
 
 
       
	   
	   
	   
	  