GLM for fMRI. Emily Falk, Ph.D. University of Pennsylvania Thanks to Thad Polk and Elliot Berkman. Review of preprocessing. (Denoise). Realign. Slice Timing Correct. Smooth. Predictors. Acquire Functionals. Y. X. y = X β + ε. Template. 1 st level (Subject) GLM.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
GLM for fMRI
Emily Falk, Ph.D.
University of Pennsylvania
Thanks to Thad Polk and Elliot Berkman
Review of preprocessing
(Denoise)
Realign
Slice Timing Correct
Smooth
Predictors
AcquireFunctionals
Y
X
y = Xβ + ε
Template
1st level (Subject) GLM
Determine Scanning Parameters
β
CoRegister
βhow  βwhy
Normalize
Acquire Structurals (T1)
Contrast
All subjects
2nd level (Group)
GLM
Threshold
Determine Scanning Parameters
Temporal Resolution
SignalNoise Ratio (SNR)




Coverage/ Field of View
Spatial Resolution

(Denoise)
Slice Timing Correct
Acquire Functionals
Determine Scanning Parameters
Acquire Structurals (T1)
Slice 4
Slice
Slice 3
Slice 2
Slice 1
TR #1
TR #2
TR #3
TR #4
Time
(Denoise)
Realign
Slice Timing Correct
Acquire Functionals
Determine Scanning Parameters
Acquire Structurals (T1)
Minimize sum of squared diff
reslice
(Denoise)
Realign
Slice Timing Correct
AcquireFunctionals
Template
Determine Scanning Parameters
CoRegister
Normalize
Acquire Structurals (T1)
Can’t use minimized squared difference on different image types (different tissue > signal intensity mapping)
Instead use mutual information (maximize)
reference
moved image
12 parameter affine transformation
Trans x Pitch x Roll x Yawx Zoom x Sheer
Sheer
Zoom
Even better with segmentation!
(Denoise)
Realign
Slice Timing Correct
Smooth
Predictors
AcquireFunctionals
Y
X
Template
Determine Scanning Parameters
CoRegister
Normalize
Acquire Structurals (T1)
How
Why
X
=
Events
Basis Function
Predictors (X)
(Denoise)
Realign
Slice Timing Correct
Smooth
Predictors
AcquireFunctionals
Y
X
y = Xβ + ε
Template
1st level (Subject) GLM
Determine Scanning Parameters
β
CoRegister
βhow  βwhy
Normalize
Acquire Structurals (T1)
Contrast
All subjects
2nd level (Group)
GLM
Threshold
(Denoise)
Realign
Slice Timing Correct
Smooth
Predictors
AcquireFunctionals
Y
X
y = Xβ + ε
Template
1st level (Subject) GLM
Determine Scanning Parameters
β
CoRegister
βhow  βwhy
Normalize
Acquire Structurals (T1)
Contrast
All subjects
2nd level (Group)
GLM
Threshold
Null hypothesis vs. alternative hypothesis; Testing hypotheses about population based on a sample; Sampling distributions & Central Limit Theorem; tstatistic, tdistribution, ttests, pvalues; Interpreting results, Type I error, Type II error; Onetailed vs. twotailed tests; Multiple comparisons
Regression, multiple regression, model fitting, matrix notation, design matrix, example, issues
Build design matrix, fit model to get betas, contrasts, statistical parametric maps, threshold for significance (correcting for multiple comparisons)
In fMRI, we experimentally manipulate various independent variables (e.g., task, stimulus) while scanning
We are interested in constructing a model of the predicted brain activity that can be used to explain the observed fMRI data in terms of the independent variables.
In fitting the model to the data, we obtain parameter estimates and make inferences about their consistency with the null hypothesis.
The General linear model (GLM) approach treats the data as a linear combination of predictor variables plus noise (error).
The predictors are assumed to have known shapes, but their amplitudes are unknown and need to be estimated.
The GLM framework encompasses many of the commonly used techniques in fMRI data analysis (and data analysis more generally).
DV
Predictors
Analysis
Regression
Continuous
One predictor
Multiple Regression
Continuous
Two+ preds
One continuous
2sample ttest
Categorical
1 pred., 2 levels
General Linear Model
Oneway ANOVA
Categorical
1 p., 3+ levels
Factorial ANOVA
Categorical
2+ predictors
Two measures, one factor
Paired ttest
Repeated measures
More than two measures
Repeated measures ANOVA
Blushing
(blood flow to cheeks)
Attractiveness
Outcome
(DV)
Intercept
(constant)
Error (residual)
Predictor value
slope
For point i:
Blushing
(blood flow to cheeks)
Attractiveness
DV
Pred1
Pred2
Predk
Variables
Parameters
Slope 1
Slope k
intercept
Slope 2
Error
Matrix notation
as
Design matrix
Residuals
Observed Data
Model parameters
Design matrix
Residuals
Observed Data
Model parameters
Is this same as
In fMRI the design matrix specifies how the factors of the model change over time.
The design matrix is an np matrix where n is the number of observations over time and p is the number of model parameters
Females
Males
Outcome Data
Design matrix
Model parameters
Residuals
=
+
X
Null hypothesis vs. alternative hypothesis; Testing hypotheses about population based on a sample; Sampling distributions & Central Limit Theorem; tstatistic, tdistribution, ttests, pvalues; Interpreting results, Type I error, Type II error; Onetailed vs. twotailed tests; Multiple comparisons
Regression, multiple regression, model fitting, matrix notation, design matrix, example, issues
QUESTIONS?
Null hypothesis vs. alternative hypothesis; Testing hypotheses about population based on a sample; Sampling distributions & Central Limit Theorem; tstatistic, tdistribution, ttests, pvalues; Interpreting results, Type I error, Type II error; Onetailed vs. twotailed tests; Multiple comparisons
Regression, multiple regression, model fitting, matrix notation, design matrix, example, issues
Model specification, parameter estimation, contrasts, statistical parametric maps, threshold for significance (correcting for multiple comparisons)
On
X1
Off
On
X2
Off
Time
β2
β2
β1
β1
β2
β2
β1
β1
β2
β2
β1
β2
β1
β1
β2
β1
β2
β2
β1
β2
β2
β1
β1
β1
β2
β1
β2
β2
β1
β2
β2
β1
β1
β1
β2
β2
β1
β1
β2
β1
β1
β2
β1
β2
β2
β1

