e.g.
mkdir FSGD
2. Create a simple text file (.fsgd) containing subject information and with the following headers
e.g.
GroupDescriptorFile 1
Title MyGroups
Class Control
Class Patient
Class Recovered
Input Subject1 Control
Input Subject2 Patient
Input Subject3 Recovered
3. Create simple text files (.mtx) for each contrast and a group contrast.
e.g.
Control-Patient.mtx
1 -1 0
Control-Recovered.mtx
1 0 -1
Patient-Recovered.mtx
0 1 -1
group.effect.mtx
1 -1 0
1 0 -1
4. Assemble the data (resample each subjects data into a common space, concatenate subjects into a single file (y.mgh), spatial smoothing).
For data that has already been cached (smoothed) use the following command:
mris_preproc --fsgd mydata.fsgd \
--cache-in thickness.fwhm10.fsaverage \
--target fsaverage --hemi lh \
--out lh.mydata.thickness.10.mgh
For data that has not previously had the -qcache command run on it:
mris_preproc --fsgd mydata.fsgd \
--target fsaverage -hemi lh \
--meas thickness \
--out lh.mydata.thickness.00.mgh
mri_surf2surf --hemi lh \
--s fsaverage \
--sval lh.mydata.thickness.00.mgh \
--fwhm 10 \
--cortex \
--tval lh.mydata.thickness.10B.mgh
5. GLM analysis: the following command will perform whole-brain cortical thickness analysis.
mri_glmfit \
--y lh.mydata.thickness.10.mgh \
--fsgd mydata.fsgd dods\
--C Control-Patient.mtx \
--C Control-Recovered.mtx \
--C Patient-Recovered.mtx \
--C group.effect.mtx \
--surf fsaverage lh \
--cortex \
--glmdir lh.mydata.glmdir
Notes
- Thickness is the chosen measure in this example, but this can be substituted for any other measures e.g. area or volume.
- You can choose between DODS or DOSS depending on your experiment, see http://freesurfer.net/fswiki/DodsDoss)
- All of the contrasts have been included in this example, as freesurfer uses these contrasts to measure the group effect.
6. View the uncorrected significance map with tksurfer. For this you will need to be in the FSGD directory but not in any of the contrast directories.
e.g.
tksurfer fsaverage lh inflated \
-annot aparc.annot -fthresh 2 \
-overlay lh.mydata.gmldir/Control-Patient/sig.mgh
7. Clusterwise correction for multiple comparisons (Monte Carlo Null-Z Simulation)
e.g.
mri_glmfit-sim \
--glmdir lh.mydata.glmdir \
--sim mc-z 5 4 mc-z.negative \
--sim-sign neg --cwpvalthresh 0.4 \
--overwrite
Notes
- 5 in the above example is the number of iterations. In this case 5 is used as an example to practice with, it is recommended to run this first before going to a higher number of iterations (up to 50,000). The more iterations run the more accurate the results will be.
- 4 in the above example is the vertex-wise threshold which corresponds to the p-value (see below).
- 0.4 in the above example is a request that all clusters that have a cluster-wise p-value threshold of <0.4 are kept. This can be altered, or set to 0.999 to see all of the clusters regardless of p-value.
- By specifying negative/neg, the results will only display negative changes e.g. cortical thinning. This can be set to positive, to view positive results or absolute to view both.
1.3 = p < 0.05
2 = p < 0.01
2.3 = p < 0.005
3 = p < 0.001
3.3 = p < 0.0005
4 = p < 0.0001
8. View the corrected results in the terminal. You will need to be in the directory of the contrast that you wish to view results for.
e.g.
cd Control-Patient
less mc-z.negative.sig.cluster.summary
9. Load corrected results in tksurfer
e.g.
tksurfer fsaverage lh inlfated \
-annot lh.mydata.glmdir/Control-Patients/mc-z.negative.sig.ocn.annot \
-fthresh 2 -curv -gray