rdotsch / rcicr

Reverse correlation image classification using R
9 stars 12 forks source link

Implement pixel tests and clusters tests from Random Field Theory #38

Open rdotsch opened 8 years ago

rdotsch commented 8 years ago

Implement Chauvin, A., Worsley, K. J., Schyns, P. G., Arguin, M., & Gosselin, F. (2005). Accurate statistical tests for smooth classification images. Journal of Vision, 5(9), 659–667. https://doi.org/10.1167/5.9.1

There's an R package that does Random Field Theory, RandomFields, which we can probably use: [https://cran.r-project.org/web/packages/RandomFields/RandomFields.pdf]

The tests will take as input the z-maps. This has been implemented already.

rdotsch commented 8 years ago

In order to make this work, we will need to implement (or find an alternative to) the attached matlab code.

stat_threshold.m

Relevant information on how this script works: http://www.math.mcgill.ca/keith/fmristat/#thresholding

rdotsch commented 8 years ago

Tutorials on Random Field Theory:

rdotsch commented 8 years ago

The fmri package uses the same approach in smoothing voxel maps in the fmri.smooth() function. [https://cran.r-project.org/web/packages/fmri/fmri.pdf]

rdotsch commented 8 years ago

Wow, I thinkt the Threshold.RF() function of the AnalyzeFMRI package does exactly what we want: https://cran.r-project.org/web/packages/AnalyzeFMRI/AnalyzeFMRI.pdf.

Description Calculates the Random Field theory threshold to give that results in a specified p-value.

Usage Threshold.RF(p.val, sigma, voxdim = c(1, 1, 1), num.vox, type = c("Normal", "t"), df = NULL)

Arguments p.val The required p-value. sigma The 3D covariance matrix of the random field. voxdim The dimesnions of a voxel. num.vox The number of voxels that constitute the random field. type The type of random field, "Normal" or "t". df The degrees of the t distributed field.

Details Calculates the threshold that produces an expected Euler characteristic equal to the required p-value.

Value Returns the Random Field threshold.

Correction: It only gives us the threshold z value. We still need to figure out which function of this package estimates the clusters.

aucuparia commented 8 years ago

Good stuff!

rdotsch commented 8 years ago

It seems we can use much of the AnalyzeFMRI functionality to find the appropriate threshold for the z-maps. Then we need to perform the actual cluster tests with the threshold. These are described in this matlab file.

rdotsch commented 7 years ago

Investigating alternative with permutations based tests referenced in issue #46.