top | previous (First Level Analysis)

1. Group Level Analysis

In general, the group analysis for fMRI is very similar to that of the structural data. There is a tutorial for this at GroupAnalysis. There are several specific differences for fMRI which are described here. In the structrual Group Analysis, you would:

  1. Run mris_preproc to resample each subject into the common space and then concatenate all of your subjects (one subject for each frame) into one file.
  2. Smoothed the data on the surface, then
  3. Run mri_glmfit and mri_glmfit-sim

For the function MRI group analysis you will need to:

Start the tutorial in the Project directory

export SUBJECTS_DIR=$TUTORIAL_DATA/fsfast-tutorial.subjects
cd $TUTORIAL_DATA/fsfast-functional

2. Concatenating the Data

In the structural stream (see GroupAnalysis), the subject's data were concatenated into one file with mris_preproc . For the functional stream, the program is called isxconcat-sess:

isxconcat-sess -sf sessidlist -analysis workmem.sm05.lh -contrast encode-v-base -o my-group


Run the concatenation for the right hemisphere and mni305 spaces

isxconcat-sess -sf sessidlist -analysis workmem.sm05.rh -contrast encode-v-base -o my-group
isxconcat-sess -sf sessidlist -analysis workmem.sm05.mni305 -contrast encode-v-base -o my-group

When this is complete, a directory called 'my-group' will be created. cd into this directory and see what's there:

cd $TUTORIAL_DATA/fsfast-functional/my-group

Go into the workmem.sm05.lh and see what's there:

cd $TUTORIAL_DATA/fsfast-functional/my-group/workmem.sm05.lh

You will see several files and folders:

Each of the volumes is in the output space (lh, rh, mni305), as can be verified with mri_info. Go into the contrast folder and see what's there:

cd $TUTORIAL_DATA/fsfast-functional/group/workmem.sm05.lh/encode-v-base

These are going to be the inputs for the group GLM analysis.

3. Run the Group GLM for the Left Hemisphere

Details on how to run the GLM are given in the Group Analysis tutorial, including the use of FSGD files to construct complicated group-level design matrices. Here we are going to use a very simple design which tests whether the mean across the groups equals 0 (the One Sample Group Mean, or OSGM). This just requires a design matrix with a single column of all ones (created with the --osgm flag):

mri_glmfit --y ces.nii.gz \
  --wls cesvar.nii.gz \
  --osgm \
  --surface fsaverage lh \
  --glmdir my-glm.wls \

The one difference between this and the call in the structrual stream is the presence of the '--wls cesvar.nii.gz' option. cesvar.nii.gz is the variance of each session at each voxel. This is used to de-weight a session with high variance. This is not a true mixed effects analysis (this has been referred to as 'psuedo mixed effects'; see Thirion, 2007, Neuroimage). This step is not performed in the structural stream because we do not have variance information for each subject.

3.1. Visualize the Results of the Group GLM

tksurferfv fsaverage lh inflated -aparc -overlay my-glm.wls/osgm/sig.nii.gz -fminmax 2 3

3.2. Correct for Multiple Comparisons

The correction is the same as for the structural group analysis. For example, run:

mri_glmfit-sim --glmdir my-glm.wls --cache 3 pos --cwp .05 --3spaces

This will create several outputs, though there are three that are most important:

View the left hemisphere cache.th30.pos.sig.cluster.summary table

cat my-glm.wls/osgm/cache.th30.pos.sig.cluster.summary

View the clusters on the surface

tksurferfv fsaverage lh inflated \
  -overlay my-glm.wls/osgm/cache.th30.pos.sig.cluster.nii.gz \
  -annot ./my-glm.wls/osgm/cache.th30.pos.sig.ocn.annot -fminmax 1.3 3

4. Right Hemisphere

Perform the same operations above for the right hemisphere (ie, go into workmem.sm05.rh):

cd $TUTORIAL_DATA/fsfast-functional/group/workmem.sm05.rh/encode-v-base

