Differences between revisions 112 and 113
Deletions are marked like this. Additions are marked like this.
Line 95: Line 95:
cp sample.levels gender.levels cp qdec/sample.levels qdec/gender.levels
Line 121: Line 121:
Number of factors: 4 (1 discrete, 3 continuous) Number of factors: 188 (1 discrete, 187 continuous)
Line 123: Line 123:
Number of regressors: 8 Number of regressors: 376

[wiki:FsTutorial top] | [wiki:FsTutorial previous] | [wiki:FsTutorial next]

FreeSurfer Tutorial: Surface Group Analysis with QDEC

  • To follow this exercise exactly be sure you've downloaded the [wiki:FsTutorial/Data tutorial data set] before you begin. If you choose not to download the data set you can follow these instructions on your own data, but you will have to substitute your own specific paths and subject names. If you are using the tutorial data please set the environmental variable TUTORIAL_DATA to the location that you have downloaded the data to:

tcsh
setenv TUTORIAL_DATA $FREESURFER_HOME/subjects/buckner_data/tutorial_subjs
  • Notice the command to open tcsh. If you are already running the tcsh command shell, then the 'tcsh' command is not necessary.

In this tutorial, you will learn how to perform statistical analysis of group surface-based data, including:BR

  • Preprocessing the group dataBR

  • Constructing a qdec.table.dat file of subject demographicsBR

  • Using QDEC to design and execute your analysisBR

  • Interacting with the Qdec display
  • Creating Regions of Interest (ROIs) for further analysis and a final check of your data

Assuming that all surface reconstruction has been completed for all subjects in the study, FreeSurfer's QDEC utility can be used to perform inter-subject/group averaging and inference on the cortical surface. QDEC permits statistical inferences to be made about effects of interest in relation to error variance. Mri_glmfit is used to model the data as a linear combination of effects related to variables of interest, confounds and errors. Qdec also allows for certain permutation testing and other means for correcting for multiple comparisons. For group analysis, this technique fits a general linear model (GLM) at each surface vertex to explain the data from all subjects in the study. In this section, a brief overview of linear modeling is presented and can be skipped if this material is already familiar. Other software packages have similar types of programs (e.g., FSL's GFEAT).

Introduction

BR QDEC BR Qdec is a single-binary application included in the Freesurfer distribution. QDEC is an acronym for Query, Design, Estimate, Contrast. It is intended to aid researchers in performing inter-subject / group averaging and inference on the morphometry data (cortical surface and volume) produced by the Freesurfer processing stream. Qdec is a GUI front-end to a 'statistics engine' (the mri_glmfit binary, included in Freesurfer, currently fills this role) intended to:

  1. select the subjects meeting the criteria under study
  2. generate the necessary input to the stats engine, which, for mri_glmfit, includes:
    1. a Design matrix (called X in the GLM equation) containing the explanatory variables,

    2. a parameter Estimate matrix (called A in the GLM equation), and

    3. the Contrast vector(s)

  3. generate and optionally display the output data and/or images

BR Linear Modeling overview BR Linear modeling describes the observed data as a linear combination of explanatory factors plus noise, and determines how well that description explains the data being analyzed. In order to understand how to perform group analysis in FreeSurfer, you need to understand the general linear model (GLM) and how to construct a GLM in matrix notation. You can click [wiki:FsTutorial/GlmReview here] for a review of this material. The notation we use here is:y=X*beta, where y is the vector observed data (e.g., thicknesses for each subject at a vertex), X is the known design matrix (e.g., gender, age), and beta is the vector of unknown parameter estimates (PEs). The interpretation of the PEs will depend upon how X is constructed. For example, they could be interpreted as a slope indicating the change of thickness with age. The analysis/estimation is then the process of computing beta given the data y and the design matrix X. A Null Hypothesis (H0) is constructed with a contrast matrix C. Inferences are drawn by testing whether the value gamma=Cb is zero.

Preprocess Group Data

BR set SUBJECTS_DIR BR If you are using the tutorial data you will need to set your SUBJECTS_DIR to the directory with the group analysis data in it. If you have installed your tutorial data to your $FREESURFER_HOME the command to set your SUBJECTS_DIR is:

