Surfacebased Group Analysis in Free Surfer Outline Processing
Surface-based Group Analysis in Free. Surfer
Outline • Processing Stages • Command-line Stream – – Assemble Data Design/Contrast (GLM Theory) Analyze Visualize • Interactive/Automated GUI (QDEC) • Correction for multiple comparisons 2
Surface-based Study (Thickness) 3
Surface-based Measures • • • Morphometric (eg, thickness) Functional PET MEG/EEG Diffusion (? ) sampled just under the surface 4
Processing 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 5
The General Linear Model (GLM) 6
GLM Theory Is Thickness correlated with Age? Thickness Dependent Variable, Measurement HRF Amplitude IQ, Height, Weight Subject 1 y 1 Subject 2 y 2 Age x 1 x 2 Independent Variable Of course, you’d need more then two subjects … 7
Thickness Linear Model Intercept: b System of Linear Equations y 1 = 1*b + x 1*m Slope: m y 2 = 1*b + x 2*m y 1 Matrix Formulation y 2 Age x 1 Intercept = Offset x 2 X = Design Matrix b = Regression Coefficients = Parameter estimates = “betas” = Intercepts and Slopes = beta. mgh (mri_glmfit) b y 1 1 x 1 = * m y 2 1 x 2 Y = X*b b= b m mri_glmfit output: beta. mgh
Hypotheses and Contrasts Is Thickness correlated with Age? Does m = 0? Null Hypothesis: H 0: m=0 Thickness b y 1 1 x 1 = 1 x 2 * m y 2 m= [0 1] * b m Intercept: b Slope: m y 1 b= b m ? g = C*b = 0 C=[0 1]: Contrast Matrix y 2 Age x 1 x 2 mri_glmfit output: gamma. mgh
More than Two Data Points Thickness Intercept: b Slope: m Age y 1 = 1*b + x 1*m y 2 = 1*b + x 2*m y 3 = 1*b + x 3*m y 4 = 1*b + x 4*m b y 1 1 x 1 = 1 x 2 * m y 2 y 3 1 x 3 y 4 1 x 4 Y = X*b • Model Error • Noise • Uncertainty • rvar. mgh 10
t-Test and p-values Y = X*b g = C*b p-value/significance • value between 0 and 1 • closer to 0 means more significant Free. Surfer stores p-values as –log 10(p): • 0. 1=10 -1 sig=1, 0. 01=10 -2 sig=2 • sig. mgh files • Signed by sign of g • p-value is for an unsigned test 11
Two Groups Intercept: b 1 Do groups differ in Intercept? Do groups differ in Slope? Thickness Slope: m 1 Is average slope different than 0? … Slope: m 2 Age Intercept: b 2 12
Two Groups Thickness Intercept: b 1 Slope: m 2 Age Intercept: b 2 y 11 1 0 x 11 0 * b 1 y 12 b 2 1 0 x 12 0 = y 21 m 1 0 x 21 y 22 m 2 0 1 0 x 22 Y = X*b y 11 = 1*b 1 + 0*b 2 + x 11*m 1 + 0*m 2 y 12 = 1*b 1 + 0*b 2 + x 12*m 1 + 0*m 2 y 21 = 0*b 1 + 1*b 2 + 0*m 1 + x 21*m 2 y 22 = 0*b 1 + 1*b 2 + 0*m 1 + x 22*m 2 13
Two Groups Do groups differ in Intercept? Does b 1=b 2? Does b 1 -b 2 = 0? C = [+1 -1 0 0], g = C*b Do groups differ in Slope? Does m 1=m 2? Does m 1 -m 2=0? C = [0 0 +1 -1], g = C*b Is average slope different than 0? Does (m 1+m 2)/2 = 0? C = [0 0 0. 5], g = C*b y 11 1 0 x 11 0 * y 12 1 0 x 12 0 = y 21 0 x 21 y 22 0 1 0 x 22 Y = X*b b= Thickness Intercept: b 1 b 2 m 1 m 2 Slope: m 1 Slope: m 2 Age Intercept: b 2 14
Surface-based Group Analysis in Free. Surfer • Create your own design matrix and contrast matrices • Create an FSGD File – Free. Surfer creates design matrix – You still have to specify contrasts • QDEC – Limited to 2 discrete variables, 2 levels max – Limited to 2 continuous variables 15
Command-line Processing Stages • Assemble Data (mris_preproc) – Resample into Common Space – Smooth – Concatenate into one file • • } recon-all -qcache Model and Contrasts (GLM) (FSGD) Fit Model (Estimate) (mri_glmfit) Correct for multiple comparisons Visualize (tksurfer) 16
Subject ID Specifying Subjects $SUBJECTS_DIR bert fred jenny margaret … 17
Free. Surfer Directory Tree Subject ID bert bem orig stats T 1 morph mri rgb scripts surf tiff label brain wm lh. white rh. white aseg lh. aparc_annnot rh. aparc_annnot lh. thickness lh. sphere. reg rh. thickness rh. sphere. reg SUBJECTS_DIR environment variable
Example: 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 … 19
Free. Surfer Group Descriptor (FSGD) File • • • Simple text file List of all subjects in the study Accompanying demographics Automatic design matrix creation You must still specify the contrast matrices Integrated with tksurfer Note: Can specify design matrix explicitly with --design 20
FSGD Format Group. Descriptor. File 1 Class Male Class Female Variables Age Weight IQ Input bert Male 10 1000 Input fred Male 15 1500 Input jenny Female 20 2000 Input margaret Female 25 2500 • One Discrete Factor (Gender) with Two Levels (M&F) • Three Continuous Variables: Age, Weight, IQ Class = Group Note: Can specify design matrix explicitly with --design 21
FSGD X (Automatic) Male Age Female Group Female Age Male Group 1 1 0 0 X= 0 0 1 1 10 0 15 0 0 25 Age [-1 1 } C= 0 0 100 0 150 0 0 200 0 250 1000 1500 0 0 2000 2500 Weight 0 IQ 0 0 0] Tests for the difference in intercept/offset between groups [0 0 -1 1 } C= 0 0] Tests for the difference in age slope between groups DODS – Different Offset, Different Slope 22
Factors, Levels, Groups • Each Group/Class: – has its own intercept – has its own slope (for each continuous variable) • NRegressors = NClasses*(NVariables+1) 23
Factors, Levels, Groups, Classes Continuous Variables/Factors: Age, IQ, Volume, etc Discrete Variables/Factors: Gender, Handedness, Diagnosis Levels of Discrete : • Handedness: Left and Right • Gender: Male and Female • Diagnosis: Normal, MCI, AD Group or Class: Specification of All Discrete Factors: • Left-handed Male MCI • Right-handed Female Normal 24
Assemble Data: mris_preproc --help --fsgd FSGDFile : Specify subjects thru FSGD File --hemi lh : Process left hemisphere --meas thickness : $SUBJECTS_DIR/subjectid/surf/hemi. thickness --target 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 25
Surface Smoothing • • mri_surf 2 surf --help Loads lh. thickness. mgh 2 D surface-based smoothing Specify FWHM (eg, fwhm = 10 mm) Saves lh. thickness. sm 10. mgh Can be slow (~10 -60 min) recon-all -qcache 26
mri_glmfit • • Reads in FSGD File and constructs X Reads in your contrasts (C 1, C 2, etc) Loads data (lh. thickness. sm 10. mgh) Fits GLM (ie, computes b) Computes contrasts (g=C*b) t or F ratios, significances Significance -log 10(p) (. 01 2, . 001 3) 27
mri_glmfit --y lh. thickness. sm 10. mgh --fsgd gender_age. txt --C age. mtx –C gender. mtx --surf fsaverage lh --cortex --glmdir lh. gender_age. glmdir mri_glmfit --help Creates: lh. gender_age. glmdir/ beta. mgh – parameter estimates rvar. mgh – residual error variance etc … age/ sig. mgh – -log 10(p), uncorrected gamma. mgh, F. mgh gender/ sig. mgh – -log 10(p) gamma. mgh, F. mgh 28
Visualization with tksurfer Threshold: -log 10(p), Eg, 2=. 01 Saturation: -log 10(p), Eg, 5=. 00001 False Dicovery Rate Eg, . 01 View->Configure->Overlay File->Load. Overlay 29
Visualization with tksurfer File-> Load Group Descriptor File … 30
Problem of Multiple Comparisons p < 0. 10 p < 0. 01 p < 10 -7 31
Correction for Multiple Comparisons • Cluster-based – Monte Carlo simulation – Permutation Tests – Surface Gaussian Random Fields (GRF) • There but not fully tested • False Discovery Rate (FDR) – built into tksurfer and QDEC. (Genovese, et al, NI 2002) 32
Clustering 1. Choose a vertex-wise threshold • • Eg, 2 (p<. 01), or 3 (p<. 001) Sign (pos, neg, abs) 2. A cluster is a group of connected (neighboring) vertices above threshold 3. Cluster has a size (area in mm 2) p<. 01 (-log 10(p)=2) Negative p<. 0001 (-log 10(p)=4) Negative 33
Cluster-based Correction for Multiple Comparisons 1. Simulate data under Null Hypothesis: – – 2. 3. 4. 5. 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) = #Max. Cluster. Size > Cluster. Size/10000 mri_glmfit-sim 34
QDEC – An Interactive Statistical Engine GUI Query – Select subjects based on Match Criteria Design – Specify discrete and continuous factors Estimate – Fit Model Contrast – Automatically Generate Contrast Matrices Interactive – Makes easy things easy (that used to be hard) …a work in progress • No Query yet • Two Discrete Factors (Two Levels) • Two Continuous Factors • Surface only 35
QDEC – Spreadsheet qdec. table. dat – spreadsheet with subject information – spreadsheet can be huge! fsid 011121_vc 8048 021121_62313 -2 010607_vc 7017 021121_vc 10557 020718_62545 020322_vc 8817 gender. levels Female Male gender Female Male age 70 71 73 75 76 77 diagnosis Left-Cerebral-White-Matter-Vol Demented 202291 Demented 210188 Nondemented 170653 Demented 142029 Demented 186087 Nondemented 149810 diagnosis. levels Demented Nondemented Discrete Factors need a factorname. level file 36
Tutorial 1. Command-line Stream 1. Create an FSGD File for a thickness study 2. Age and Gender • Run • • • mris_preproc mri_surf 2 surf mri_glmfit-sim tksurfer 2. QDEC – same data set 37
Another FSGD Example • Two Discrete Factors – Gender: Two Levels (M&F) – Handedness: Two Levels (L&R) • One Continuous Variable: Age Group. Descriptor. File 1 Class Male. Right Class Male. Left Class Female. Right Class Female. Left Variables Age Input bert Male. Left 10 Input fred Male. Right 15 Input jenny Female. Right 20 Input margaret Female. Left 25 Class = Group 38
Interaction Contrast • Two Discrete Factors (no continuous, for now) – Gender: Two Levels (M&F) – Handedness: Two Levels (L&R) b 4 L D 2 b 2 • Four Regressors (Offsets) – MR (b 1), ML (b 2), FR (b 3), FL (b 4) Group. Descriptor. File 1 Class Male. Right Class Male. Left Class Female. Right Class Female. Left Input bert Male. Left Input fred Male. Right Input jenny Female. Right Input margaret Female. Left R b 3 D 1 b 1 M ? F g = D 1 -D 2=0 g = (b 3 -b 1)- (b 4 -b 2) = -b 1+b 2+ b 3 -b 4 C = [-1 +1 +1 -1] 39
QDEC 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 40
41
42
FSGD X DOSS – Different Offset, Same Slope Female Class Age for Males and Females Input: • y • X • C Male Class X= 1 1 0 0 1 1 10 15 20 25 100 150 200 250 C= [-1 1 0 0 1000 1500 2000 2500 0] Same test, different vector #Regressors = Nv+Nc = 3+2=5 Fewer regressors than DODS DOF = #Rows - #Regressors 43
- Slides: 43