Title: Surface-based Exploratory Group Analysis in FreeSurfer
1Surface-based Exploratory Group Analysis in
FreeSurfer
2Outline
- Processing Stages
- Command-line Stream
- Assemble Data
- Design/Contrast (GLM Theory)
- Analyze
- Visualize
- Interactive/Automated GUI (QDEC)
- Correction for multiple comparisons
3Aging Exploratory Analysis
In which areas does thickness change with age?
Cortical Thickness vs Aging Salat, et al, 2004,
Cerebral Cortex
4Aging Thickness Study
N40 (all in fsaverage space)
plt.01
5Surface-based Measures
- Morphometric (eg, thickness)
- Functional
- PET
- MEG/EEG
- Diffusion (?) sampled just under the surface
6Processing Stages
- Specify Subjects and Surface measures
- Assemble Data
- Resample into Common Space
- Smooth
- Concatenate into one file
- Model and Contrasts (GLM)
- Fit Model (Estimate)
- Correct for multiple comparisons
- Visualize
7The General Linear Model (GLM)
Is Thickness correlated with Age?
Thickness
Dependent Variable, Measurement
Subject 1
Subject 2
HRF Amplitude IQ, Height, Weight
Age
Of course, youd need more then two subjects
Independent Variable
8Linear Model
System of Linear Equations y1 1b x1m y2
1b x2m
Intercept Offset
X Design Matrix ? Regression Coefficients
Parameter estimates betas
Intercepts and Slopes beta.mgh (mri_glmfit)
Y X?
mri_glmfit output beta.mgh
9Hypotheses and Contrasts
Is Thickness correlated with Age? Does m
0? Null Hypothesis H0 m0
C0 1 Contrast Matrix
mri_glmfit output gamma.mgh
10More than Two Data Points
Thickness
Intercept b
Slope m
Age
Y X?
y1 1b x1m y2 1b x2m y3 1b
x3m y4 1b x4m
- Model Error
- Noise
- Uncertainty
- rvar.mgh
11t-Test and p-values
Y X?
? C?
- p-value/significance
- value between 0 and 1
- closer to 0 means more significant
- FreeSurfer stores p-values as log10(p)
- 0.110-1?sig1, 0.0110-2?sig2
- sig.mgh files
- Signed by sign of ?
- p-value is for an unsigned test
p-value sig
0.1 10-1.0 1.0
0.05 10-1.3 1.3
0.01 10-2.0 2.0
0.00110-3.0 3.0
12Two Groups
Do groups differ in Intercept? Do groups differ
in Slope?
Is average slope different than 0?
13Two Groups
Y X?
y11 1b1 0b2 x11m1 0m2 y12 1b1
0b2 x12m1 0m2 y21 0b1 1b2
0m1 x21m2 y22 0b1 1b2 0m1
x22m2
14Two Groups
y11 y12 y21 y22
1 0 x11 0 1 0 x12 0 0 1 0 x21 0 1
0 x22
Do groups differ in Intercept? Does b1b2? Does
b1-b2 0? C 1 -1 0 0, ? C?
Do groups differ in Slope? Does m1m2? Does
m1-m20? C 0 0 1 -1, ? C?
Y X?
???
Is average slope different than 0? Does (m1m2)/2
0? C 0 0 0.5 0.5, ? C?
15Surface-based Group Analysis in FreeSurfer
- Create your own design matrix and contrast
matrices - Create an FSGD File
- FreeSurfer creates design matrix
- You still have to specify contrasts
- QDEC
- Limited to 2 discrete variables, 2 levels max
- Limited to 2 continuous variables
16Command-line Processing Stages
- Assemble Data (mris_preproc)
- Resample into Common Space
- Smooth
- Concatenate into one file
- Model and Contrasts (GLM) (FSGD)
- Fit Model (Estimate) (mri_glmfit)
- Correct for multiple comparisons
- Visualize (tksurfer)
17Specifying Subjects
Subject ID
SUBJECTS_DIR
fred
jenny
margaret
18FreeSurfer Directory Tree
- bert
- bem stats morph mri rgb scripts surf
tiff label - orig T1 brain wm aseg
Subject ID
lh.aparc_annnot rh.aparc_annnot
lh.white rh.white
lh.thickness rh.thickness
lh.sphere.reg rh.sphere.reg
SUBJECTS_DIR environment variable
19Example Thickness Study
- SUBJECTS_DIR/bert/surf/lh.thickness
- SUBJECTS_DIR/fred/surf/lh.thickness
- SUBJECTS_DIR/jenny/surf/lh.thickness
- SUBJECTS_DIR/margaret/surf/lh.thickness
20FreeSurfer Group Descriptor (FSGD) File
- Simple text file
- List of all subjects in the study
- Accompanying demographics
- Like a spreadsheet
- Automatic design matrix creation
- You must still specify the contrast matrices
- Integrated with tksurfer
Note Can specify design matrix explicitly with
--design
21FSGD Format
GroupDescriptorFile 1 Class Male Class
Female Variables Age
Weight IQ Input bert Male 10
100 1000 Input fred Male
15 150 1500 Input jenny Female
20 200 2000 Input margaret Female
25 250 2500
- One Discrete Factor (Gender) with Two Levels
(MF) - Three Continuous Variables Age, Weight, IQ
Class Group
Note Can specify design matrix explicitly with
--design
22FSGDF ? X (Automatic)
C -1 1 0 0 0 0
0 0
Tests for the difference in intercept/offset
between groups
C 0 0 -1 1 0 0
0 0
Tests for the difference in age slope between
groups
DODS Different Offset, Different Slope
23Another FSGD Example
- Two Discrete Factors
- Gender Two Levels (MF)
- Handedness Two Levels (LR)
- One Continuous Variable Age
GroupDescriptorFile 1 Class MaleRight Class
MaleLeft Class FemaleRight Class FemaleLeft
Variables Age
Input bert MaleLeft 10 Input
fred MaleRight 15 Input jenny
FemaleRight 20 Input margaret
FemaleLeft 25
Class Group
24Interaction Contrast
- Two Discrete Factors (no continuous, for now)
- Gender Two Levels (MF)
- Handedness Two Levels (LR)
- Four Regressors (Offsets)
- MR (?1), ML (?2), FR (?3), FL (?4)
GroupDescriptorFile 1 Class MaleRight Class
MaleLeft Class FemaleRight Class FemaleLeft
Input bert MaleLeft Input fred
MaleRight Input jenny FemaleRight Input
margaret FemaleLeft
25Number of Regressors
- Each Group/Class
- Has its own Intercept
- Has its own Slope for each continuous variable
- DODS Different offset, different slope
- NRegressors NClasses(NVariables1)
C -1 1 0 0 0 0
0 0
Tests for the difference in intercept/offset
between groups
C 0 0 -1 1 0 0
0 0
Tests for the difference in age slope between
groups
26Factors, Levels, Groups, Classes
- Factors can be Discrete or Continuous
- Continuous Variables Age, IQ, Volume, etc
- Discrete Factors Gender, Handedness, Diagnosis
- Discrete Factors have Levels
- Gender Male and Female
- Handedness Left and Right
- Diagnosis Normal, MCI, AD
- Group or Class Specification of All Discrete
Factors - Left-handed Male MCI
- Right-handed Female Normal
27Assemble Data mris_preproc
mris_preproc --help
--fsgd FSGDFile Specify subjects thru FSGD
File --hemi lh Process
left hemisphere --meas thickness
SUBJECTS_DIR/subjectid/surf/hemi.thickness --targ
et fsaverage common space is subject
fsaverage --o lh.thickness.mgh output
volume-encoded surface file Lots of other
options!
lh.thickness.mgh file with thickness maps for
all subjects ? Input to Smoother or GLM
28Surface Smoothing
- mri_surf2surf --help
- Loads lh.thickness.mgh
- 2D surface-based smoothing
- Specify FWHM (eg, fwhm 10 mm)
- Saves lh.thickness.sm10.mgh
- Can be slow (10-60min)
- recon-all -qcache
29mri_glmfit
- Reads in FSGD File and constructs X
- Reads in your contrasts (C1, C2, etc)
- Loads data (lh.thickness.sm10.mgh)
- Fits GLM (ie, computes ?)
- Computes contrasts (?C?)
- t or F ratios, significances
- Significance -log10(p) (.01 ? 2, .001 ? 3)
30mri_glmfit
mri_glmfit --y lh.thickness.sm10.mgh --fsgd
gender_age.txt --C age.mtx C gender.mtx --surf
fsaverage lh --cortex --glmdir
lh.gender_age.glmdir
mri_glmfit --help
31mri_glmfit
mri_glmfit --y lh.thickness.sm10.mgh --fsgd
gender_age.txt --C age.mtx C gender.mtx --surf
fsaverage lh --cortex --glmdir
lh.gender_age.glmdir
Input file (output from smoothing). Stack of
subjects, one frame per subject
32mri_glmfit
mri_glmfit --y lh.thickness.sm10.mgh --fsgd
gender_age.txt --C age.mtx C gender.mtx --surf
fsaverage lh --cortex --glmdir
lh.gender_age.glmdir
- FreeSurfer Group Descriptor File (FSGD)
- Group membership
- Covariates
33mri_glmfit
mri_glmfit --y lh.thickness.sm10.mgh --fsgd
gender_age.txt --C age.mtx C gender.mtx --surf
fsaverage lh --cortex --glmdir
lh.gender_age.glmdir
- Contrast Matrices
- Simple text/ASCII files
- Test hypotheses
34mri_glmfit
mri_glmfit --y lh.thickness.sm10.mgh --fsgd
gender_age.txt --C age.mtx C gender.mtx --surf
fsaverage lh --cortex --glmdir
lh.gender_age.glmdir
- Perform analysis on left hemisphere of fsaverage
subject - Masks by fsaverage cortex.label
- Computes FWHM in 2D
35mri_glmfit
Output directory lh.gender_age.glmdir/
beta.mgh parameter estimates rvar.mgh
residual error variance etc age/
sig.mgh -log10(p), uncorrected gamma.mgh,
F.mgh gender/ sig.mgh -log10(p)
gamma.mgh, F.mgh
mri_glmfit --y lh.thickness.sm10.mgh --fsgd
gender_age.txt --C age.mtx C gender.mtx --surf
fsaverage lh --cortex --glmdir
lh.gender_age.glmdir
36 Visualization with tksurfer
Saturation -log10(p), Eg, 5.00001
Threshold -log10(p), Eg, 2.01 uncorrected
False Dicovery Rate Eg, .01
View-gtConfigure-gtOverlay
File-gtLoadOverlay
37 Visualization with tksurfer
File-gt Load Group Descriptor File
38Problem of Multiple Comparisons
p lt 0.10
p lt 0.01
p lt 10-7
- p value is probability that a voxel is falsely
activated - Threshold too liberal many false positives
- Threshold too restrictive lose activation
(false negatives)
39Clusters
plt.10
plt.01
plt10-7
- True signal tends to be clustered
- False Positives tend to be randomly distributed
in space - Cluster set of spatially contiguous voxels
that are above a given threshold.
40Cluster-forming Threshold
Unthresholded
As threshold lowers, clusters may expand or merge
and new clusters can form. No way to say what the
threshold should be.
41Cluster Table, Uncorrected
plt.0001 siglt4
38 clusters ClusterNo Area(mm2) X Y
Z Structure Cluster 1 3738.82
-11.1 34.5 27.2 superiorfrontal Cluster
2 5194.19 -32.4 -23.3 15.7 insula
Cluster 3 1271.30 -25.9 -75.0 19.0
superiorparietal Cluster 4 775.38
-44.4 -9.7 51.3 precentral Cluster 5
440.56 -33.0 -36.8 37.5 supramarginal
How likely is it to get a cluster of a certain
size under the null hypothesis?
42Correction for Multiple Comparisons
- Cluster-based
- Monte Carlo simulation
- Permutation Tests
- False Discovery Rate (FDR) built into tksurfer
and QDEC. (Genovese, et al, NI 2002)
43Cluster-based Corr. for Multiple Comparisons
- Simulate data under Null Hypothesis
- Synthesize Gaussian noise and then smooth (Monte
Carlo) - Permute rows of design matrix (Permutation,
orthog) - Analyze, threshold, cluster, max cluster size
- Repeat 10,000 times
- Analyze real data, get cluster sizes
- P(cluster) MaxClusterSize gt ClusterSize/10000
mri_glmfit-sim
44Cluster Table, Corrected
plt.0001 siglt4
22 clusters out of 38 have cluster p-value lt
.05 ClusterNo Area(mm2) X Y Z
Structure Cluster P Cluster 1
3738.82 -11.1 34.5 27.2 superiorfrontal
.0001 Cluster 2 5194.19 -32.4 -23.3
15.7 insula .0003 Cluster 3
1271.30 -25.9 -75.0 19.0
superiorparietal .0050 Cluster 4 775.38
-44.4 -9.7 51.3 precentral
.0100 Cluster 5 440.56 -33.0 -36.8
37.5 supramarginal .0400
Note the difference between the Cluster Forming
Threshold (plt.0001) and the Cluster p-value.
45Surface-based Corr. for Multiple Comparisons
- 2D Cluster-based Correction at p lt .05
mri_glmfit-sim --glmdir lh.gender_age.glmdir
--cache pos 2 --cwpvalthresh .05 --2spaces
46Surface-based Corr. for Multiple Comparisons
- 2D Cluster-based Correction at p lt .05
mri_glmfit-sim --glmdir lh.gender_age.glmdir
--cache pos 2 --cwpvalthresh .05 --2spaces
lh.gender_age.glmdir/ beta.mgh parameter
estimates rvar.mgh residual error variance
etc age/ sig.mgh -log10(p),
uncorrected gamma.mgh, F.mgh gender/
sig.mgh -log10(p) gamma.mgh, F.mgh
47Surface-based Corr. for Multiple Comparisons
- 2D Cluster-based Correction at p lt .05
mri_glmfit-sim --glmdir lh.gender_age.glmdir
--cache pos 2 --cwpvalthresh .05 --2spaces
- Use pre-cached simulation results
- positive contrast
- voxelwise threshold 2 (plt.01)
- Can use another simulation or permutation
48Surface-based Corr. for Multiple Comparisons
- 2D Cluster-based Correction at p lt .05
mri_glmfit-sim --glmdir lh.gender_age.glmdir
--cache pos 2 --cwpvalthresh .05 --2spaces
Cluster-wise threshold plt.05
4949
Surface-based Corr. for Multiple Comparisons
- 2D Cluster-based Correction at p lt .05
mri_glmfit-sim --glmdir lh.gender_age.glmdir
--cache pos 2 --cwpvalthresh .05 --2spaces
Bonferroni correct over two hemispheres
50Correction for Multiple Comparisons Output
lh.gender_age.glmdir
mri_glmfit-sim --glmdir lh.gender_age.glmdir
--cache pos 2 --cwpvalthresh .05 --2spaces
age
gender
sig.mgh pre-existing uncorrected
p-values cache.th20.pos.sig.cluster.mgh map of
significance of clusters cache.th20.pos.sig.ocn.an
not annotation of significant
clusters cache.th20.pos.sig.cluster.summary
text file of cluster table (clusters, sizes,
MNI305 XYZ, and their significances)
- Only shows clusters plt.05
51Tutorial
- Command-line Stream
- Create an FSGD File for a thickness study
- Age and Gender
- Run
- mris_preproc
- mri_surf2surf
- mri_glmfit
- mri_glmfit-sim
- tksurfer
- QDEC same data set
52QDEC GUI
- Load QDEC Table File
- List of Subjects
- List of Factors (Discrete and Cont)
- Choose Factors
- Choose Input (cached)
- Hemisphere
- Measure (eg, thickness)
- Smoothing Level
- Analyze
- Builds Design Matrix
- Builds Contrast Matrices
- Constructs Human-Readable Questions
- Analyzes
- Displays Results