setenv SUBJECTS_DIR $TUTORIAL_DATA/group_analysis_tutorial
cd $SUBJECTS_DIR

* this will set your SUBJECTS_DIR to the location where your tutorial data is located, in the directory where the group analysis subjects are, if you have defined the variable TUTORIAL_DATA as indicated at the top of this tutorial. If you are not using the tutorial data you should set your SUBJECTS_DIR to the directory in which the subjects you will use for this tutorial are located.

BR recon-all BR Prior to using the qdec application, your group subject data must be processed by the standard Freesurfer processing stream, via the recon-all script. [http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial A freesurfer tutorial is available.] This processing stream supplies the surfaces and morphometry data on each subject. The data in the tutorial set has been processed for you.

BR pre-smoothed fsaverage surfaces BR Qdec needs each subject to have pre-computed smoothed data for the target surface for each measure (thickness, sulc, area, curv, etc.). This is not part of the normal recon processing stream, but you can easily create this data with recon-all, using the command:

recon-all -s <subjid> -qcache

For the purposes of this tutorial, the -qcache command has been run for all of the subjects. The -qcache flag will run numerous back-to-back mris_preproc processes on your machine, so be prepared for it to run for about an hour. BR

BR qdec.table.dat BR The primary input to qdec is a text file, named qdec.table.dat, containing the subject IDs, and discrete and continuous factors, in table format. This is essentially a table of demographics for your subject including all of the variables and factors that you wish to consider. Here is an example file:

fsid            gender  age diagnosis   Left-Cerebral-White-Matter
011121_vc8048   Female  70  Demented    202291
021121_62313-2  Female  71  Demented    210188
010607_vc7017   Female  73  Nondemented 170653
021121_vc10557  Male    75  Demented    142029
020718_62545    Male    76  Demented    186087
020322_vc8817   Male    77  Nondemented 149810

For each discrete factor, there must exist a file named <factor>.levels which lists all possible levels. For example, accompanying the example qdec.table.dat file must be a file named 'gender.levels' containing these lines:

Female
Male

and there must be a file named 'diagnosis.levels' containing these lines:

Demented
Nondemented

Of course you may have different discrete factor names and levels (or even no discrete factors, in which case all column data is assumed to be continous factors). Continuous factors do not need a <factor>.levels file to define them.

For organizational purposes it is best to make a directory called qdec within your $SUBJECTS_DIR. You can save the qdec.table.dat and <factor>.levels files in there. When Qdec runs it will also save your analyses to this directory. A qdec subdirectory, with a qdec.table.dat has been made for you. Here is a sample of what that looks like:

fsid    gender  age     Left-Hippocampus        Right-Hippocampus
004     Male    72      4250                    4452
008     Female  88      2569                    3310
017     Male    25      4163                    3938
021     Male    22      4034                    4144
032     Male    79      3459                    3443
039     Female  69      3865                    4013

This file contains 40 subject IDs, their gender, age, left hippocampus volume, and right hippocampus volume. To accompany this file you will need to create a <factor>.levels text file to define the discrete factor names. You can do this using the text editor of your choice (emacs, vi, pico...) If you have trouble there is a sample file that has been created for you, called sample.levels simply copy this to gender.levels and you can continue with the tutorial. The command for this is:

cp qdec/sample.levels qdec/gender.levels 

BR fsaverage BR For display purposes, you will need to have an average subject included in your SUBJECTS_DIR. Freesurfer's fsaverage, made in MNI305 space, will do fine:

cd $SUBJECTS_DIR
if (! -e fsaverage) ln -s $FREESURFER_HOME/subjects/fsaverage

This will add a copy of fsaverage into your SUBJECTS_DIR.BR For the purposes of this tutorial, fsaverage has already been linked to your $SUBJECTS_DIR.

If you wish to make your own average subject from your set you can do so using [wiki:make_5faverage_5fsubject make_average_subject].

Usage

To start qdec, from your $SUBJECTS_DIR, simply type qdec:

qdec &

It may take a few seconds for Qdec to open. The ampersand directs the terminal to run this process in the background, so you may see your command prompt return before Qdec opens.

Subjects

