GLM - FREESURFER (linux - ubuntu) #1 ### Create the FSGD file and the contrast file(s) ### vi cortisol_CSF.fsgd vi cortisol_CSF_intercept.mtx (1 0) vi cortisol_CSF_slope.mtx (0 1) #2 ### Resample each subject's data into a common space and concatenate all the subjects' into a single file ### #### One command for each hemisphere #### mris_preproc --fsgd cortisol_CSF.fsgd \ --target fsaverage \ --hemi lh \ --meas thickness \ --out lh.cortisol_CSF.thickness.00.mgh mris_preproc --fsgd cortisol_CSF.fsgd \ --target fsaverage \ --hemi rh \ --meas thickness \ --out rh.cortisol_CSF.thickness.00.mgh #3 ### Spatial smoothing ### #### One command for each hemisphere #### mri_surf2surf --hemi lh \ --s fsaverage \ --sval lh.cortisol_CSF.thickness.00.mgh \ --fwhm 10 \ --cortex \ --tval lh.cortisol_CSF.thickness.10.mgh mri_surf2surf --hemi rh \ --s fsaverage \ --sval rh.cortisol_CSF.thickness.00.mgh \ --fwhm 10 \ --cortex \ --tval rh.cortisol_CSF.thickness.10.mgh #4 ### GLM Analysis ### #### One command for each hemisphere #### mri_glmfit \ --y lh.cortisol_CSF.thickness.10.mgh \ --fsgd cortisol_CSF.fsgd \ --C cortisol_CSF_intercept.mtx \ --C cortisol_CSF_slope.mtx \ --surf fsaverage lh \ --cortex \ --glmdir lh.cortisol_CSF.glmdir \ --eres-save mri_glmfit \ --y rh.cortisol_CSF.thickness.10.mgh \ --fsgd cortisol_CSF.fsgd \ --C cortisol_CSF_intercept.mtx \ --C cortisol_CSF_slope.mtx \ --surf fsaverage rh \ --cortex \ --glmdir rh.cortisol_CSF.glmdir \ --eres-save ##### View the uncorrected significance map in freeview ##### freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:annot=aparc.annot:annot_outline=1:overlay=lh.cortisol_CSF.glmdir/cortisol_CSF_intercept/sig.mgh:overlay_threshold=2,5 -viewport 3d -layout 1 freeview -f $SUBJECTS_DIR/fsaverage/surf/rh.inflated:annot=aparc.annot:annot_outline=1:overlay=rh.cortisol_CSF.glmdir/cortisol_CSF_intercept/sig.mgh:overlay_threshold=2,5 -viewport 3d -layout 1 freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:annot=aparc.annot:annot_outline=1:overlay=lh.cortisol_CSF.glmdir/cortisol_CSF_slope/sig.mgh:overlay_threshold=2,5 -viewport 3d -layout 1 freeview -f $SUBJECTS_DIR/fsaverage/surf/rh.inflated:annot=aparc.annot:annot_outline=1:overlay=rh.cortisol_CSF.glmdir/cortisol_CSF_slope/sig.mgh:overlay_threshold=2,5 -viewport 3d -layout 1 #5 ### Correction for multiple comparisons - cluster + permutation ### #### One command for each hemisphere #### mri_glmfit-sim \ --glmdir lh.cortisol_CSF.glmdir \ --perm 10000 2.0 pos \ --cwp 0.05\ --2spaces \ --bg 2 mri_glmfit-sim \ --glmdir rh.cortisol_CSF.glmdir \ --perm 10000 2.0 pos \ --cwp 0.05\ --2spaces \ --bg 2 ##### View the cluster summary ##### cd $SUBJECTS_DIR/lh.cortisol_CSF.glmdir/cortisol_CSF_intercept less perm.th20.pos.sig.cluster.summary cd $SUBJECTS_DIR/rh.cortisol_CSF.glmdir/cortisol_CSF_intercept less perm.th20.pos.sig.cluster.summary cd $SUBJECTS_DIR/lh.cortisol_CSF.glmdir/cortisol_CSF_slope less perm.th20.pos.sig.cluster.summary cd $SUBJECTS_DIR/rh.cortisol_CSF.glmdir/cortisol_CSF_slope less perm.th20.pos.sig.cluster.summary ##### View the cluster annotation in freeview ##### freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:overlay=lh.cortisol_CSF.glmdir/cortisol_CSF_intercept/perm.th20.pos.sig.cluster.mgh:overlay_threshold=2,5:annot=lh.cortisol_CSF.glmdir/cortisol_CSF_intercept/perm.th20.pos.sig.ocn.annot -viewport 3d -layout 1 freeview -f $SUBJECTS_DIR/fsaverage/surf/rh.inflated:overlay=rh.cortisol_CSF.glmdir/cortisol_CSF_intercept/perm.th20.pos.sig.cluster.mgh:overlay_threshold=2,5:annot=rh.cortisol_CSF.glmdir/cortisol_CSF_intercept/perm.th20.pos.sig.ocn.annot -viewport 3d -layout 1 freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:overlay= lh.cortisol_CSF.glmdir/cortisol_CSF_slope/perm.th20.pos.sig.cluster.mgh:overlay_threshold=2,5:annot=lh.cortisol_CSF.glmdir/cortisol_CSF_slope/perm.th20.pos.sig.ocn.annot -viewport 3d -layout 1 freeview -f $SUBJECTS_DIR/fsaverage/surf/rh.inflated:overlay=rh.cortisol_CSF.glmdir/cortisol_CSF_slope/perm.th20.pos.sig.cluster.mgh:overlay_threshold=2,5:annot=rh.cortisol_CSF.glmdir/cortisol_CSF_slope/perm.th20.pos.sig.ocn.annot -viewport 3d -layout 1 ##### View the correlation map in freeview ##### cd $SUBJECTS_DIR/lh.cortisol_CSF.glmdir/cortisol_CSF_intercept freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:overlay=pcc.mgh cd $SUBJECTS_DIR/rh.cortisol_CSF.glmdir/cortisol_CSF_intercept freeview -f $SUBJECTS_DIR/fsaverage/surf/rh.inflated:overlay=pcc.mgh cd $SUBJECTS_DIR/lh.cortisol_CSF.glmdir/cortisol_CSF_slope freeview -f $SUBJECTS_DIR/fsaverage/surf/lh.inflated:overlay=pcc.mgh cd $SUBJECTS_DIR/rh.cortisol_CSF.glmdir/cortisol_CSF_slope freeview -f $SUBJECTS_DIR/fsaverage/surf/rh.inflated:overlay=pcc.mgh