Presentation is loading. Please wait.

Presentation is loading. Please wait.

fMRI Analysis Fundamentals

Similar presentations


Presentation on theme: "fMRI Analysis Fundamentals"— Presentation transcript:

1 fMRI Analysis Fundamentals
With a focus on task-based analysis and SPM12

2 fMRI Modeling Modeling goal: explain as much variability as possible
Anything that isn’t accounted for will go into “residual error”, e — want to minimize e Smaller residuals -> greater significance

3 Analysis Options/History
Subtraction: calculate difference of “on” image minus “off”, for example [Ogawa et al. 1992] Correlation: test for similarity of time series to stimulus series General Linear Model (GLM): a generalization of the above approaches Regression type framework Matrix-based formulation of linear models Review paper: Poline & Brett 2012, “The general linear model and fMRI: does love last forever?”* *

4 GLM GLM encompasses ANOVA, ANCOVA, t-test GLM in equation form:
Y = XB + ε (after demeaning Y and usually X) Y: voxel data (column/s). X: model (“design matrix”) B: coefficients (slopes) of fit lines (“betas”) ε: residual error

5 GLM SPM’s approach is “mass univariate”: one separate equation to solve for each voxel Essentially, we are fitting a multiple regression model at each voxel: We know y and all xs, want to determine βs (and error): Example with single x: y = β1x1 + β2x2 + … + c y = βx + c + ε

6 Regression Example y = βx + c + ε this line is a 'model' of the data
β: slope of line relating x to y ‘how much of x is needed to approximate y?’ ε = residual error the best estimate of β minimises ε: deviations from line Assumed to be independently, identically and normally distributed (IID) this line is a 'model' of the data slope β = 0.23 Intercept c = 54.5 Source: “Idiot's guide to General Linear Model & fMRI”

7 Our constant term Source: “Functional MRI data analysis” (C. Pernet)

8 x (task) covariates (6) constant term (note: now .nii) Source: “Idiot's guide to General Linear Model & fMRI”

9 GLM Matrix View Y b1 b2   +  = X (voxel time series) error vector
data vector b1 b2 parameters + error vector = X design matrix Source: Rik Henson, “General Linear Model”

10 SPM12 As with preprocessing, uses Batch Editor
Can set up with our previously preprocessed motor data (mot_sp task) Or, can use this copy: /net/ms3T/sample/mot_sp/swr*

11 SPM Settings Directory: specify a new directory for results of each model Units for design: seconds is much easier! Interscan interval (TR): 2 Data & Design: select sw* files (139) We will manually enter three conditions… Left, Right, and Rest

12 mot_sp Conditions Left Right Rest Onsets: 18 60 116 158 186 242
Duration: 10 Right Onsets: Rest Onsets:

13 Data Adjustment: Global Effects
fMRI BOLD signal values are dimensionless, and vary across subjects/regions Hypothetical case: region 1 has baseline 2000, changed signal of 2050 (+50) region 2 has baseline 800, changed signal of 840 (+40) Is it better to compare signal change? (50 > 40) Or is proportional value better? (2.5% < 5%)

14 Global Effects In PET, absolute change is meaningful — and early fMRI work used PET methods In fMRI, proportion of change believed to be more relevant Note: other possibilities could be considered, e.g. z-transformation

15 Global Effects SPM terms:
Global scaling: adjust each volume (TR) to have same mean (PET holdover, not recommended) Grand mean scaling: scale so “grand mean” has a particular value (100); automatic in SPM “grand mean” (g): across all voxels and timepoints Grand mean scaling amounts to multiplying all voxels in a session by 100/g

16 Why Not Global Scaling? Problem: true global is unknown, and volume mean may be unreliable proxy Large signal changes over some area can confound global with local changes Possible consequence: artifactual deactivations after global scaling Other ways to account for volume-to-volume drift (high-pass filtering)

17 fMRI Noise Scanner signal commonly “drifts” slowly over time
Physiological fluctuations (heartbeat, breathing) add other noise Goal: find and remove any structured noise Convenient to use frequency domain, especially for periodic changes “Linear” drift approximated by “1/f” noise (long period)

18 Frequency Domain Source: Handbook of Functional MRI Data Analysis
Source: Human Brain Function ch. “Issues in Functional Magnetic Resonance Imaging”

