1.08k likes | 2.04k Views
Surface-based Group Analysis in FreeSurfer. Outline. Group Analysis Overview Theory Surface-based Intersubject Registration Surface-based Smoothing General Linear Model (GLM) Practice FSGD File Processing Stages Vertex-wise Analysis Correction for multiple comparisons
E N D
Outline • Group Analysis Overview • Theory • Surface-based Intersubject Registration • Surface-based Smoothing • General Linear Model (GLM) • Practice • FSGD File • Processing Stages • Vertex-wise Analysis • Correction for multiple comparisons • Interactive/Automated GUI (QDEC)
Analysis Pipeline Native Space Template: fsaverage Surface Extraction Group Analysis (Design X, Contrast C) Input T1 mris_preproc mri_glmfit mri_glmfit-sim Surface-based Normalization Folding Pattern Thickness (fsaverage) Surface Smoothed Apply Normalization Thickness recon-all recon-all –qcache
Aging Thickness Study Positive Age Correlation Negative Age Correlation N=40 Design X (slope, intercept) Contrast C p<.01
Theory • Surface-based Intersubject Registration • Surface-based Smoothing • General Linear Model (GLM)
Surface-based Measures • Morphometric (eg, thickness) • Functional • PET • MEG/EEG • Diffusion (?) sampled just under the surface
Surface-based Spatial Normalization Native Space Template: fsaverage Surface Extraction Group Analysis (Design X, Contrast C) Input T1 mris_preproc mri_glmfit mri_glmfit-sim Surface-based Normalization Folding Pattern Thickness (fsaverage) Surface Smoothed Apply Normalization Thickness recon-all recon-all –qcache
y x z Coordinate Systems: 3D (Volumetric) • 3D Coordinate System • XYZ • RAS (Right-Anterior-Superior) • CRS (Column-Row-Slice) • Origin (XYZ=0, eg, AC) • MR Intensity at each XYZ
central anterior f posterior sylvian q superior temporal calcarine • Curvature • SULCUS (+) • GYRUS (-) pial inflated Coordinate Systems: 2D (Surface) • Sphere: 2D Coordinate System • Latitude and Longitude (q, f) • Continuous, no cuts • Value at each point (eg, thickness) Sheet: 2D Coordinate System (X,Y) y x
Volumetric Intersubject Registration • Affine/Linear • Translate • Rotate • Stretch • Shear • (12 DOF) • Match Intensity, Voxel-by-Voxel • Problems • Can use nonlinear volumetric (cf CVS)
Subject 1 Subject 2 Surface-based Intersubject Registration • Curvature “Intensity” • SULCUS (+) • GYRUS (-) • Codes folding pattern • Translate, Rotate, Stretch, Shear (12 DOF) • Match Curvature, Vertex-by-Vertex • Nonlinear Stretching (“Morphing”) allowed (area regularization) • Actually done on sphere • “Spherical Morph”
fsaverage: A Surface-Based Coordinate System Common space for group analysis (like Talairach) – “fsaverage” 12
Surface-based Intersubject Registration • Gray Matter-to-Gray Matter (it’s all gray matter!) • Gyrus-to-Gyrus and Sulcus-to-Sulcus • Some minor folding patterns won’t line up • Fully automated, no landmarking needed • Atlas registration is probabilistic, most variable regions get less weight. • Done automatically in recon-all
Spatial Smoothing Native Space Template: fsaverage Surface Extraction Group Analysis (Design X, Contrast C) Input T1 mris_preproc mri_glmfit mri_glmfit-sim Surface-based Normalization Folding Pattern Thickness (fsaverage) Surface Smoothed Apply Normalization Thickness recon-all recon-all –qcache
Spatial Smoothing • Why should you smooth? • Might Improve CNR • Improve intersubject registration (functional) • How much smoothing? • Blob-size • Typically 10-20 mm FWHM • Surface smoothing more forgiving than volume-based
14mm FWHM 7mm FWHM Volume-based Smoothing • Smoothing is averaging of nearby voxels
Volume-based Smoothing 14mm FWHM • 5 mm apart in 3D • 25 mm apart on surface! • Kernel much larger • Averaging with other tissue types (WM, CSF) • Averaging with other functional areas
central anterior posterior sylvian superior temporal calcarine Surface-based Smoothing • Smoothing is averaging of nearby vertices Sheet: 2D Coordinate System (X,Y) Sphere: 2D Coordinate System (q,f)
Group Analysis Group Analysis (Design X, Contrast C) Native Space Template: fsaverage Surface Extraction Input T1 Surface-based Normalization Folding Pattern Thickness (fsaverage) Surface Smoothed Apply Normalization Thickness recon-all recon-all –qcache
G1 G2 G1*Age G2*Age 1 0 20 0 1 0 25 0 1 0 30 0 0 1 0 18 0 1 0 23 0 1 0 35 . b1 b2 m1 m2 y11 y12 y13 y21 y22 y23 = GLM Theory: Design Matrix Data Design Matrix Regression Coefficients y = X*b
G1 G2 G1*Age G2*Age 1 0 20 0 1 0 25 0 1 0 30 0 0 1 0 18 0 1 0 23 0 1 0 35 . b1 b2 m1 m2 y11 y12 y13 y21 y22 y23 = GLM Theory: Contrasts CGroup = [1 -1 0 0] Group diff=0? CAge = [0 0 0.5 0.5] Mean slope=0? CGroupXAge = [0 0 +1 -1] Group/Age InterX?
Vertex-wise Analysis and Inference y = X*b+e b=(XtX)-1Xty g=C*b • p-value/significance • value between 0 and 1 • closer to 0 means more significant • FreeSurfer stores p-values as –log10(p): • sig.mgh files • Signed by sign of g • p-value is for an unsigned test + - p<.01 sig>2
Practice • X (Design Matrix) • C (Contrast Matrix or Matrices) • y (Data) • Analysis • Correction for multiple comarisons
Specifying X and C • Manually create X – text editor • Manually create C • FSGD file – text editor • FreeSurfer creates X • Manually create C • QDEC – spread sheet, etc • FreeSurfer creates X and C
FreeSurfer Group Descriptor (FSGD) File • Simple text file (ascii, clear text) • List of all subjects in the study • Accompanying demographics • Like a spreadsheet
FSGD 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 (M&F) • Three Continuous Variables: Age, Weight, IQ • $SUBJECTS_DIR/bert
Male*Age Female Group Female*Age Male Group 1 0 10 0 100 0 1000 0 1 0 15 0 150 0 1500 0 0 1 0 20 0 200 0 2000 0 1 0 25 0 250 0 2500 X = Weight IQ Age FSGD X (Automatic) { C = [-1 1 0 0 0 0 0 0] } Manual 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
Factors, 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
NRegressors Number of Regressors • Each Group/Class: • Has its own Intercept • Has its own Slope for each continuous variable • DODS = Different offset, different slope • NRegressors = NClasses*(NVariables+1) 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
Data (y): 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 • …
Assemble 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 --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 See also: recon-all -qcache
A Stack of Images lh.thickness.mgh – file with thickness maps for all subjects Input to Smoother or GLM
Surface 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-30min) • recon-all -qcache
Estimation and Inference: mri_glmfit • Reads in FSGD File and constructs X • Reads in your contrasts (C1, C2, etc) • Loads data (y=lh.thickness.sm10.mgh) • Fits GLM (ie, computes b) • Computes contrasts (g=C*b) • t or F ratios, significances • Significance -log10(p) (.01 2, .001 3)
mri_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
mri_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
mri_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
mri_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
mri_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
mri_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
Visualization with tksurfer Saturation: -log10(p), Eg, 5=.00001 Threshold: -log10(p), Eg, 2=.01 False Discovery Rate Eg, .01 View->Configure->Overlay File->LoadOverlay
Visualization with tksurfer File-> Load Group Descriptor File …
Problem of Multiple Comparisons p < 0.10 p < 0.01 p < 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)
Clusters p<.01 p<10-7 p<.10 • 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.
Cluster-forming Threshold p<.001 sig<3 p<.0001 sig<4 p<.00001 sig<5 Unthresholded As threshold lowers, clusters may expand or merge and new clusters can form. No way to say what the threshold should be.
Cluster Table, Uncorrected p<.0001 sig<4 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 Cluster4 775.38 -44.4 -9.7 51.3 precentral Cluster5 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?
Correction for Multiple Comparisons Cluster-based Monte Carlo simulation Permutation Tests False Discovery Rate (FDR) – built into tksurfer and QDEC. (Genovese, et al, NI 2002)
Cluster-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 > ClusterSize/10000 mri_glmfit-sim
Cluster Table, Corrected p<.0001 sig<4 22 clusters out of 38 have cluster p-value < .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 Cluster4 775.38 -44.4 -9.7 51.3 precentral .0100 Cluster5 440.56 -33.0 -36.8 37.5 supramarginal .0400 … Note the difference between the Cluster Forming Threshold (p<.0001) and the Cluster p-value.
50 Surface-based Corr. for Multiple Comparisons • 2D Cluster-based Correction at p < .05 mri_glmfit-sim --glmdir lh.gender_age.glmdir --cache pos 2 --cwpvalthresh .05 --2spaces