When Qdec opens you are looking at the Subjects tab. The first thing you will need to do is to load your qdec.table.dat file. Click File -> Load Data Table, or you can use the attachment:qdec-load-data-table.png button, and traverse to your subjects directory and select the qdec.table.dat file that you created. When you click Open, it should load your file, the contents scrolling-by in the terminal window. If the data is loaded correctly, you should see in the terminal window a summary, like this example:

Number of subjects:   40
Number of factors:    188 (1 discrete, 187 continuous)
Number of classes:    2
Number of regressors: 376

attachment:qdec-scatterplot.jpg BR

Your continuous (age, Left-Hippocampus, and Right-Hippocampus) factors should appear in a list under Scatter Plot on the control panel. If you choose a factor from this list a scatter plot of your data will appear in the window. The x-axis has the subject number (taken from the order the subjects are listed in the qdec.table.dat), and the y-axis has the value of the variable you've selected. In the example shown you can see a plot of the ages of all 40 subjects. You can use this to visually check your data for outliers. In Qdec if you roll your cursor over one of the points on the plot you can find out which subject it is, the ID will be shown in the lower left corner of the Qdec interface.

Design

When you click over to the Design tab your discrete (gender) and continuous (age, Left-Hippocampus, and Right-Hippocampus) factors should appear.BR attachment:qdec-design1.jpg BR You can select up to four factors in the Design tab to regress against. For the tutorial data, you could select 'gender' and 'age' and 'Left-Hippocampus' and 'Right-Hippocampus', or any combination of those. For simplicity in this example, choose only 'age' leaving the 'Measure', 'Hemisphere' and 'Smoothing' at their defaults (thickness, lh and 10mm). Before you click the 'Analyze' button you will want to name your Design, something like 'LH-Thickness-Age-sm10', and enter that into the "Design Name" text entry box at the top of the window. Now click the 'Analyze' button and the stats will begin processing, executing the mri_glmfit executable. Upon clicking 'Analyze', the terminal will display the output of this processing. Also, progress information is shown in the bottom bar of the qdec application.

Display

Once the analysis is complete (taking up to several minutes for a large subject set), you can click the Display tab and the fsaverage inflated surface will appear in the display window. You will see a list of questions summarizing the various analyses that were completed. attachment:qdec-display.jpg

You can click on one of these questions to load the results. If you click on Does the correlation between thickness and age differ from zero it will display the statistically significant regions where age and thickness are correlated. Here is an example display:

attachment:qdec-results2.jpg

Notice the green cross-hairs that indicate the vertex you have currently selected. You can change vertices and display a plot of the data for a particular vertex by left-clicking on a point while holding-down the Ctrl key. If you'd like to turn off the cursor display you can use the attachment:cursor.png button. Here is an example plot that corresponds to the shown selected vertex:

attachment:fsgdplot.jpg

The plot shows your measure on the y-axis (vertical) - in this case, cortical thickness - and the variable on the x-axis (horizontal) - in this case, age. Each data point on the plot is representative of an individual subject, denoting their age and cortical thickness at the vertex you have selected. For this example at this vertex, we can see that the cortex is thinning with age. The information at the bottom of the both the plot window and the QDEC window shows that this vertex has surface coordinates (-16.19, 7.86, 47.67) and is Vertex# 32217. The significance value is -5.27 and it is in the precentral region. The significance in this display is a -log(10)p value, and not a straight p value.

Interacting with your data

Rotating, Panning and Zoom You can rotate the display, hold-down the left mouse button and move the mouse. Holding-down the middle button while moving the mouse will move the display in the window. Holding-down the right mouse button while moving will zoom the display.

There are buttons at the top of the Qdec display that will rotate and zoom as well:BR attachment:rotateUP.png - rotates up 90 degreesBR attachment:rotateDOWN.png - rotates down 90 degreesBR attachment:rotateRIGHT.png - rotates right 90 degreesBR attachment:rotateLEFT.png - rotates left 90 degreesBR attachment:rotateCCW.png - rotates counterclockwise 90 degreesBR attachment:rotateCW.png - rotates clockwise 90 degreesBR attachment:zoomout.png - zoom outBR attachment:zoomin.png - zoom inBR If you get it rotated too far, the home button attachment:home-button.jpg will reset it.