19 Removing Noise Nyquist Theorem: if sample rate is insufficient, samples can appear to have a lower frequency Example: are blue dots from blue or red curve? Without a higher sample rate, red is undersampled: we attribute to blue what might be from red aliasing

20 Noise Sources What about physiological noise sources?
1 Hertz = 1 cycle per second fMRI sampling rate ≈ 0.5 Hz (~ = TR ) Nyquist limit: frequencies > ½ sample rate are aliased (appear partially at other frequencies) Heart rate ≈ 1 Hz: no way Breathing rate ≈ Hz: no?

21 Filtering Noise Just zap all frequencies below Nyquist limit?
No: the task is a legitimate source of periodic variation, too… 30s alternating blocks = 1/60 Hz frequency “High-pass filter”: pass (leave intact) signal at frequency greater than some x (and remove slower variations) x = 1/128 Hz in SPM (based on typical data) You can test your own data!

22 Power Spectral Density
Using ART tool Note: only task, not signal, here HPF 1/128)

23 Implementation of HPF High-pass filtering options:
Directly filter the data (fit a model, subtract low frequency trends): FSL Use covariates for various frequencies: SPM Source: Mumford, “First-level Statistics”, UCLA NITP 2008

24 Collinearity In regression, correlated regressors can’t be uniquely solved for, so interpretability suffers Individually, regressors may have no significant impact Overall, a model may nonetheless have low error Not a big deal if “nuisance covariates” (such as for HPF) are correlated A problem if you want to assess individual covariates

25 Example: Task-correlated Motion
Incidental: e.g., subject nods when responding “yes” Design related: e.g., if task is “press a button to get a reward when you spot a target” When looking for “reward processing” areas, you will get motor areas as well Need a more careful design to distinguish motor and reward activations here

26 Noise & Modeling “white noise” “colored noise”
AKA, in SPM-speak, “sphericity” all frequencies equally represented No problem for least-squared estimation “colored noise” AKA “non-sphericity” has structure; problems for least-squares estimation highpass filtering helps (for low frequency noise) “whitening”: alter the covariance matrix toward white noise

27 Autocorrelation and Whitening
Autocorrelation: in general, cross-correlation of a signal with itself (under various lags) In fMRI, successive timepoints are correlated Can whiten using an autoregressive (AR) model AR(1): previous timepoint (+ noise) contributes to value of current timepoint AR(2): previous 2 timepoints (etc.) SPM99: AR(1) with a fixed weight (correlation) of 0.2 Later SPMs: AR(1), correlation estimated in first pass SPM lingo: "hyperparameter estimation” This is why appearance of design matrix in SPM changes after model estimation

28 Modeling HRF (Redux) Recall: signal comes from the BOLD effect, and is assumed to track neural activity Knowing/assuming an HRF shape, we can predict BOLD response to stimuli Lindquist et al. 2009

29 HRF Options In SPM, multiple basis functions:
canonical HRF canonical HRF with derivatives Finite Impulse Response (FIR) Fourier Gamma The default choice is canonical HRF, and we’ll focus on that

30 SPM Canonical HRF Difference of Gammas Gamma Distribution (Wikipedia)

31 SPM’s HRF Code (spm_hrf.m)
% returns a hemodynamic response function % FORMAT [hrf,p] = spm_hrf(RT,[p]); % RT - scan repeat time % p - parameters of the response function (two gamma functions) % % defaults % (seconds) % p(1) - delay of response (relative to onset) % p(2) - delay of undershoot (relative to onset) % p(3) - dispersion of response % p(4) - dispersion of undershoot % p(5) - ratio of response to undershoot % p(6) - onset (seconds) % p(7) - length of kernel (seconds) % hrf - hemodynamic response function

32 % Copyright (C) 1996-2014 Wellcome Trust Centre for Neuroimaging
% Karl Friston % $Id: spm_hrf.m :24:06Z guillaume $ %-Parameters of the response function % p = [ ]; if nargin > 1 p(1:length(P)) = P; end %-Microtime resolution if nargin > 2 fMRI_T = T; else fMRI_T = spm_get_defaults('stats.fmri.t'); %-Modelled hemodynamic response function - {mixture of Gammas} dt = RT/fMRI_T; u = [0:ceil(p(7)/dt)] - p(6)/dt; hrf = spm_Gpdf(u,p(1)/p(3),dt/p(3)) - spm_Gpdf(u,p(2)/p(4),dt/p(4))/p(5); hrf = hrf([0:floor(p(7)/RT)]*fMRI_T + 1); hrf = hrf'/sum(hrf); That’s it!

