Preprocessing In SPM Yingying Wang 7/15/2014 Tuesday

Slides:



Advertisements
Similar presentations
MRI vs. fMRI Functional MRI (fMRI) studies brain function.
Advertisements

FIL SPM Course 2010 Spatial Preprocessing
A Growing Trend Larger and more complex models are being produced to explain brain imaging data. Bigger and better computers allow more powerful models.
SPM5 Segmentation. A Growing Trend Larger and more complex models are being produced to explain brain imaging data. Bigger and better computers allow.
Unwarping.
Image Registration John Ashburner
Image Registration Carlton CHU
VBM Voxel-based morphometry
Realignment – Motion Correction (gif from FMRIB at Oxford)
Concepts of SPM data analysis Marieke Schölvinck.
Computational Neuroanatomy John Ashburner SmoothingSmoothing Motion CorrectionMotion Correction Between Modality Co-registrationBetween.
Gordon Wright & Marie de Guzman 15 December 2010 Co-registration & Spatial Normalisation.
Introduction to Functional and Anatomical Brain MRI Research Dr. Henk Cremers Dr. Sarah Keedy 1.
Basics of fMRI Preprocessing Douglas N. Greve
OverviewOverview Motion correction Smoothing kernel Spatial normalisation Standard template fMRI time-series Statistical Parametric Map General Linear.
Coregistration and Normalisation By Lieke de Boer & Julie Guerin.
Preprocessing: Coregistration and Spatial Normalisation Cassy Fiford and Demis Kia Methods for Dummies 2014 With thanks to Gabriel Ziegler.
Spatial Preprocessing
Realigning and Unwarping MfD
Realigning and Unwarping MfD
JOAQUÍN NAVAJAS SARAH BUCK 2014 fMRI data pre-processing Methods for Dummies Realigning and unwarping.
Multiple testing Justin Chumbley Laboratory for Social and Neural Systems Research Institute for Empirical Research in Economics University of Zurich With.
Zurich SPM Course 2011 Spatial Preprocessing Ged Ridgway With thanks to John Ashburner and the FIL Methods Group.
Multiple testing Justin Chumbley Laboratory for Social and Neural Systems Research Institute for Empirical Research in Economics University of Zurich With.
Spatial preprocessing of fMRI data Methods & models for fMRI data analysis 25 February 2009 Klaas Enno Stephan Laboratory for Social and Neural Systrems.
Spatial preprocessing of fMRI data
Multiple comparison correction Methods & models for fMRI data analysis 29 October 2008 Klaas Enno Stephan Branco Weiss Laboratory (BWL) Institute for Empirical.
SPM+fMRI. K space K Space Mechanism of BOLD Functional MRI Brain activity Oxygen consumptionCerebral blood flow Oxyhemoglobin Deoxyhemoglobin Magnetic.
Preprocessing II: Between Subjects John Ashburner Wellcome Trust Centre for Neuroimaging, 12 Queen Square, London, UK.
Voxel-Based Morphometry John Ashburner Wellcome Trust Centre for Neuroimaging, 12 Queen Square, London, UK.
FMRI Preprocessing John Ashburner. Contents *Preliminaries *Rigid-Body and Affine Transformations *Optimisation and Objective Functions *Transformations.
FIL SPM Course May 2011 Spatial preprocessing Ged Ridgway With thanks to John Ashburner and the FIL Methods Group.
Co-registration and Spatial Normalisation
Preprocessing of FMRI Data fMRI Graduate Course October 23, 2002.
Signal, Noise and Preprocessing
Signal and noise. Tiny signals in lots of noise RestPressing hands Absolute difference % signal difference.
Coregistration and Spatial Normalisation
Spatial Preprocessing Ged Ridgway, FMRIB/FIL With thanks to John Ashburner and the FIL Methods Group.
BMI2 SS08 – Class 7 “functional MRI” Slide 1 Biomedical Imaging 2 Class 7 – Functional Magnetic Resonance Imaging (fMRI) Diffusion-Weighted Imaging (DWI)
Spatial Smoothing and Multiple Comparisons Correction for Dummies Alexa Morcom, Matthew Brett Acknowledgements.
Image Registration John Ashburner
SPM Pre-Processing Oli Gearing + Jack Kelly Methods for Dummies
Statistical Analysis An Introduction to MRI Physics and Analysis Michael Jay Schillaci, PhD Monday, April 7 th, 2007.
MfD Co-registration and Normalisation in SPM
Spatial processing of FMRI data And why you may care.
functional magnetic resonance imaging (fMRI)
The general linear model and Statistical Parametric Mapping
Zurich SPM Course 2012 Spatial Preprocessing
MRI Physics in a Nutshell Christian Schwarzbauer
Spatial Preprocessing John Ashburner
fMRI Preprocessing John Ashburner
Zurich SPM Course 2011 Spatial Preprocessing
Keith Worsley Keith Worsley
Computational Neuroanatomy for Dummies
The General Linear Model (GLM)
Image Preprocessing for Idiots
Spatial Preprocessing
The General Linear Model
From buttons to code Eamonn Walsh & Domenica Bueti
Statistical Parametric Mapping
Image Registration John Ashburner
The general linear model and Statistical Parametric Mapping
Preprocessing: Coregistration and Spatial Normalisation
The General Linear Model
The General Linear Model (GLM)
M/EEG Statistical Analysis & Source Localization
Anatomical Measures John Ashburner
Multiple testing Justin Chumbley Laboratory for Social and Neural Systems Research Institute for Empirical Research in Economics University of Zurich.
Multiple testing Justin Chumbley Laboratory for Social and Neural Systems Research Institute for Empirical Research in Economics University of Zurich.
The General Linear Model
Presentation transcript:

