Differences between revisions 1 and 11 (spanning 10 versions)
Revision 1 as of 2005-08-10 16:32:02
Size: 2269
Comment:
Revision 11 as of 2006-02-22 10:15:58
Size: 2773
Editor: JenniPacheco
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
== Run mris_glm to compute contrast == == Group Analysis command lines ==
Line 5: Line 5:
Follow these steps to run mris_glm for computing contrasts: In order to compute the contrats you will first need to change to the tutorial data directory and setup SUBJECTS_DIR:
Line 8: Line 8:
# change to the tutorial data directory and setup SUBJECTS_DIR:
cd $FREESURFER_HOME/subjects/buckner_public_distribution/FsTutorialDataSet/group_analysis_tutorial
cd $FREESURFER_HOME/subjects/buckner_data/tutorial_subjs/group_analysis_tutorial
Line 11: Line 10:
}}}

Change into the directory you ran the estimation step in, most likely called 'stats':

{{{
Line 14: Line 18:
Upon successful completion of the estimation step (computed in a prior exercise), mris_glm may be configured on command line with proper options to perform contrast computation: Upon successful completion of the make_average_subject command you should have an average subject in your SUBJECTS_DIR. After successfully completing [wiki:Self:FsTutorial/CreateFsgdFile Exercise A.] and [wiki:Self:FsTutorial/CreateContrastVectors Exercise B.] you should have an FSGD file called my_gender_age.txt and a contrast file called age.mat, both in your SUBJECTS_DIR/stats directory . The following are sample commands, that can be used with the data, to complete a group analysis:
Line 17: Line 22:
mris_glm --hemi lh \
         --trgsubj average \
         --fsgd ./my_gender_age_fsgd.txt doss \
         --beta_in ./beta_doss-thickness-100lh bfloat \
         --var_in ./var_doss-thickness-100lh.w paint \
         --gcv 0 0 1 \
         --ces ./ces_Age_doss-thickness-100lh.w paint \
         --t ./t_Age_doss-thickness-100lh.w paint \
         --sigt ./sigt_Age_doss-thickness-100lh.w paint

mris_preproc --fsgd my_gender_age.txt --target average --hemi lh --meas thickness --out lh.my_gender_age.thickness.mgh
Line 27: Line 25:


Once this completes you should see the file lh.my_gender_age.thickness.mgh. The next step, the smoothing step, will use this as input:
Line 28: Line 30:
# For the right hemisphere
mris_glm --hemi rh \
         --trgsubj average \
         --fsgd ./my_gender_age_fsgd.txt doss \
         --beta_in ./beta_doss-thickness-100rh bfloat \
         --var_in ./var_doss-thickness-100rh.w paint \
         --gcv 0 0 1 \
         --ces ./ces_Age_doss-thickness-100rh.w paint \
         --t ./t_Age_doss-thickness-100rh.w paint \
         --sigt ./sigt_Age_doss-thickness-100rh.w paint
mri_surf2surf --hemi lh --s average --sval lh.my_gender_age.thickness.mgh --fwhm 10 --tval lh.my_gender_age.thickness.10.mgh
Line 39: Line 32:
With the above configuration, mris_glm tests the given subjects for straight correlation between thickness and age. The command will read in the regression coefficients (--beta_in) and noise variance (--var_in) that were generated from the estimation process, and save the contrast effect size (ces), t-ratio of the contrast, and the significance of the t-ratio (i.e., t-test) in the same directory, all in paint format.
Line 41: Line 33:
Upon completion, make sure that the following files are available in the directory from which mris_glm was run by typing: Once this is complete you should see the file lh.my_gender_age.thickness.10.mgh. The next step will test the hypothesis you've set up using your contrast vector:
Line 43: Line 36:
ls -l ces_Age_doss-thickness-100lh.w
ls -l t_Age_doss-thickness-100lh.w
ls -l sigt_Age_doss-thickness-100lh.w
mri_glmfit --y lh.my_gender_age.thickness.10.mgh --fsgd my_gender_age.txt doss --glmdir lh.my_gender_age.glmdir --pca --surf --average lh --C age.mat
}}}
Line 47: Line 39:
ls -l ces_Age_doss-thickness-100rh.w
ls -l t_Age_doss-thickness-100rh.w
ls -l sigt_Age_doss-thickness-100rh.w

