Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_stat_test.cpp File Reference

Functions for statistical tests. More...

#include "Bimage.h"
#include "math_util.h"
#include "utilities.h"

Go to the source code of this file.

Functions

Bimage * img_students_t_test (int n, Bimage *p, float *weight)
 Applies the Student's t-test to one set of images. More...
 
Bimage * img_students_t_test_equal (int set1, int set2, Bimage *p1, Bimage *p2, float *weight)
 Applies the Student's t-test to two sets of images, assumes the two distributions have approximately the same variance. More...
 
Bimage * img_students_t_test_unequal (int set1, int set2, Bimage *p1, Bimage *p2, float *weight)
 Applies the Student's t-test to two sets of images, assumes the two distributions have unequal variance. More...
 
Bimage * img_f_test (int set1, int set2, Bimage *p1, Bimage *p2, float *weight)
 Applies the F-test to two sets of images. More...
 

Variables

int verbose
 

Detailed Description

Functions for statistical tests.

Author
Bernard Heymann and David Belnap
Date
Created: 20010505
Modified: 20111029 (BH)

Definition in file img_stat_test.cpp.

Function Documentation

Bimage* img_f_test ( int  set1,
int  set2,
Bimage *  p1,
Bimage *  p2,
float *  weight 
)

Applies the F-test to two sets of images.

Author
David Belnap
Parameters
set1number of files in set 1.
set2number of files in set 2.
*p1average image with variance (FOM), set 1
*p2average image with variance (FOM), set 2
*weightlist of weights.
Returns
Bimage* F-test image and significance image (as FOM).
The F value is computed for each pixel:
        F(i) = var1(i) / var2(i)

Variance (as FOM of an average image) is input.  The significance 
level is computed and stored as FOM of F-test image.  Output is
in floating point.
Reference: Press W.H. et al (1992) Numerical Recipes in C.

Definition at line 264 of file img_stat_test.cpp.

Bimage* img_students_t_test ( int  n,
Bimage *  p,
float *  weight 
)

Applies the Student's t-test to one set of images.

Parameters
nnumber of files in the set.
*paverage and variance of the set.
*weightlist of weights.
Returns
Bimage* significant level image (floating point).
First, average (avg) and variance (var) images are calculated:
        var = [1/(N-1)] sum(x - avgx)^2
Second, the t value is computed and returned as an image:
        t = avg / sqrt[ var/N ]
Finally, the significance is calculated and returned as the FOM of the image:
        sig = betai(dof/2, 0.5, dof/(dof + t*t))
where dof (degrees-of-freedom) is calculated as:
        dof = ws*(1 - 1.0L/N)
and ws is the weight sum.
All images are converted to floating point.
Reference: Press W.H. et al (1992) Numerical Recipes in C. Milligan and Flicker (1987) J. Cell Biol. 105:29-39.

Definition at line 37 of file img_stat_test.cpp.

Bimage* img_students_t_test_equal ( int  set1,
int  set2,
Bimage *  p1,
Bimage *  p2,
float *  weight 
)

Applies the Student's t-test to two sets of images, assumes the two distributions have approximately the same variance.

Author
David Belnap and Bernard Heymann
Parameters
set1number of files in set 1.
set2number of files in set 2.
*p1average image with variance (FOM), set 1
*p2average image with variance (FOM), set 2
*weightlist of weights.
Returns
Bimage* t-test image and significance image (as FOM).
Input average images for sets 1 and 2, with variance as FOM portion
of the images.  The numerator portion of the variance (Vn) is 
computed from the variance.  The "standard error of the difference 
of the means" is computed:
SD = sqrt[ ( (Vn1 + Vn2) / degrees_of_freedom ) * (1/set1 + 1/set2) ]

and used to compute the t value:
            t = ( avg1 - avg2 ) / SD

Finally, the significance level (probability) is computed.

Reference: Press W.H. et al (1992) Numerical Recipes in C. Milligan and Flicker (1987) J. Cell Biol. 105:29-39.

Definition at line 106 of file img_stat_test.cpp.

Bimage* img_students_t_test_unequal ( int  set1,
int  set2,
Bimage *  p1,
Bimage *  p2,
float *  weight 
)

Applies the Student's t-test to two sets of images, assumes the two distributions have unequal variance.

Author
David Belnap
Parameters
set1number of files in set 1.
set2number of files in set 2.
*p1average image with variance (FOM), set 1
*p2average image with variance (FOM), set 2
*weightlist of weights.
Returns
Bimage* t-test image and significance image (as FOM).
Input average images for sets 1 and 2, with variance as FOM portion
of the images.  The t value is computed:
        t = ( avg1 - avg2 ) / sqrt[ var1/ws1 + var2/ws2 ]

(ws = weighted sum, default = N).  The significance level 
(probability) is computed.  Output is in floating point.

Reference: Press W.H. et al (1992) Numerical Recipes in C. Milligan and Flicker (1987) J. Cell Biol. 105:29-39.

Definition at line 189 of file img_stat_test.cpp.

Variable Documentation

int verbose