Preprocessing In SPM Yingying Wang 7/15/2014 Tuesday http://neurobrain.net/2014STBCH/index.html

QUIZ For MRI, which element within the body is most important? Oxygen Carbon Hydrogen An MRI system uses an Radio Frequency (RF) pulse to change the: Spin of atoms’ nuclei Shape of the nuclei Amount of metal in person’s cells Answers: c) Hydrogen atoms have one proton and a large magnetic moment. This means they react strongly to magnetic fields and are ideal for examination in an MRI machine. a) An MRI's RF pulse changes the spin, or precession, of atoms' nuclei. The hydrogen atoms line up with the direction of the MRI's magnetic field.

QUIZ An MRI system creates an image when: All the hydrogen atoms in your body line up, creating an outline. Hydrogen atoms facing opposite directions cancel each other out, creating a reverse outline. The hydrogen atoms go back to their normal position, releasing energy. What component of an MRI system allows it to choose exactly where in the body to acquire an image? Gradient magnets Bore Contrast injector c) Imagine each hydrogen atom as a tiny magnet. In the MRI machine, they all line up. When the RF pulse disappears, they go back to their normal positions, releasing energy, which the system uses to make an image. a) Gradient magnets are small magnets that change the field within an MRI system. When turned on and off very rapidly, they essentially change the focus of the overall field.

QUIZ What does an MRI system use to convert mathematical data into image? RF pulse converter Fourier transform Electron precession Higher BOLD signal intensities arise from increases in the concentration of oxygenated ________ since the blood magnetic susceptibility now more closely matches the tissue magnetic susceptibility. b) Fourier transform uses mathematical functions to change the data retrieved by the MRI system into a picture that a doctor can examine to make a diagnosis. - hemoglobin

Overview of SPM for fMRI Preprocessing Statistical parametric map (SPM) Design matrix Image time-series Kernel Realignment Smoothing General linear model Statistical inference Random field theory Normalization Let’s look at the overview of fMRI data analysis in SPM p <0.05 Template Parameter estimates

fMRI = Acquiring Movies y x z 3D Blood Oxygen-Level Dependent (BOLD) contrast images FMRI time series Task Run/Session: Time Series of Images … scan 1 time scan N Task No Task

fMRI = Acquiring Movies The Localized Time-series is the Fundamental Information Unit of fMRI Signal: Fluctuation through Blood oxygen level dependent (BOLD) contrast Noise: All other fluctuations slice 21…after warping…slice 34 before Run/Session: Time Series of Images … scan 1 time scan N

fMRI Movie: An example

The SPM Graphical User Interface (GUI) Preprocessing Realignment Slice-Timing Correction Co-registration Unified Segmentation & Normalization Smoothing 1.

