Doxygen Source Code Documentation
thd_statpval.c File Reference
#include "mrilib.h"
#include "thd.h"
Go to the source code of this file.
Functions | |
float | THD_stat_to_pval (float thr, int statcode, float *stataux) |
float | THD_pval_to_stat (float pval, int statcode, float *stataux) |
float | THD_stat_to_zscore (float thr, int statcode, float *stataux) |
Function Documentation
|
Definition at line 68 of file thd_statpval.c. References beta_p2t(), binomial_p2t(), chisq_p2t(), correl_p2t(), fstat_p2t(), gamma_p2t(), normal_p2t(), poisson_p2t(), and student_p2t(). Referenced by AFNI_drive_set_threshnew(), AFNI_thrdrag_lock_carryout(), and main().
00069 { 00070 float stat = -1.0 ; /* error flag */ 00071 00072 if( pval >= 0.999999 ) return 0.0 ; /* WTF */ 00073 00074 if( stataux == NULL && statcode != FUNC_ZT_TYPE ) return pval ; 00075 00076 switch( statcode ){ /* if statcode is illegal, will return -1 */ 00077 00078 /** the routines below are in mri_stats.c **/ 00079 00080 case FUNC_COR_TYPE: 00081 stat = correl_p2t( pval , stataux[0] , stataux[1] , stataux[2] ) ; 00082 break ; 00083 00084 case FUNC_TT_TYPE: 00085 stat = student_p2t( pval , stataux[0] ) ; 00086 break ; 00087 00088 case FUNC_FT_TYPE: 00089 stat = fstat_p2t( pval , stataux[0] , stataux[1] ) ; 00090 break ; 00091 00092 case FUNC_ZT_TYPE: /* only type that doesn't */ 00093 stat = normal_p2t( pval ) ; /* use stataux parameters */ 00094 break ; 00095 00096 case FUNC_CT_TYPE: 00097 stat = chisq_p2t( pval , stataux[0] ) ; 00098 break ; 00099 00100 case FUNC_BT_TYPE: 00101 stat = beta_p2t( pval , stataux[0] , stataux[1] ) ; 00102 break ; 00103 00104 case FUNC_BN_TYPE: 00105 stat = binomial_p2t( pval , stataux[0] , stataux[1] ) ; 00106 break ; 00107 00108 case FUNC_GT_TYPE: 00109 stat = gamma_p2t( pval , stataux[0] , stataux[1] ) ; 00110 break ; 00111 00112 case FUNC_PT_TYPE: 00113 stat = poisson_p2t( pval , stataux[0] ) ; 00114 break ; 00115 } 00116 00117 return stat ; 00118 } |
|
Definition at line 16 of file thd_statpval.c. References beta_t2p(), binomial_t2p(), chisq_t2p(), correl_t2p(), fstat_t2p(), gamma_t2p(), normal_t2p(), poisson_t2p(), student_t2p(), and thr. Referenced by AFNI_set_thr_pval(), AFNI_thrdrag_lock_carryout(), AFNI_thresh_lock_carryout(), main(), process_volume(), RCREND_set_thr_pval(), and REND_set_thr_pval().
00017 { 00018 float pval = -1.0 ; /* error flag */ 00019 00020 if( stataux == NULL && statcode != FUNC_ZT_TYPE ) return pval ; 00021 00022 if( thr == 0.0 ) return 1.0 ; 00023 00024 switch( statcode ){ /* if statcode is illegal, will return -1 */ 00025 00026 case FUNC_COR_TYPE: 00027 pval = correl_t2p( thr , stataux[0] , stataux[1] , stataux[2] ) ; 00028 break ; 00029 00030 case FUNC_TT_TYPE: 00031 pval = student_t2p( thr , stataux[0] ) ; 00032 break ; 00033 00034 case FUNC_FT_TYPE: 00035 pval = fstat_t2p( thr , stataux[0] , stataux[1] ) ; 00036 break ; 00037 00038 case FUNC_ZT_TYPE: /* only type that doesn't */ 00039 pval = normal_t2p( thr ) ; /* use stataux parameters */ 00040 break ; 00041 00042 case FUNC_CT_TYPE: 00043 pval = chisq_t2p( thr , stataux[0] ) ; 00044 break ; 00045 00046 case FUNC_BT_TYPE: 00047 pval = beta_t2p( thr , stataux[0] , stataux[1] ) ; 00048 break ; 00049 00050 case FUNC_BN_TYPE: 00051 pval = binomial_t2p( thr , stataux[0] , stataux[1] ) ; 00052 break ; 00053 00054 case FUNC_GT_TYPE: 00055 pval = gamma_t2p( thr , stataux[0] , stataux[1] ) ; 00056 break ; 00057 00058 case FUNC_PT_TYPE: 00059 pval = poisson_t2p( thr , stataux[0] ) ; 00060 break ; 00061 } 00062 00063 return pval ; 00064 } |
|
the routines below are in mri_stats.c * Definition at line 122 of file thd_statpval.c. References beta_t2z(), binomial_t2z(), chisq_t2z(), correl_t2z(), fstat_t2z(), gamma_t2z(), normal_t2z, poisson_t2z(), student_t2z(), and thr. Referenced by EDIT_zscore_vol(), and main().
00123 { 00124 float zscore = thr ; 00125 00126 if( stataux == NULL && statcode != FUNC_ZT_TYPE ) return zscore ; 00127 00128 switch( statcode ){ /* if statcode is illegal, will return -1 */ 00129 00130 /** the routines below are in mri_stats.c **/ 00131 00132 case FUNC_COR_TYPE: 00133 zscore = correl_t2z( thr , stataux[0] , stataux[1] , stataux[2] ) ; 00134 break ; 00135 00136 case FUNC_TT_TYPE: 00137 zscore = student_t2z( thr , stataux[0] ) ; 00138 break ; 00139 00140 case FUNC_FT_TYPE: 00141 zscore = fstat_t2z( thr , stataux[0] , stataux[1] ) ; 00142 break ; 00143 00144 case FUNC_ZT_TYPE: /* only type that doesn't */ 00145 zscore = normal_t2z( thr ) ; /* use stataux parameters */ 00146 break ; 00147 00148 case FUNC_CT_TYPE: 00149 zscore = chisq_t2z( thr , stataux[0] ) ; 00150 break ; 00151 00152 case FUNC_BT_TYPE: 00153 zscore = beta_t2z( thr , stataux[0] , stataux[1] ) ; 00154 break ; 00155 00156 case FUNC_BN_TYPE: 00157 zscore = binomial_t2z( thr , stataux[0] , stataux[1] ) ; 00158 break ; 00159 00160 case FUNC_GT_TYPE: 00161 zscore = gamma_t2z( thr , stataux[0] , stataux[1] ) ; 00162 break ; 00163 00164 case FUNC_PT_TYPE: 00165 zscore = poisson_t2z( thr , stataux[0] ) ; 00166 break ; 00167 } 00168 00169 return zscore ; 00170 } |