Parcellation Display The cortical parcellation is loaded into Qdec upon opening. On the Display tab you can adjust the annotation opacity. There may be a slight delay while the display updates, be patient!

attachment:opacity.jpg

Sliding the button to the right will begin to show the parcellation annotation underneath the overlay. You can bring the opacity to a level that is useful in your interaction with the data. When you have selected a point, which is accomplished by holding down the ctrl key and left-clicking the mouse, the information at the bottom of the window will tell you what region, or parcellation unit, the point is found.

Significance Thresholds

You can also adjust the threshold levels for the overlay on the Display tab.

attachment:thresholds.jpg

When setting a color scale, you're interested in two things: the threshold (ie, the value below which the voxel will be transparent - Min), and the saturation point (ie, the value beyond which the color will not change - Max). In Qdec you can also specify the point where the color will reach the midpoint, with Mid on the control panel. The meaning of these thresholds depends upon the nature of the data you have loaded as the overlay. The map you are currently viewing is -log10(p), where p is the significance, so a Min of 2 will display all vertices with p<.01 and a Max of 5 will show vertices of p<.00001 as the same color. You can lower the threshold to 1.3, 2, 3, to show all vertices with p<.05. You could raise the threshold to 4, 5, 6 to show all vertices with p<.0001.

Variations on Design

With QDEC it is easy to design and run a variety of different analyses. For the first example we looked simply at age and thickness in our subjects. Click back to the Design tab and select gender, to add it to the design. You will want to change the name of the design, call it 'LH-Thickness-Age-Gender-sm10', and click Analyze. When the analysis is done running, click the Display tab and see that there are additional questions in the list summarizing the various analyses that were completed. Among the questions displayed now are Does the Thickness--age correlation differ between male and female? and Does the average thickness differ between male and female? Click on one of these questions to display the statistically significant regions where the age and thickness correlation are different in men and women, or the average thickness is different in men and women (respectively). Similarly, you can add in one of the other continous variables - hippocampal volume - and run that design.

You can change your design even more, if you click back to the Design tab, you can change your measure from thickness to something else - area, area.pial, volume, sulc, curv, and jacobian_white are your choices. You can also change your level of smoothing - 0, 5, 10, 15, 20, and 25 are your choices. And you can perform any of these on the left (lh) or right (rh) hemispheres. Take a few minutes to select a new design to run, remember to call it something new before you hit Analyze so that the directory of results can be saved.

Define a Region of Interest

FreeSurfer has the ability to compute statistics averaged over a defined region of interest (ROI), which is another popular way to test statistical hypotheses and a good way to check your data. To define a label that marks a region of interest (ROI) on the surface hold down shift then left click and drag to draw your ROI. When drawing your ROI, draw slowly, allowing the display to catch up with you if necessary. There is no need to worry about closing the ROI precisely, when you are done and release the mouse button Qdec will automatically close the ROI for you. You should then see a green outline of the ROI you drew, like this: BR attachment:qdec-label.jpg BR You can then select the add the selection to the ROI button attachment:addtoroi.jpg, and your label should now be filled in with purple, like this: BR attachment:qdec-labelfilled.jpg

If you do not add your label to the ROI and you start to draw again, Qdec will erase your first label and begin a second. If you have added something to the ROI and want to remove it you can use the remove selection from ROI button attachment:removefromroi.png. When you are finished you can save your label by selecting File --> Save Label or clicking the attachment:saveroi.png save label button. A dialog box will pop up, and you can choose the location and name to save your label. For this example you can call your label lh.supramarg.label, since it is a label of the supramarginal gyrus, and click Save.

It may then be useful to map this label to all of the individual subjects in your group study, to either extract statistical values from this region or to visualize the area on each subject to check the integrity of your results. You can do this automatically selecting File --> Map Label to Subjects..., a dialog box will pop up asking for the label name, you can enter everything before the .label of the name, so for this example enter lh.supramarg, and click Ok. This will use mri_label2label to map this label from your average surface onto all the subjects in your study. When it is complete each subject will have a file, lh.supramarg.label in the label subdirectory. This label can be loaded onto each subject's surface in tksurfer, or opened on the volume in tkmedit.

