Presentation is loading. Please wait.

Presentation is loading. Please wait.

Preprocessing In SPM Yingying Wang 7/15/2014 Tuesday

Similar presentations


Presentation on theme: "Preprocessing In SPM Yingying Wang 7/15/2014 Tuesday"— Presentation transcript:

1 Preprocessing In SPM Yingying Wang 7/15/2014 Tuesday

2 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.

3 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.

4 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

5 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

6 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

7 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

8 fMRI Movie: An example

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

10 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).

11

12 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 [ ], or interleaved, eg [ ]) 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)

13 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

14

15

16

17 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

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

19 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

20 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.

21 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

22 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

23 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

24 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

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

26 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

27 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

28 B-spline Interpolation

29 Realignment Output: Parameters

30 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

31 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

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

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

34 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.

35 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

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

37 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

38 Co-Registration: Output

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

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

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

42 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

43 Inter-subject Variability

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

45 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:

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

47 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

48 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

49 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

50 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

51 Tissue intensity distributions (T1-w MRI)

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

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

54 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

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

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

57 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

58 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: ] Compromise Correct relatively large-scale variability (sizes of structures) Smooth over finer-scale residual differences

59 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

60 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

61 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

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

63 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

64 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

65 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.

66

67

68

69 Thank you Internet resources:


Download ppt "Preprocessing In SPM Yingying Wang 7/15/2014 Tuesday"

Similar presentations


Ads by Google