mri_glmfit --y ces.nii.gz --wls cesvar.nii.gz --osgm \
  --surface fsaverage rh --glmdir my-glm.wls --nii.gz

mri_glmfit-sim --glmdir my-glm.wls --cache 3 pos --cwp .05 --3spaces

View the right hemisphere cache.th30.pos.sig.cluster.summary table

cat my-glm.wls/osgm/cache.th30.pos.sig.cluster.summary

5. Subcortical (MNI 305 Space)

Perform the same operations above for the MNI 305 space analysis (ie, go into workmem.sm05.mni305). There are a couple of things that are different about this analysis.

cd $TUTORIAL_DATA/fsfast-functional/group/workmem.sm05.mni305/encode-v-base

This directory has the same files as the surface-based results, though their dimensions are different. All the volumes here are true volumes. The mri_glmfit command is the same as for the surface-based analysis but without the (--surface fsaverage lh) part:

cd $TUTORIAL_DATA/fsfast-functional/group/workmem.sm05.mni305/encode-v-base

mri_glmfit --y ces.nii.gz --wls cesvar.nii.gz --osgm  \
  --glmdir my-glm.wls --nii.gz

freeview -v $SUBJECTS_DIR/fsaverage/mri/orig.mgz $SUBJECTS_DIR/fsaverage/mri/aparc+aseg.mgz:colormap=lut:opacity=0.2 my-glm.wls/osgm/sig.nii.gz:colormap=heat:heatscale=2,2,3

To correct the subcortical analysis for multiple comparisons run:

mri_glmfit-sim --glmdir my-glm.wls --grf 3 pos --cwp .05 --3spaces

View the subcortical grf.th3.pos.sig.cluster.summary table

cat my-glm.wls/osgm/grf.th3.pos.sig.cluster.summary

There are five clusters for the subcortical analysis. View the corrected results in the volume:

freeview $SUBJECTS_DIR/fsaverage/mri/orig.mgz \
my-glm.wls/osgm/grf.th3.pos.sig.ocn.anat.nii.gz:colormap=lut:lut=./my-glm.wls/osgm/grf.th3.pos.sig.ocn.lut:opacity=0 \

6. Merging the Results

These three tables give you the clusters across the whole brain for Left Hemisphere Right Hemisphere Subcortical

cd $TUTORIAL_DATA/fsfast-functional/group
cat workmem.sm05.lh/encode-v-base/my-glm.wls/osgm/cache.th30.pos.sig.cluster.summary
cat workmem.sm05.rh/encode-v-base/my-glm.wls/osgm/cache.th30.pos.sig.cluster.summary
cat workmem.sm05.mni305/encode-v-base/my-glm.wls/osgm/grf.th3.pos.sig.cluster.summary

Merge the corrected results into a single volume for visualization

vlrmerge --o encode.merged.nii.gz \
  --lh workmem.sm05.lh/encode-v-base/my-glm.wls/osgm/cache.th30.pos.sig.cluster.nii.gz \
  --rh workmem.sm05.rh/encode-v-base/my-glm.wls/osgm/cache.th30.pos.sig.cluster.nii.gz \
  --vol workmem.sm05.mni305/encode-v-base/my-glm.wls/osgm/grf.th3.pos.sig.cluster.nii.gz \
  --scm workmem.sm05.mni305/subcort.mask.nii.gz

Creates encode.merged.nii.gz by mapping the left and right hemispheres to the volume and merging with the subcotical results. View the merged volume

freeview -v $SUBJECTS_DIR/fsaverage/mri/orig.mgz \
$SUBJECTS_DIR/fsaverage/mri/aparc+aseg.mgz:colormap=lut:opacity=0.2 \
encode.merged.nii.gz:colormap=heat:heatscale=1.3,1.3,5 \
-f $SUBJECTS_DIR/fsaverage/surf/lh.pial:edgecolor=red \
$SUBJECTS_DIR/fsaverage/surf/rh.pial:edgecolor=red \
$SUBJECTS_DIR/fsaverage/surf/lh.white:edgecolor=yellow \

top | previous (First Level Analysis)