Temporal preprocessing (slice timing correction) Temporal preprocessing is a necessary step in preparing your data for analysis. Filtering, spike removal, and slice time correction can each make a significant contribution to the power of your analysis (or more precisely, not doing them can significantly degrade your analysis).

Temporal Realignment (Slice-Timing Correction) Most functional MRI uses Echo-Planar Imaging (EPI) Each plane (slice) is typically acquired every 3mm normally axial… … requiring ~32 slices to cover cortex (40 to cover cerebellum too) (actually consists of slice-thickness, eg 2mm, and interslice gap, eg 1mm, sometimes expressed in terms of “distance factor”) (slices can be acquired contiguously, eg [1 2 3 4 5 6], or interleaved, eg [1 3 5 2 4 6]) Each plane (slice) takes about ~60ms to acquire… …entailing a typical TR for whole volume of 2-3s Volumes normally acquired continuously (though sometimes gap so that TR>TA) 2-3s between sampling the BOLD response in the first slice and the last slice (a problem for transient neural activity; less so for sustained neural activity)

Slice-timing correction (STC) Acquisition onset differs between slices STC: temporal alignment of all voxels in a volume Via sinc interpolation Sladky et al, NeuroImage 2011

Spatial Preprocessing Input Output fMRI time-series Anatomical MRI TPMs Segmentation Transformation (seg_sn.mat) Kernel REALIGN COREG SEGMENT NORM WRITE SMOOTH MNI Space Motion corrected Mean functional (Headers changed) GLM

Spatial preprocessing  Realignment  Co-registration  Segmentation &  Normalization  Smoothing

Realignment Aligns all volumes of all runs spatially fMRI time-series Aligns all volumes of all runs spatially Rigid-body transformation: three translations, three rotations Objective function: mean squared error of corresponding voxel intensities Voxel correspondence via Interpolation REALIGN Mean functional Motion corrected

Rigid-Body Transformations Assume that brain of the same subject doesn’t change shape or size in the scanner. Head can move, but remains the same shape and size. Some exceptions: Image distortions. Brain slops about slightly because of gravity. Brain growth or atrophy over time. If the subject’s head moves, we need to correct the images. Do this by image registration.

Image Registration Two components: Registration - i.e. Optimise the parameters that describe a spatial transformation between the source and reference images Transformation - i.e. Re-sample according to the determined transformation parameters

2D Affine Transforms Translations by tx and ty x1 = x0 + tx y1 = y0 + ty Rotation around the origin by  radians x1 = cos() x0 + sin() y0 y1 = -sin() x0 + cos() y0 Zooms by sx and sy x1 = sx x0 y1 = sy y0 Shear x1 = x0 + h y0 y1 = y0

3D Rigid-body Transformations A 3D rigid body transform is defined by: 3 translations - in X, Y & Z directions 3 rotations - about X, Y & Z axes The order of the operations matters Translations Pitch about x axis Roll about y axis Yaw about z axis

Motion Correction Algorithms pitch roll yaw z translation y translation x translation Most algorithms assume a rigid body (i.e., that brain doesn’t deform with movement) Align each volume of the brain to a target volume using six parameters: three translations and three rotations Target volume: the functional volume that is closest in time to the anatomical image

Objective Functions Intra-modal Inter-modal (or intra-modal) Mean squared difference (minimise) Normalised cross correlation (maximise) Inter-modal (or intra-modal) Mutual information (maximise) Normalised mutual information (maximise) Entropy correlation coefficient (maximise)

Mean-squared Difference Minimising mean-squared difference works for intra-modal registration (realignment) Simple relationship between intensities in one image, versus those in the other Assumes normally distributed differences

Simple Interpolation Nearest neighbour Tri-linear Take the value of the closest voxel Tri-linear Just a weighted average of the neighbouring voxels f5 = f1 x2 + f2 x1 f6 = f3 x2 + f4 x1 f7 = f5 y2 + f6 y1

B-spline Interpolation

Realignment Output: Parameters

Motion corrected No Motion correction Z-Value: 3.9 % signal change Z-Value: 3.9 Crosshair location: Postcentral gyrus Time (TRs) Motion corrected % signal change Time (TRs) Z-Value: 3.8

