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

Run mris_glm to perform estimation

Follow the following steps to run mris_glm for estimation:

# change to the tutorial data directory and setup SUBJECTS_DIR:
cd $FREESURFER_HOME/subjects/buckner_public_distribution/FsTutorialDataSet/group_analysis_tutorial

# create a 'stats' directory (or some other appropriate name):
mkdir stats

# copy the FSGD file to this new directory and change to that directory
cp my_gender_age_fsgd.txt stats/
cd stats

Assuming the FSGD file is properly created, mris_glm needs to be configured on the command line in order to perform estimation. Examples of the command lines for estimating the left hemisphere and then the right hemisphere are given below and a brief explanation follows:

# For the left hemisphere
mris_glm --surfmeas thickness \
         --hemi lh \
         --trgsubj average \
         --fsgd ./my_gender_age_fsgd.txt doss \
         --beta ./beta_doss-thickness-100lh bfloat \
         --var ./var_doss-thickness-100lh.w paint \
         --y ./y_doss-thickness-100lh_000.bfloat \
         --nsmooth 100

# For the right hemisphere
mris_glm --surfmeas thickness \
         --hemi rh \
         --trgsubj average \
         --fsgd ./my_gender_age_fsgd.txt doss \
         --beta ./beta_doss-thickness-100rh bfloat \
         --var ./var_doss-thickness-100rh.w paint \
         --y ./y_doss-thickness-100rh_000.bfloat \
         --nsmooth 100

In this example, mris_glm will read the thickness maps for each of the subjects, smooth them with 100 iterations of nearest-neighbor smoothing, resample the maps to the common surface space defined by the average7 subject, convert the FSGD file my_gender_age_fsgd.txt into a design matrix by using doss, and save the regression coefficients (--beta, bfloat format), noise variance (--var, paint format) and the preprocessed data (i.e., the input data after resampling and smoothing) (--y, bfloat format). Note that the preprocessed data can be used as input to other group analysis packages.

Upon completion, check to see that mris_glm wrote the following files in the directory from which it was run by typing:

ls -l beta_doss-thickness-100lh_000.bfloat
ls -l var_doss-thickness-100lh.w
ls -l y_doss-thickness-100lh_000.bfloat

ls -l beta_doss-thickness-100rh_000.bfloat
ls -l var_doss-thickness-100rh.w
ls -l y_doss-thickness-100rh_000.bfloat

in the "stats" directory. The files called beta_doss-thickness-100?h_000.bfloat contain the regression weights; files called var_doss-thickness-100?h.w contain the noise variance; and files y_doss-thickness-100?h_000.bfloat contain the input data after resampling and smoothing, for both hemispheres.