mris_anatomical_stats You can use mris_anatomical_stats to get a set of statistics on each individual label you've created. The command to run this on the label lh.supramarg.label that you generated for subject 004 is:

mris_anatomical_stats -l lh.supramarg.label \
-t lh.thickness -b -f 004/stats/lh.supramarg.stats 004 lh

This will output a stats file to 004/stats/lh.supramarg.stats, which looks like:

# Table of FreeSurfer cortical parcellation anatomical statistics
#
# CreationTime 2007/08/16-20:33:33-GMT
# generating_program mris_anatomical_stats
# cvs_version $Id: mris_anatomical_stats.c,v 1.54 2007/08/02 17:37:13 nicks Exp $
# mrisurf.c-cvs_version $Id: mrisurf.c,v 1.557 2007/08/14 01:28:23 fischl Exp $
# cmdline mris_anatomical_stats -l lh.supramarg.label -t lh.thickness -b -f 004/stats/lh.supramarg.stats 004 lh
# sysname  Linux
# hostname minerva
# machine  x86_64
# user     nicks
#
# SUBJECTS_DIR /autofs/space/birn_045/users/BWH/buckner_data/tutorial_subjs/group_analysis_tutorial
# anatomy_type surface
# subjectname 004
# hemi lh
# AnnotationFile lh.supramarg.label
# AnnotationFileTimeStamp 2007/08/16 16:21:56
# Measure Cortex, NumVert, Number of Vertices, 135485, unitless
# Measure Cortex, SurfArea, Surface Area,  96627.3, mm^2
# NTableCols 10
# TableCol  1 ColHeader StructName
# TableCol  1 FieldName Structure Name
# TableCol  1 Units     NA
# TableCol  2 ColHeader NumVert
# TableCol  2 FieldName Number of Vertices
# TableCol  2 Units     unitless
# TableCol  3 ColHeader SurfArea
# TableCol  3 FieldName Surface Area
# TableCol  3 Units     mm^2
# TableCol  4 ColHeader GrayVol
# TableCol  4 FieldName Gray Matter Volume
# TableCol  4 Units     mm^3
# TableCol  5 ColHeader ThickAvg
# TableCol  5 FieldName Average Thickness
# TableCol  5 Units     mm
# TableCol  6 ColHeader ThickStd
# TableCol  6 FieldName Thickness StdDev
# TableCol  6 Units     mm
# TableCol  7 ColHeader MeanCurv
# TableCol  7 FieldName Integrated Rectified Mean Curvature
# TableCol  7 Units     mm^-1
# TableCol  8 ColHeader GausCurv
# TableCol  8 FieldName Integrated Rectified Gaussian Curvature
# TableCol  8 Units     mm^-2
# TableCol  9 ColHeader  FoldInd
# TableCol  9 FieldName  Folding Index
# TableCol  9 Units      unitless
# TableCol 10 ColHeader CurvInd
# TableCol 10 FieldName Intrinsic Curvature Index
# TableCol 10 Units     unitless
# ColHeaders StructName NumVert SurfArea GrayVol ThickAvg ThickStd MeanCurv GausCurv FoldInd CurvInd
lh.supramarg.label      741     557      1492    2.271    0.646    0.191    0.099    27      3.2

This gives the number of vertices, surface area, gray matter volume, average thickness and st. deviation, mean curvature, gaussian curvature, folding index, and curvature index for this region only. You can run this same command on all your subjects to generate these statistics. You could then use ["aparcstats2table"] to generate one space delimited table of all these measures for your subjects.

In addition, it might be a good idea to visualize this label on each subject, to be sure there is not a defect in the surface causing your result. You can look at your label in tkemdit on the volume with the command:

tkmedit 004 brainmask.mgz lh.white -aux-surface rh.white -label lh.supramarg.label

If you scroll towards the posterior end of the brain, you will find your labelBR attachment:tkmedit-label-circle.jpg

Volumetric Group Analysis