You should have two new directories in FREESURFER_HOME/subjects/buckner_data/tutorial_subjs/group_analysis_tutorial/stats - lh.my_gender_age.glmdir and rh.my_gender_age.glmdir. If you do:

{{{
ls lh.my_gender_age.glmdir
Line 51: Line 45:
in that directory.
Line 53: Line 46:
you should see this:

{{{
age/ beta.mgh fsgd.X.mat pca-eres/ rvar.mgh y.fsgd
ar1.mgh eres.mgh mri_glmfit.log rstd.mgh Xg.dat
}}}

and if you do:
{{{
ls lh.my_gender_age.glmdir/age
}}}

you should see this:

{{{
C.dat F.mgh gamma.mgh maxvox.dat sig.mgh
}}}

You can view your results by opening the average subject in tksurfer:
{{{
tksurfer average lh inflated
}}}

and loading in your overlay, '''File -> Load Overlay''' and browse to stats/lh.my_gender_age.glmdir/age/sig.mgh. If you would like to also view the scatter plots associated with this you can do so by '''File -> Load Group Descriptor File''' and browse to stats/lh.my_gender_age.glmdir/y.fsgd.

The commands are the same for the right hemisphere, replacing every '''lh''' with an '''rh'''.

[wiki:FsTutorial top] | [wiki:FsTutorial/GroupAnalysis previous]

Group Analysis command lines

In order to compute the contrats you will first need to change to the tutorial data directory and setup SUBJECTS_DIR:

cd $FREESURFER_HOME/subjects/buckner_data/tutorial_subjs/group_analysis_tutorial
setenv SUBJECTS_DIR ${PWD}

Change into the directory you ran the estimation step in, most likely called 'stats':

cd stats

Upon successful completion of the make_average_subject command you should have an average subject in your SUBJECTS_DIR. After successfully completing [wiki:FsTutorial/CreateFsgdFile Exercise A.] and [wiki:FsTutorial/CreateContrastVectors Exercise B.] you should have an FSGD file called my_gender_age.txt and a contrast file called age.mat, both in your SUBJECTS_DIR/stats directory . The following are sample commands, that can be used with the data, to complete a group analysis:

# For the left hemisphere

mris_preproc --fsgd my_gender_age.txt --target average --hemi lh --meas thickness --out lh.my_gender_age.thickness.mgh

Once this completes you should see the file lh.my_gender_age.thickness.mgh. The next step, the smoothing step, will use this as input:

mri_surf2surf --hemi lh --s average --sval lh.my_gender_age.thickness.mgh --fwhm 10 --tval lh.my_gender_age.thickness.10.mgh

Once this is complete you should see the file lh.my_gender_age.thickness.10.mgh. The next step will test the hypothesis you've set up using your contrast vector:

mri_glmfit --y lh.my_gender_age.thickness.10.mgh --fsgd my_gender_age.txt doss --glmdir lh.my_gender_age.glmdir --pca --surf --average lh --C age.mat

You should have two new directories in FREESURFER_HOME/subjects/buckner_data/tutorial_subjs/group_analysis_tutorial/stats - lh.my_gender_age.glmdir and rh.my_gender_age.glmdir. If you do:

ls lh.my_gender_age.glmdir

you should see this:

age/     beta.mgh  fsgd.X.mat      pca-eres/  rvar.mgh  y.fsgd
ar1.mgh  eres.mgh  mri_glmfit.log  rstd.mgh   Xg.dat

and if you do:

ls lh.my_gender_age.glmdir/age

you should see this:

C.dat  F.mgh  gamma.mgh  maxvox.dat  sig.mgh

You can view your results by opening the average subject in tksurfer:

tksurfer average lh inflated

and loading in your overlay, File -> Load Overlay and browse to stats/lh.my_gender_age.glmdir/age/sig.mgh. If you would like to also view the scatter plots associated with this you can do so by File -> Load Group Descriptor File and browse to stats/lh.my_gender_age.glmdir/y.fsgd.

The commands are the same for the right hemisphere, replacing every lh with an rh.

FsTutorial/ComputeContrast (last edited 2021-09-22 11:38:51 by DevaniCordero)