First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced...

57
First-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008

Transcript of First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced...

Page 1: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

First-level fMRI modeling

UCLA Advanced NeuroImagingSummer School, 2008

Page 2: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Recall the GLM

Single voxel timeseries

Page 3: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

How to make a good model

• Explain as much variability in the dataas possible– If you miss something it will go into the

residual error, e

Big residuals ⇒Big variance⇒Small t stat

Page 4: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Understanding the data

• Time series drifts down in beginning• BOLD response is delayed

Page 5: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Simplest Model

=

Page 6: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Simplest Model

=

Page 7: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Simplest Model

Page 8: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Simplest Model

Page 9: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Modeling the delay

• Hemodynamic response function– Real data was used to find good models for

the hemodynamic response

Stimulus

HRF

(double gamma)

Page 10: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Using the HRF

• Convolve the HRF with stimulusfunction

Page 11: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Using the HRF

• Convolve the HRF with stimulusfunction

Typically model derivative of convolved HRF to adjustfor small differences in onset (<1s)

Page 12: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Notes on the HRF

• The good of the canonical hrf– Easy to model– Easy to interpret– Easy to do group analysis

• The bad– If it is wrong your results can be biased

• Stay tuned for Martin Lindquist’s talk onMonday

Page 13: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Convolved Boxcar

Page 14: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Convolved Boxcar

Page 15: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

The Noise

• White noise– All frequencies have similar power– Not a problem for OLS

Page 16: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

More Noise• Colored noise

– Has structure– OLS needs help!

Page 17: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Highpass filtering

• Simply hack off the low frequency noise– SPM: Adds a discrete cosine transform

basis set to design matrix

Page 18: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Highpass filtering• FSL: Gaussian-weighted running line

smoother– Step 1: Fit a Gaussian weighted running

line

Page 19: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Highpass filtering• FSL: Gaussian-weighted running line

smoother– Step 1: Fit a Gaussian weighted running

line

Fit at time t is a weightedaverage of data around t

Page 20: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Highpass filtering

– Step 2: Subtract Gaussian weightedrunning line fit to smooth

– IMPORTANT: Must apply filter to both thedata and the design.

• FSL has ‘apply temporal filter’ box in designsetup. Leave it checked!

Page 21: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Highpass filtered design (FSL)

If it wasn’tfiltered, thistrend wouldn’t behere.

Page 22: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Highpass filtering

Filter below .01 Hz

Page 23: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Filter cutoff

• High, but not higher than paradigmfrequency– Look at power spectrum of your design and

base cutoff on that– Block design: Longer than 1 task

cycle…usually twice the task cycle– Event related design: Larger than 66 s

(based on the power spectrum of acanonical HRF of a single response)

Page 24: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Model with HP filter

=

Parameter ofinterest

Page 25: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Model with HP filter

=

Parameter ofinterest

Use contrast

c=(1 0 0 0 0 0 0 0 )

Page 26: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Convolution & HP filter

Page 27: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Correlation

• Gauss Markov: If the error has mean 0,with constant variance and uncorrelatedthe least squares estimators areunbiased and have minimum varianceamong all unbiased linear estimates

Page 28: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening

• If V is known– Due to the structure of correlation matrix

there exits such that

Page 29: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening

• If V is known– Due to the structure of correlation matrix

there exits such that– Whitened model

••

Page 30: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening

• OLS can be used on whitened model–

• But we don’t know V, we have toestimate it

Page 31: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

fMRI noise

• Tends to follow 1/ftrend

Zarahn et al, 1997, NI

Page 32: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

fMRI noise

• Tends to follow 1/ftrend

• Autoregressive (AR)models fit it well–

Page 33: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening FSL

• Estimates V locally• Step 1: Estimate raw autocorrelations

Page 34: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening FSL

• Estimates V locally• Step 1: Estimate raw autocorrelations

Lag 1

[e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12]

[e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12]

Take products and average

Page 35: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening FSL

• Estimates V locally• Step 1: Estimate raw autocorrelations

Lag 2

[e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12]

[e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12]

Take products and average

Page 36: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening FSL

• Estimates V locally• Step 1: Estimate raw autocorrelations

Lag 7

[e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12][e1 e2 e3 e4 e5 e6 e7…]

Take products and average

Page 37: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening FSL

• Estimates V locally• Step 1: Estimate raw autocorrelations• Step 2: Smooth spatially• Step 3: Within voxel, smooth

correlation estimates (Tukey taper)– Correlation estimates at high lags aren’t

estimated well, so they are down-weighted

Page 38: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening FSL

Woolrich et al., 2001, NI

Time Domain Spectral Domain

Raw estimate

Page 39: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening FSL

Woolrich et al., 2001, NI

Time Domain Spectral Domain

Smoothed estimate

Page 40: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening SPM

• Globally estimates correlation– Correlation of time series averaged over

voxels• Structured correlation estimate

– Scaled AR(1) with correlation 0.2 pluswhite noise

Page 41: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Whitening SPM

Only 2 parameters are estimated

Page 42: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Convolution, HP filter, Whitening

Page 43: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to
Page 44: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Coloring• Add your own correlation

– Lowpass filter– Not good for designs with high frequency

Time domain Frequency domain Frequency domain

Lowpass filter

Frequency domain

Highpass filter

Page 45: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Coloring

• Bias/Variance tradeoff– Coloring has less bias but higher variance

than whitening (less sensitive)– Bias corrected whitening is almost always

used now• Bandpass filtering

– High and lowpass filtering

Page 46: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Scaling

• Grand mean scaling– All time series are scaled by the same factor to

have approximately the same mean (FSL uses1002)

– Necessary when combining subjects• Intensity normalization

– Forces each volume to have the same meanintensity

– Discouraged since you can lose signal– Turned off by default in FSL

Page 47: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Intensity Normalizaton

without

with

Signal is lost and negative activation artifacts

Junghofer et al, 2004, NI

Page 48: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Collinearity

• When designing your study, you wantyour tasks to be uncorrelated

• Correlation between regressors lowersthe efficiency of the parameterestimation

• Parameter estimates are highly variable– Can even flip signs

Page 49: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Why is it a problem?

Page 50: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Why is it a problem?

• There are an infinite # of solutions forand

…etc

Page 51: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Collinearity illustration

X1

X2

Cor=0.96

X1

X2

Cor= -0.2

Page 52: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Correlated RegressorsIntercept X1 X2

Highly variableoverexperiments

Inflated forcorrelatedcase (green)

T statistic

Bias can go ineither direction

Page 53: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Correlated RegressorsIntercept X1 X2

Highly variableoverexperiments

Inflated forcorrelatedcase (green)

T statistic

Bias can go ineither direction

Page 54: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Correlated RegressorsIntercept X1 X2

Highly variableoverexperiments

Inflated forcorrelatedcase (green)

T statistic

Bias can go ineither direction

Page 55: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Residuals don’t change

• The designs explain the same amountof variability

Page 56: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Collinearity• You can’t fix it after the data have been

collected• You can’t tell from the t statistic if you

had collinearity– FSL has some diagnostics

Absolutevalue ofcorrelation

Bad=whiteoff diagonal

Eigenvaluesfrom SVD

Bad=near 0

Page 57: First-level fMRI modeling - UCLAmumford.bol.ucla.edu/lev1.pdfFirst-level fMRI modeling UCLA Advanced NeuroImaging Summer School, 2008 Recall the GLM Single voxel time series How to

Have fun in lab!