During the normal Freesurfer processing stream, via the recon-all script, [http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial (a freesurfer tutorial is available.)] some statistical output files are generated. They are kept in each subjects stats/ subdirectory, and are a result of the subcortical segmentation, aseg, and the cortical parcellation, aparc. These tables include information on each labeled region for the individual subject.

aseg.stats

The statistical output from the subcortical segmentation, called aseg.stats, is a regular text file and will contain the volumes of specific structures.

At the head of the text file there will be information about the command that was run, the version used, the user who ran it and a time stamp. Following this there is information about the volume of the entire brain:

# Title Segmentation Statistics
#
# generating_program mri_segstats
# cvs_version $Id: mri_segstats.c,v 1.11.2.5 2006/04/13 18:57:07 nicks Exp $
# cmdline mri_segstats --seg mri/aseg.mgz --sum stats/aseg.stats --pv mri/norm.mgz --ctab-default 
--excludeid 0 --brain-vol-from-seg --brainmask mri/brainmask.mgz --in mri/norm.mgz --in-intensity-name norm 
--in-intensity-units MR --etiv --subject 004
# sysname  Linux
# hostname node0350
# machine  x86_64
# user     FS-user
# anatomy_type volume
#
# SUBJECTS_DIR /buckner_data/group_study
# subjectname 004
# BrainMaskFile  mri/brainmask.mgz
# BrainMaskFileTimeStamp  2006/24/03 13:47:46
# Measure BrainMask, BrainMaskNVox, Number of Brain Mask Voxels, 1744896, unitless
# Measure BrainMask, BrainMaskVol, Brain Mask Volume, 1744896.000000, mm^3
# Measure BrainSeg, BrainSegNVox, Number of Brain Segmentation Voxels, 1255291, unitless
# Measure BrainSeg, BrainSegVol, Brain Segmentation Volume, 1255291.000000, mm^3# Measure IntraCranialVol, ICV, Intracranial Volume, 1679242.759627, mm^3
# SegVolFile mri/aseg.mgz
# SegVolFileTimeStamp  2006/24/03 21:52:14
# ColorTable /space/freesurfer/centos4.0_x86_64/stable/FreeSurferColorLUT.txt
# ColorTableTimeStamp 2006/22/03 05:48:11
# InVolFile  mri/norm.mgz
# InVolFileTimeStamp  2006/24/03 13:55:16
# InVolFrame 0
# PVVolFile  mri/norm.mgz
# PVVolFileTimeStamp  2006/24/03 13:55:16
# ExcludeSegId 0
# VoxelVolume_mm3 1

This shows the number of voxels in the brainmask (BrainMaskNVox), the volume of the brainmask (BrainMaskVol), the number of voxels in the brainseg (BrainSegNVox), the volume of the brainseg (BrainSegVol), and the intracranial volume (ICV). This part of the file also tells us that the brainmask.mgz volume is being used as BrainMask (BrainMaskFile  mri/brainmask.mgz) and the aseg.mgz segmentation is being used as the SegVol (SegVolFile mri/aseg.mgz). The number of voxels and the volumes should be the same for this subject, since this part of the file also tells us that the voxel volume is 1 mm3 (VoxelVolume_mm3 1) - and volume is measured in mm3. BR

The next section of this file defines the column headers, field name, and units for the rest of the table:

# TableCol  1 ColHeader Index
# TableCol  1 FieldName Index
# TableCol  1 Units     NA
# TableCol  2 ColHeader SegId
# TableCol  2 FieldName Segmentation Id
# TableCol  2 Units     NA
# TableCol  3 ColHeader NVoxels
# TableCol  3 FieldName Number of Voxels
# TableCol  3 Units     unitless
# TableCol  4 ColHeader Volume_mm3
# TableCol  4 FieldName Volume
# TableCol  4 Units     mm^3
# TableCol  5 ColHeader StructName
# TableCol  5 FieldName Structure Name
# TableCol  5 Units     NA
# TableCol  6 ColHeader normMean
# TableCol  6 FieldName Intensity normMean
# TableCol  6 Units     MR
# TableCol  7 ColHeader normStdDev
# TableCol  7 FieldName Itensity normStdDev
# TableCol  7 Units     MR
# TableCol  8 ColHeader normMin
# TableCol  8 FieldName Intensity normMin
# TableCol  8 Units     MR
# TableCol  9 ColHeader normMax
# TableCol  9 FieldName Intensity normMax
# TableCol  9 Units     MR
# TableCol 10 ColHeader normRange
# TableCol 10 FieldName Intensity normRange
# TableCol 10 Units     MR
# NRows 403
# NTableCols 10