Residual Errors from aligned fMRI Re-sampling can introduce interpolation errors especially tri-linear interpolation Gaps between slices can cause aliasing artefacts Slices are not acquired simultaneously rapid movements not accounted for by rigid body model Image artefacts may not move according to a rigid body model image distortion image dropout Nyquist ghost Functions of the estimated motion parameters can be modelled as confounds in subsequent analyses

Spatial preprocessing  Realignment  Co-registration  Segmentation &  Normalization  Smoothing

Co-Registration Aligns structural image to mean functional image Anatomical MRI Aligns structural image to mean functional image Affine transformation: translations, rotations, scaling, shearing Objective function: mutual information, since contrast different Typically only transformation matrix (“header”) changed (no reslicing) COREG Motion corrected Mean functional (Headers changed)

Inter-modal registration. Coregistration Inter-modal registration. Match images from same subject but different modalities: anatomical localisation of single subject activations achieve more precise spatial normalisation of functional image using anatomical image.

Between Modality Co-registration Useful, for example, to display functional results (EPI) onto high resolution structural image (T1)… …indeed, necessary if spatial normalisation is determined by T1 image Because different modality images have different properties (e.g., relative intensity of gray/white matter), cannot simply minimise difference between images Therefore, use Mutual Information as cost function, rather than squared differences… EPI T2 T1 Transm PD PET

Coregistration maximises Mutual Information Used for between-modality registration Derived from joint histograms MI= ab P(a,b) log2 [P(a,b)/( P(a) P(b) )] Related to entropy: MI = -H(a,b) + H(a) + H(b) Where H(a) = -a P(a) log2P(a) and H(a,b) = -a P(a,b) log2P(a,b)

Co-Registration: Output Mean functional Anatomical MRI Joint and marginal Histogram Quantify how well one image predicts the other = how much shared info Joint probability distribution estimated from joint histogram

Co-Registration: Output

Spatial preprocessing  Realignment  Co-registration  Segmentation &  Normalization  Smoothing

Pre-processing Overview Statistics or whatever fMRI time-series Template Anatomical MRI Smoothed Estimate Spatial Norm Motion Correct Smooth Coregister Spatially normalised Deformation

Alternative Pipeline Statistics or whatever fMRI time-series Template Smoothed Estimate Spatial Norm Motion Correct Smooth Spatially normalised Deformation

Spatial Normalisation - Reasons Inter-subject averaging Increase sensitivity with more subjects Fixed-effects analysis Extrapolate findings to the population as a whole Mixed-effects analysis Make results from different studies comparable by aligning them to standard space e.g. The T&T convention, using the MNI template

Inter-subject Variability

Coordinates - normalization Different people’s brains look different ‘Normalizing’ adjusts overall size and orientation Normalized Images Raw Images

Standard spaces The Talairach Atlas The MNI/ICBM AVG152 Template Also DICOM scanner-based voxel-world mapping The MNI template follows the convention of T&T, but doesn’t match the particular brain Recommended reading: http://imaging.mrc-cbu.cam.ac.uk/imaging/MniTalairach

Segmentation Anatomical MRI TPMs Segmentation Transformation (seg_sn.mat) SEGMENT NORM WRITE MNI Space Motion corrected Motion corrected Mean functional (Headers changed)

Segmentation Goal: Probabilistically label voxels into their appropriate space How: Bayesian inference Use tissue probability maps (TPMs) are used as priors. Output: a spatial transformation (i.e. seg_sn.mat) that can be used for spatially normalising images. Mixture of Gaussian model (tissue probabilities) Bayes is used to model the inhomogeneities in the data (with bases functions), used then to correct it

Normalisation via segmentation MRI imperfections make normalisation harder Noise, artefacts, partial volume effect Intensity inhomogeneity or “bias” field Differences between sequences Normalising segmented tissue maps should be more robust and precise than using the original images ... … Tissue segmentation benefits from spatially-aligned prior tissue probability maps (from other segmentations) This circularity motivates simultaneous segmentation and normalisation in a unified model

Summary of the unified model SPM8 implements a generative model Principled Bayesian probabilistic formulation Gaussian mixture model segmentation with deformable tissue probability maps (TPMs, priors) The inverse of the transformation that aligns the TPMs can be used to normalise the original image Bias correction is included within the model