X
y
e
+
=
contrast ofestimatedparameters
T =
varianceestimate
Question:
Difference between seeing loved one and random face > 0 ?
=
b1 – b2 = cTb> 0 ?
cT = 1 1 0 0 0 0 0 0
b1b2b3b4b5 ...
H0: cTb=0
Null hypothesis:
Test statistic:
1
10
20
30
40
50
60
70
80
0.5
1
1.5
2
2.5
Design matrix
Whyversus rest
Q: activationduringattribution?
cT = [ 1 0 ]
Null hypothesis: 1=0
More specifically…
Model
specification
Parameter
estimation
Hypothesis
Statistic
Time
Time
BOLD signal
single voxel
time series
SPM
amplitude
time
Source: JB. Poline
Temporal series fMRI
voxel time course
fMRI Data
Design matrix
Residuals
Model
parameters
=
+
X
Predicted task
response
intercept
Find values that produce
best fit to observed data
y
=
0
+
1
+
ERROR
y
X
e
+
=
What SPM Computes
spmT_???? image
SPM{t}
beta_???? images
con_???? image
contrast ofestimatedparameters
T =
varianceestimate
boxcar amplitude > 0 ?
=
b1 = cTb> 0 ?
Question:
cT = 1 0 0 0 0 0 0 0
H0: cTb=0
b1b2b3b4b5 ...
Null hypothesis:
Test statistic:
fMRI Data
Design matrix
Residuals
Model
parameters
=
+
X
Predicted task
response
intercept
y
X
e
+
=
contrast ofestimatedparameters
T =
varianceestimate
boxcar amplitude > 0 ?
=
b1 = cTb> 0 ?
Question:
cT = 1 1 0 0 0 0 0 0
H0: cTb=0
b1b2b3b4b5 ...
Null hypothesis:
Test statistic:
1
10
20
30
40
50
60
70
80
0.5
1
1.5
2
2.5
Design matrix
Why vs. How
Q: Greateractivationduringwhythanhow?
cT = [ 1 1 ]
Null hypothesis: 12=0
Whathappens in thebrainduringattribution?
A
C
B
D
Design Matrix (X)
B
C
D
A
Covariates
fit
apply C
Time
Courtesy of Tor Wager
Design Matrix (X)
C’b is effect magnitude estimate for (A + B) – (C + D), equivalent to mean(A,B)  mean(C,D) or WHY> HOW
B
C
D
A
1
1
Time
C’b is beta for A only, or WHY_faces > rest
C’b is sum (average) beta for A and B, or WHY > rest
Questions?
Put participant in scanner
Localizer
Functional Run 1
Block 1
Trial 1
Trial 2
…
Trial n
Block 2
…
Block n
Functional Run 2
…
Functional Run n
Structural
Take participant out of scanner
Block
Run
Session
Run 1
Predictors of interest
Intercept
Predictors of interest
Run 2
Intercept
Input: 0 0 1
Input: 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1
Questions?
Parametric modulation
What if you want to model a continuous variable?
e.g., making mental state attributions for people rated more or less similar to the participant
Goal (purchase) value of an item
Courtesy of Tor Wager
Parametric Psychological Events
Principle Predictor: Captures Average Response
Parametric Modulator: Captures Modulations
Idealized Data
Fitted Response
Courtesy of Tor Wager
Average response
Parametric
modulator
(parametric modulator framework)
Visual cortex: Contrastmodulation (red) vs. durationmodulation (blue)
Grinband et al., 2008
y
X
e
+
=
AA*pm
Contrast: 10= main effect of condition A
Contrast: 01= effect of pm
Covariates/ Nuisances
Frequency domain
fMRI Noise: Time domain
Unfiltered
Lot’s of low frequency power!
blue= data
black = mean + lowfrequency drift
green= predicted response, taking into account lowfrequency drift
red= predicted response, not taking into account lowfrequency drift
Highpass filter:
High frequency elements are allowed to pass
Default in SPM is 128
In SPM, filter is applied to both data and design
60 s
HP filter
1/60 =
.016 Hz
Frequency domain
fMRI Noise: Time domain
Unfiltered
Filtered
Courtesy of Tor Wager
Predictor
Filtered frequencies
Power
r = 1
Lag 0
r = 0.6
Lag 1
r = 0.3
Lag 2
r = 0.1
Lag 3
Autocorrelation function
Autocorrelated
Errors
Random errors
“Model serial correlations: none”
“Model serial correlations: AR(1)”
Courtesy of Tor Wager
Signal Spikes
Motion
Power et al., 2012, NeuroImage
Additional notes
Checkerboard, n = 10
Thermal pain, n = 23
Stimulus On
Aversive picture, n = 30
Aversive anticipation
Courtesy of Tor Wager
See Aguirre et al. 1998, NeuroImage
Canonical only
Canonical + derivs
2nd derivative of the HRF is the “dispersion” derivative: captures narrower or wider responses than expected
1st derivative of the HRF is the “temporal” derivative: captures peaks that occur earlier or later than expected
Note, including derivative, but basing tests only on the nonderiv does not help!
Adding derivative can account for delay
Calhoun et al., 2004, NeuroImage
Calhoun et al., 2004, NeuroImage
Null hypothesis vs. alternative hypothesis; Testing hypotheses about population based on a sample; Sampling distributions & Central Limit Theorem; tstatistic, tdistribution, ttests, pvalues; Interpreting results, Type I error, Type II error; Onetailed vs. twotailed tests; Multiple comparisons
Regression, multiple regression, model fitting, matrix notation, design matrix, example, issues
Model specification, parameter estimation, contrasts, statistical parametric maps, threshold for significance (correcting for multiple comparisons)
QUESTIONS?