We can expect to see the Segmentation Id, Number of Voxels, Volume, Structure Name, Intensity normMean, Itensity normStdDev, Intensity normMin, Intensity normMax, and Intensity normRange for each entry in the table.BR

The remainder of the table shows this information for all the structures that are labeled in the aseg:

# ColHeaders  Index SegId NVoxels Volume_mm3 StructName normMean normStdDev normMin normMax normRange
  2   2    237201   237201.0  Left-Cerebral-White-Matter       107.5612    11.3261    31.0000   188.0000   157.0000
  3   3    249096   249096.0  Left-Cerebral-Cortex              69.8956    11.0623     0.0000   139.0000   139.0000
  4   4     31329    31329.0  Left-Lateral-Ventricle            23.0385    11.1648     7.0000    91.0000    84.0000
  5   5      1735     1735.0  Left-Inf-Lat-Vent                 42.2160    15.5492    14.0000    94.0000    80.0000
  7   7     13767    13767.0  Left-Cerebellum-White-Matter      87.6124     7.8224    43.0000   116.0000    73.0000
  8   8     48245    48245.0  Left-Cerebellum-Cortex            60.1777     9.4993    25.0000    94.0000    69.0000
 10  10      7025     7025.0  Left-Thalamus-Proper              89.5336    11.9082    19.0000   126.0000   107.0000
 11  11      5252     5252.0  Left-Caudate                      77.3650    11.3959    45.0000   105.0000    60.0000
 12  12      7993     7993.0  Left-Putamen                      81.3400     9.7069    28.0000   115.0000    87.0000
 13  13      2144     2144.0  Left-Pallidum                     97.6942    11.7513    36.0000   121.0000    85.0000
.
.
.
.

You can use the data in this table to perform group stats on the volumes of certain structures that may be of interest to your study. There is a way to combine this data, for your entire group, into one table that will be easily read into a spreadsheet program, by using ["asegstats2table"]. You can do this for the tutorial set of subjects with this sample command line:

asegstats2table --subjects 004 008 017 021 032 039 040 045 049 067 \
073 074 080 084 091 092 093 095 097 099 102 103 106 108 111 114 123 \
124 128 129 130 131 133 136 138 140 141 144 145 149 \
--meas vol --t asegstats.txt

This will combine the volumes from all of your subjects asegs.stats files into one table, asegstats.tct. This table can now be imported into any spreadsheet program for statistical analysis.

aparc.stats

The statistical output from the cortical parcellation, called lh.aparc.stats and rh.aparc.stats, is a regular text file and will contain the thickness of specific structures.

At the head of the text file there will be information about the command that was run, the version used, the user who ran it and a time stamp. Following this there is information about the volume of the entire brain:

# Table of FreeSurfer cortical parcellation anatomical statistics
#
# CreationTime 2006/04/25-09:31:20-GMT
# generating_program mris_anatomical_stats
# cvs_version $Id: mris_anatomical_stats.c,v 1.35.2.1 2006/04/21 19:45:19 nicks Exp $
# mrisurf.c-cvs_version $Id: mrisurf.c,v 1.441.2.3 2006/04/12 02:03:02 nicks Exp  $
# cmdline mris_anatomical_stats -mgz -f ../stats/lh.aparc.stats -b -a ../label/l h.aparc.annot -c ../stats/aparc.annot.ctab 004 lh
# sysname  Linux
# hostname node0350
# machine  x86_64
# user     FS-user
#
# SUBJECTS_DIR /buckner_data/group_study
# anatomy_type surface
# subjectname 004
# hemi lh
# AnnotationFile ../label/lh.aparc.annot
# AnnotationFileTimeStamp 2006/25/03 05:31:10
# TotalWhiteMatterVolume  634178 mm^3
# Measure Cortex, NumVert, Number of Vertices, 150889, unitless
# Measure Cortex, SurfArea, Surface Area,  102409, mm^2

