Freesurfer Group-Level Analysis (mri glmfit): Difference between revisions

From CCN Wiki
Jump to navigation Jump to search
No edit summary
Line 26: Line 26:


In the above example, we have 1 contrast (conditionA_vs_conditionB) to be carried out for the my_analysis.lh and my_analysis.rh analyses directories. Of course, if we also had an MNI305 analysis directory, or if we had also contrasted other conditions, then you will have to run mri_glmfit many more times.
In the above example, we have 1 contrast (conditionA_vs_conditionB) to be carried out for the my_analysis.lh and my_analysis.rh analyses directories. Of course, if we also had an MNI305 analysis directory, or if we had also contrasted other conditions, then you will have to run mri_glmfit many more times.
===One-Sample Group Mean===
The 1-sample group mean (OSGM) tests whether the contrast A-B differs significantly from zero. The example that follows demonstrates how you would run the conditionA_vs_conditionB OSGM analysis for the my_analysis.lh and my_analysis.rh analysis directories as in my example scenario:
*my_analyis.lh
**<code>cd ''$SUBJECTS_DIR/RFX/my_analysis.lh/conditionA_vs_conditionB/''</code>
**<code>mri_glmfit --y ces.nii.gz --wls cesvar.nii.gz --osgm --surface fsaverage lh --glmdir glm.wls --nii.gz</code>
*my_analyis.rh
**<code>cd ''$SUBJECTS_DIR/RFX/my_analysis.rh/conditionA_vs_conditionB/''</code>
**<code>mri_glmfit --y ces.nii.gz --wls cesvar.nii.gz --osgm --surface fsaverage rh --glmdir glm.wls --nii.gz</code>


The example that follows demonstrates how you would run the conditionA_vs_conditionB group-level analysis for the my_analysis.lh and my_analysis.rh analysis directories:
==Correct for Multiple Comparisons==

Revision as of 15:51, 7 December 2016

The group-level (Random-Effects) analysis repeats the contrasts performed for individual subjects on a variance-weighted composite of all your subjects. This will identify voxels for which your contrast effects are consistent across all your participants. For the function MRI group analysis you will need to:

  • Concatenate individuals into one file (isxconcat-sess)
  • Do not smooth (already smoothed during first-level analysis)
  • Run mri_glmfit using weighted least squares (WLS)
  • Correct for multiple comparisons
  • Perform the above in each space (lh, rh, and/or mni305)
  • Correct for multiple comparisons
  • Optionally merge into one volume space

Before you start

Ensure that your SUBJECTS_DIR variable is set to the working directory containing all your participants, and that the first-level analyses have been completed for all participants (using selxavg-3)

Concatenate First-Level Analyses(isxconcat-sess)

In your $SUBJECTS_DIR, there should be a subjects file containing the subjectID for each participant for which you had run selxavg-3. Assuming that the analysis directories in each participant's folder is called my_analysis ( mkanalysis-sess), and that the contrasts folder is called conditionA_vs_conditionB ( mkcontrast-sess), run the isxconcat-sess script as follows:

  • Left Hemisphere
    • isxconcat-sess -sf subjects -analysis my_analysis.lh -contrast conditionA_vs_conditionB -o RFX
  • Right Hemisphere
    • isxconcat-sess -sf subjects -analysis my_analysis.rh -contrast conditionA_vs_conditionB -o RFX

When finished, a new directory will exist, $SUBJECTS_DIR/RFX and contain sub-folders for each of your analyses (in this case, a left- and right-hemisphere analysis; MNI305 can also be performed to look at subcortical activation contrasts if these were performed at the single-subject level). Note that your analysis directory does not have to be called RFX (e.g., if multiple people are working in the same subjects folder, you might have an output folder named something like RFX_CHRIS, or whatever suits you).

Run mri_glmfit

PAY ATTENTION: You will need to run mri_glmfit for each contrast peformed for each of the analyses!

In the above example, we have 1 contrast (conditionA_vs_conditionB) to be carried out for the my_analysis.lh and my_analysis.rh analyses directories. Of course, if we also had an MNI305 analysis directory, or if we had also contrasted other conditions, then you will have to run mri_glmfit many more times.

One-Sample Group Mean

The 1-sample group mean (OSGM) tests whether the contrast A-B differs significantly from zero. The example that follows demonstrates how you would run the conditionA_vs_conditionB OSGM analysis for the my_analysis.lh and my_analysis.rh analysis directories as in my example scenario:

  • my_analyis.lh
    • cd $SUBJECTS_DIR/RFX/my_analysis.lh/conditionA_vs_conditionB/
    • mri_glmfit --y ces.nii.gz --wls cesvar.nii.gz --osgm --surface fsaverage lh --glmdir glm.wls --nii.gz
  • my_analyis.rh
    • cd $SUBJECTS_DIR/RFX/my_analysis.rh/conditionA_vs_conditionB/
    • mri_glmfit --y ces.nii.gz --wls cesvar.nii.gz --osgm --surface fsaverage rh --glmdir glm.wls --nii.gz

Correct for Multiple Comparisons