Doxygen Source Code Documentation
        
Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search   
afni_pcor.h
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006    
00007 #ifndef _AFNI_PCOR_HEADER_
00008 #define _AFNI_PCOR_HEADER_
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #include <stdlib.h>
00023 #include <stdio.h>
00024 #include <math.h>
00025 #include "mrilib.h"
00026 
00027 
00028 
00029 
00030 
00031 #ifndef TWO_TWO
00032 #  define TWO_ONE(x,y) x ## y
00033 #  define TWO_TWO(x,y) TWO_ONE(x,y)
00034 #endif
00035 
00036 #ifndef  SQR
00037 #  define SQR(x)  ((x)*(x))
00038 #endif
00039 
00040 #ifndef MAX
00041 #  define MAX(x,y) (((x)>(y)) ? (x) : (y))
00042 #endif
00043 
00044 #ifndef MIN
00045 #  define MIN(x,y) (((x)<(y)) ? (x) : (y))
00046 #endif
00047 
00048 
00049 
00050 
00051 #define EXPAND_UPDATE
00052 
00053 #define REF_EPS  1.0e-7
00054 
00055 
00056 
00057 
00058 
00059    
00060 
00061 
00062 
00063 typedef struct {
00064           int nref ;                
00065           int nupdate ;             
00066           float **chol ,            
00067                 *alp , *ff , *gg ;  
00068           float *rmin , *rmax ,     
00069                 *rsum ;             
00070           float betasq ;            
00071    } PCOR_references ;
00072 
00073  
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 
00082 #define RCH(rr,ii,jj)  (rr->chol[(ii)][(jj)])
00083 
00084 
00085 
00086 
00087 
00088 typedef struct {
00089           int nvox ;      
00090           int nref ;      
00091           int nupdate ;   
00092           float *chrow ;  
00093 
00094 
00095    } PCOR_voxel_corr ;
00096 
00097    
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 #define VCH(vv,vox,jj) (vv->chrow[(jj)+(vox)*(vv->nref+1)])
00106 
00107 
00108 
00109 
00110 
00111 extern PCOR_references * new_PCOR_references(int) ;
00112 extern PCOR_voxel_corr * new_PCOR_voxel_corr(int,int) ;
00113 
00114 extern void free_PCOR_voxel_corr(PCOR_voxel_corr *) ;
00115 extern void free_PCOR_references(PCOR_references *) ;
00116 
00117 extern void PCOR_get_lsqfit(PCOR_references *, PCOR_voxel_corr *, float *fit[]) ;
00118 extern void PCOR_get_coef  (PCOR_references *, PCOR_voxel_corr *, float *) ;
00119 extern void PCOR_get_pcor  (PCOR_references *, PCOR_voxel_corr *, float *) ;
00120 extern void PCOR_get_mcor  (PCOR_references *, PCOR_voxel_corr *, int , float *) ;
00121 extern void PCOR_get_perc  (PCOR_references *, PCOR_voxel_corr *, float *,float *, int );
00122 
00123 extern void PCOR_get_pcor_and_coef(PCOR_references *, PCOR_voxel_corr *,
00124                                    float, float *,float * ) ;
00125 
00126 extern void PCOR_get_variance(PCOR_voxel_corr *, float *) ;
00127 extern void PCOR_get_stdev   (PCOR_voxel_corr *, float *) ;  
00128 
00129 extern void update_PCOR_references(float *,PCOR_references *) ;
00130 
00131 extern void PCOR_update_short( short * , PCOR_references * , PCOR_voxel_corr * ) ;
00132 extern void PCOR_update_float( float * , PCOR_references * , PCOR_voxel_corr * ) ;
00133 extern void PCOR_update_byte ( byte  * , PCOR_references * , PCOR_voxel_corr * ) ;
00134 
00135 
00136 #endif