Mixture of Gaussians (MOG) Classification is based on a Mixture of Gaussians model (MOG), which represents the intensity probability density by a number of Gaussian distributions. Frequency Image Intensity

Tissue intensity distributions (T1-w MRI)

Non-Gaussian Intensity Distributions Multiple Gaussians per tissue class allow non-Gaussian intensity distributions to be modelled. E.g. accounting for partial volume effects

Modelling inhomogeneity A multiplicative bias field is modelled as a linear combination of basis functions. Corrected image Corrupted image Bias Field

Tissue Probability Maps Tissue probability maps (TPMs) are used as the prior, instead of the proportion of voxels in each class ICBM Tissue Probabilistic Atlases. These tissue probability maps were kindly provided by the International Consortium for Brain Mapping

Deforming the Tissue Probability Maps Tissue probability maps images are warped to match the subject The inverse transform warps to the TPMs

Segmentation results Spatially normalised BrainWeb phantoms (T1, T2, PD) Tissue probability maps of GM and WM Cocosco, Kollokian, Kwan & Evans. “BrainWeb: Online Interface to a 3D MRI Simulated Brain Database”. NeuroImage 5(4):S425 (1997)

Spatial normalisation – regularisation The “best” parameters according to the objective function may not be realistic In addition to similarity, regularisation terms or constraints are often needed to ensure a reasonable solution is found Also helps avoid poor local optima Can be considered as priors in a Bayesian framework, e.g. converting ML to MAP: log(posterior) = log(likelihood) + log(prior) + c

Spatial normalisation – Limitations Seek to match functionally homologous regions, but... Challenging high-dimensional optimisation, many local optima Different cortices can have different folding patterns No exact match between structure and function [Interesting recent paper Amiez et al. (2013), PMID:23365257 ] Compromise Correct relatively large-scale variability (sizes of structures) Smooth over finer-scale residual differences

Smoothing Why blurring the data? Improves spatial overlap by blurring over anatomical differences Suppresses thermal noise (averaging) Increases sensitivity to effects of similar scale to kernel (matched filter theorem) Makes data more normally distributed (central limit theorem) Reduces the effective number of multiple comparisons Kernel SMOOTH MNI Space How is it implemented? Convolution with a 3D Gaussian kernel, of specified full-width at half-maximum (FWHM) in mm GLM

Smoothing Goal: Improve SNR, Matched-Filter Theorem How: Smooth with a 3D Gaussian Kernel Each voxel after smoothing effectively becomes the result of applying a weighted region of interest (ROI). Before convolution Convolved with a Gaussian Suppresses noise

Smoothing Potentially increase signal to noise (matched filter theorem) Inter-subject averaging (allowing for residual differences after normalisation) Increase validity of statistics (more likely that errors distributed normally) Kernel defined in terms of FWHM (full width at half maximum) of filter - usually ~16-20mm (PET) or ~6-8mm (fMRI) of a Gaussian Ultimate smoothness is function of applied smoothing and intrinsic image smoothness (sometimes expressed as “resels” - RESolvable Elements) Gaussian smoothing kernel FWHM

0mm smooth 4mm smooth 8mm smooth 20mm smooth

Spatial Preprocessing Input Output fMRI time-series Anatomical MRI TPMs Segmentation Transformation (seg_sn.mat) Kernel REALIGN COREG SEGMENT NORM WRITE SMOOTH MNI Space Motion corrected Mean functional (Headers changed) GLM

Spike removal Spikes are impulsive positive or negative going discontinuities in the time course, followed by a return to normal. Multiple sources: Electrical sparks (from gradient problems, metal in bore) Rapid motion (coughing) External interference They cannot be effectively removed by frequency domain filtering. ART (from Susan Gabrieli at MIT Preprocessing strategy: Detect “abnormal” time points (excessive motion, large change in signal) Remove the affected time points (volumes) and interpolate Generate single point regressors to model out the variance

Artifact Detection Toolbox (ART) ART is a GUI tool for remedying a number of problems in datasets. Among its tools is one for detecting and removing spikes from fMRI data. Examines the global mean signal and motion parameters to detect “anomalous” time points that need to be dealt with.

Thank you Internet resources: http://www.translationalneuromodeling.org/spm-course-2014-presentation-slides/