fMRI Analysis Fundamentals

Slides:



Advertisements
Similar presentations
The SPM MfD course 12th Dec 2007 Elvina Chu
Advertisements

Basis Functions. What’s a basis ? Can be used to describe any point in space. e.g. the common Euclidian basis (x, y, z) forms a basis according to which.
General Linear Model L ύ cia Garrido and Marieke Schölvinck ICN.
General Linear Model Beatriz Calvo Davina Bristow.
2nd level analysis – design matrix, contrasts and inference
1st level analysis - Design matrix, contrasts & inference
1 st Level Analysis: design matrix, contrasts, GLM Clare Palmer & Misun Kim Methods for Dummies
SPM 2002 C1C2C3 X =  C1 C2 Xb L C1 L C2  C1 C2 Xb L C1  L C2 Y Xb e Space of X C1 C2 Xb Space X C1 C2 C1  C3 P C1C2  Xb Xb Space of X C1 C2 C1 
Outline What is ‘1st level analysis’? The Design matrix
The General Linear Model Or, What the Hell’s Going on During Estimation?
1 Temporal Processing Chris Rorden Temporal Processing can reduce error in our model –Slice Time Correction –Temporal Autocorrelation –High and low pass.
1 Temporal Processing Chris Rorden Temporal Processing can reduce error in our model –Slice Time Correction –Temporal Autocorrelation –High and low pass.
Efficiency in Experimental Design Catherine Jones MfD2004.
The General Linear Model (GLM) Methods & models for fMRI data analysis in neuroeconomics November 2010 Klaas Enno Stephan Laboratory for Social & Neural.
The General Linear Model (GLM)
The General Linear Model (GLM) SPM Course 2010 University of Zurich, February 2010 Klaas Enno Stephan Laboratory for Social & Neural Systems Research.
Group analyses of fMRI data Methods & models for fMRI data analysis 26 November 2008 Klaas Enno Stephan Laboratory for Social and Neural Systems Research.
1st level analysis: basis functions and correlated regressors
Parametric modulation, temporal basis functions and correlated regressors Mkael Symmonds Antoinette Nicolle Methods for Dummies 21 st January 2008.
Lorelei Howard and Nick Wright MfD 2008
I NTRODUCTION The use of rapid event related designs is becoming more widespread in fMRI research. The most common method of modeling these events is by.
General Linear Model & Classical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM M/EEGCourse London, May.
The General Linear Model
With many thanks for slides & images to: FIL Methods group, Virginia Flanagin and Klaas Enno Stephan Dr. Frederike Petzschner Translational Neuromodeling.
Contrasts (a revision of t and F contrasts by a very dummyish Martha) & Basis Functions (by a much less dummyish Iroise!)
With a focus on task-based analysis and SPM12
SPM5 Tutorial Part 2 Tiffany Elliott May 10, 2007.
SPM Course Zurich, February 2015 Group Analyses Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London With many thanks to.
FMRI Methods Lecture7 – Review: analyses & statistics.
SPM short course – Oct Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France.
Wellcome Dept. of Imaging Neuroscience University College London
The General Linear Model (for dummies…) Carmen Tur and Ashwani Jha 2009.
Temporal Basis Functions Melanie Boly Methods for Dummies 27 Jan 2010.
1 Time Series Analysis of fMRI II: Noise, Inference, and Model Error Douglas N. Greve
Event-related fMRI SPM course May 2015 Helen Barron Wellcome Trust Centre for Neuroimaging 12 Queen Square.
Statistical Analysis An Introduction to MRI Physics and Analysis Michael Jay Schillaci, PhD Monday, April 7 th, 2007.
FMRI Modelling & Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course Chicago, Oct.
Idiot's guide to... General Linear Model & fMRI Elliot Freeman, ICN. fMRI model, Linear Time Series, Design Matrices, Parameter estimation,
The General Linear Model
The General Linear Model Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM fMRI Course London, May 2012.
SPM short – Mai 2008 Linear Models and Contrasts Stefan Kiebel Wellcome Trust Centre for Neuroimaging.
The general linear model and Statistical Parametric Mapping I: Introduction to the GLM Alexa Morcom and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B.
SPM and (e)fMRI Christopher Benjamin. SPM Today: basics from eFMRI perspective. 1.Pre-processing 2.Modeling: Specification & general linear model 3.Inference:
The general linear model and Statistical Parametric Mapping II: GLM for fMRI Alexa Morcom and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B Poline.
Group Analysis Individual Subject Analysis Pre-Processing Post-Processing FMRI Analysis Experiment Design Scanning.
The General Linear Model Christophe Phillips SPM Short Course London, May 2013.
The General Linear Model Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM fMRI Course London, October 2012.
SPM short course – Mai 2008 Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France.
The General Linear Model (GLM)
Group Analyses Guillaume Flandin SPM Course London, October 2016
The General Linear Model (GLM)
Contrast and Inferences
The general linear model and Statistical Parametric Mapping
The General Linear Model
2nd Level Analysis Methods for Dummies 2010/11 - 2nd Feb 2011
Design Matrix, General Linear Modelling, Contrasts and Inference
The General Linear Model (GLM): the marriage between linear systems and stats FFA.
and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B Poline
The SPM MfD course 12th Dec 2007 Elvina Chu
The General Linear Model (GLM)
The General Linear Model
The general linear model and Statistical Parametric Mapping
The General Linear Model
The General Linear Model (GLM)
Chapter 3 General Linear Model
MfD 04/12/18 Alice Accorroni – Elena Amoruso
The General Linear Model
The General Linear Model (GLM)
The General Linear Model
The General Linear Model
Presentation transcript:

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

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

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?”* * http://www.ncbi.nlm.nih.gov/pubmed/22343127

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

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 + ε

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”

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

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

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”

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*

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

mot_sp Conditions Left Right Rest Onsets: 18 60 116 158 186 242 Duration: 10 Right Onsets: 32 74 102 144 200 228 Rest Onsets: 46 88 130 172 214 256

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%)

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

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

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)

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)

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

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

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

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!

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

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

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

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

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

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

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

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

SPM Canonical HRF Difference of Gammas Gamma Distribution (Wikipedia)

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) 6 % p(2) - delay of undershoot (relative to onset) 16 % p(3) - dispersion of response 1 % p(4) - dispersion of undershoot 1 % p(5) - ratio of response to undershoot 6 % p(6) - onset (seconds) 0 % p(7) - length of kernel (seconds) 32 % hrf - hemodynamic response function

% Copyright (C) 1996-2014 Wellcome Trust Centre for Neuroimaging % Karl Friston % $Id: spm_hrf.m 6108 2014-07-16 15:24:06Z guillaume $ %-Parameters of the response function %-------------------------------------------------------------------------- p = [6 16 1 1 6 0 32]; 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!

SPM Canonical HRF Note: TR units! (TR = 2) >> hrf = spm_hrf(2) hrf = 0 0.0866 0.3749 0.3849 0.2161 0.0769 0.0016 -0.0306 -0.0373 -0.0308 -0.0205 -0.0116 -0.0058 -0.0026 -0.0011 -0.0004 -0.0001 >> plot(hrf) Note: TR units! (TR = 2)

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”)

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

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)

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”…

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

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

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

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)

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

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

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

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

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

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

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