33 SPM Canonical HRF Note: TR units! (TR = 2)
>> hrf = spm_hrf(2) hrf = >> plot(hrf) Note: TR units! (TR = 2)

34 Derivatives Basis functions can be added together to explain fMRI time series SPM offers to expand the canonical HRF basis set with two additions: Time derivative Dispersion derivative (you can choose “none”, “time only”, or “time + dispersion”)

35 SPM Time Derivative Idea: shift the HRF earlier or later
This is implemented by a “+” bulge before the HRF peak and a “–” bulge after (this shifts the HRF earlier; to shift later, can assign a negative weight) stimulus

36 SPM Dispersion Derivative
Idea: make the HRF wider or narrower Implemented using two “–” bulges around the peak (and “+” in the center to compensate) (this narrows the HRF; to widen, can assign a negative weight)

37 SPM Derivatives The time derivative counters misalignment of HRF onset (subject/region has faster or slower HRF, or slice timing effects) The dispersion derivative counters shorter/longer HRFs However, note that “counter” here really means “model small deviations as a nuisance covariate”…

38 Time Derivative Advantages
Lindquist et al. 2009: Even minor misspecification of the HRF can increase Type I error (bias and loss of power) Derivative very accurate for small shifts (< 1 s), progressively worse as shift increases Calhoun et al. 2004: TD reduces error variance in first level models Pernet 2014: Using TD improved model R2

39 Time Derivative Concerns
Della-Maggiore et al. 2002, Calhoun et al. 2004: Not so helpful for second level (group) analysis: random effects models ignore first level variance “Amplitude bias”: if HRF delay varies, different voxels experience different “adjusted” HRF amplitudes (for >1s shifts especially) Pernet 2014: Presence of derivative changes parameter estimates for canonical HRF terms, sometimes drastically

40 Phew… Now we can estimate the model we set up
This will generate certain output files, including images for each beta

41 Contrasts Once we have solved a GLM model, we have “betas” for variables (e.g., conditions) SPM uses marginal (Type IV) sum-of-squares: each term is estimated after accounting for all others Or, put another way, condition order doesn’t matter Motor task model: Left, right, rest conditions Can test for individual effects (e.g. Left > 0) Can test for differences (E.g. Left > Right)

42 Task Design Considerations
How the task is organized has many implications for signal (and modeling) Ultimately, everything should be guided by the experimental question (see Task Design talk) Main options: Blocked design: compare blocks of time Event-related design: aggregate responses to individual stimuli

43 Blocked vs. Event-Related Designs
Because of HRF summation, blocks have high signal but low separability Can potentially separate stimulus responses (event related design) D’Esposito 2000, Seminars in Neurology

44 Event-Related vs. Block Designs
Block-design experiments (left) are characterized by blocks in which stimuli pertain to one single experimental condition because the response of the brain is cumulated over the entire block. Activated voxels correspond to those parts of the image volume in which signal variation follow a pattern consistent with the theoretical signal generated from block alternation. Comparison of effect sizes (level of activation in each condition found in a sample of participants, bottom left) then allows drawing of statistical inferences. Event-related designs (right) allow the mixing of different experimental conditions, since the hemodynamic response is classically sampled entirely after each stimulus. In addition to statistical evaluation of differences across experimental conditions, this method gives access to the time course of event-related hemodynamic responses (bottom right). Démonet et al. 2005, Physiological Reviews

45 Simple, “Slow” ER Design
Predictable, inefficient use of time Source: Andysbrainblog

46 “Rapid” Event-Related Design
Fixed interval! Fixed ISI and fixed order of presentation lead to problems disentangling. Source: Andysbrainblog

47 Randomized/Jittered Design
Variable interval Fixed ISI and fixed order of presentation lead to problems disentangling. Source: Andysbrainblog

48 Power Spectrum View Periodic stimuli: power mainly at one freq.
Random stimuli: power spread out Can think of the HRF “filtering” frequencies too; only “slow” events end up having power Source: The Clever Machine blog


Download ppt "fMRI Analysis Fundamentals"

Similar presentations


Ads by Google