Open rdotsch opened 8 years ago
In order to make this work, we will need to implement (or find an alternative to) the attached matlab code.
Relevant information on how this script works: http://www.math.mcgill.ca/keith/fmristat/#thresholding
Tutorials on Random Field Theory:
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]
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.
Good stuff!
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.
Investigating alternative with permutations based tests referenced in issue #46.
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.