This shows the total white matter volume (TotalWhiteMatterVolume), the number of vertices in the cortex (NumVert), and the surface area of the cortex (SurfArea). This part of the file also tells us that the lh.aparc.annot is being used as the annotation file (AnnotationFile ../label/lh.aparc.annot).BR

The next section of this file defines the column headers, field name, and units for the rest of the table:

# NTableCols 10
# TableCol  1 ColHeader StructName
# TableCol  1 FieldName Structure Name
# TableCol  1 Units     NA
# TableCol  2 ColHeader NumVert
# TableCol  2 FieldName Number of Vertices
# TableCol  2 Units     unitless
# TableCol  3 ColHeader SurfArea
# TableCol  3 FieldName Surface Area
# TableCol  3 Units     mm^2
# TableCol  4 ColHeader GrayVol
# TableCol  4 FieldName Gray Matter Volume
# TableCol  4 Units     mm^3
# TableCol  5 ColHeader ThickAvg
# TableCol  5 FieldName Average Thickness
# TableCol  5 Units     mm
# TableCol  6 ColHeader ThickStd
# TableCol  6 FieldName Thickness StdDev
# TableCol  6 Units     mm
# TableCol  7 ColHeader MeanCurv
# TableCol  7 FieldName Integrated Rectified Mean Curvature
# TableCol  7 Units     mm^-1
# TableCol  8 ColHeader GausCurv
# TableCol  8 FieldName Integrated Rectified Gaussian Curvature
# TableCol  8 Units     mm^-2
# TableCol  9 ColHeader  FoldInd
# TableCol  9 FieldName  Folding Index
# TableCol  9 Units      unitless
# TableCol 10 ColHeader CurvInd
# TableCol 10 FieldName Intrinsic Curvature Index
# TableCol 10 Units     unitless

We can expect to see the Structure Name, Number of Vertices, Surface Area, Gray Matter Volume, Average Thickness, Thickness StDev, Integrated Rectified Mean Curvature, Integrated Rectified Gaussian Curvature, Folding Index and Intrinsic Curvature Index for each entry in the table.BR

The remainder of the table shows this information for all the structures that are labeled in the aseg:

# ColHeaders StructName NumVert SurfArea GrayVol ThickAvg ThickStd MeanCurv GausCurv FoldInd CurvInd
unknown                                 15085  10384  21630  2.006 1.096     0.123     0.038  168.313  26.766
bankssts                                 1126    770   1563  2.132 0.462     0.103     0.024    7.056   1.004
caudalanteriorcingulate                   931    636   2125  2.721 0.675     0.127     0.031   15.801   0.991
caudalmiddlefrontal                      3577   2403   6575  2.447 0.535     0.120     0.028   34.901   3.674
corpuscallosum                           1035    680   1215  2.123 0.902     0.136     0.023   17.731   0.799
cuneus                                   2966   1958   3769  1.740 0.473     0.140     0.033   37.320   3.630
entorhinal                                683    419   1620  2.819 0.632     0.090     0.021    5.349   0.429
fusiform                                 6622   4607  11486  2.190 0.634     0.130     0.032   77.276   7.884
.
.
.
.

You can use the data in this table to perform group stats on the thickness, area, volume, etc. of certain structures that may be of interest to your study. There is a way to combine this data, for your entire group, into one table that will be easily read into a spreadsheet program, by using ["aparcstats2table"]. You can do this for the tutorial set of subjects with this sample command line:

aparcstats2table --subjects 004 008 017 021 032 039 040 045 049 067 \
073 074 080 084 091 092 093 095 097 099 102 103 106 108 111 114 123 \
124 128 129 130 131 133 136 138 140 141 144 145 149 \
--hemi lh --meas area --t aparcstatsAREA.txt

This will combine the areas from all of your subjects lh.aparc.stats files into one table, aparcstatsAREA.txt. This table can now be imported into any spreadsheet program for statistical analysis. You can change your command to run on the other hemisphere, or on a different measure (volume, thickness).

FsTutorial/QdecGroupAnalysis_tktools (last edited 2013-11-01 14:30:07 by MaritzaEbling)