Presentation on theme: "Image Registration John Ashburner"— Presentation transcript:
1Image Registration John Ashburner SmoothRealignNormaliseSegmentWith slides by Chloe Hutton and Jesper Andersson
2Overview of SPM Analysis fMRI time-seriesDesign matrixStatistical Parametric MapMotionCorrectionSmoothingGeneral Linear ModelSpatialNormalisationParameter EstimatesAnatomical Reference
3Contents Preliminaries Intra-Subject Registration SmoothRigid-Body and Affine TransformationsOptimisation and Objective FunctionsTransformations and InterpolationIntra-Subject RegistrationInter-Subject Registration
4Smooth Smoothing is done by convolution. Each voxel after smoothing effectively becomes the result of applying a weighted region of interest (ROI).Before convolutionConvolved with a circleConvolved with a Gaussian
5Image RegistrationRegistration - i.e. Optimise the parameters that describe a spatial transformation between the source and reference (template) imagesTransformation - i.e. Re-sample according to the determined transformation parameters
62D Affine Transforms Shear Translations by tx and ty x1 = x0 + txy1 = y0 + tyRotation around the origin by radiansx1 = cos() x0 + sin() y0y1 = -sin() x0 + cos() y0Zooms by sx and syx1 = sx x0y1 = sy y0Shearx1 = x0 + h y0y1 = y0
72D Affine Transforms Shear Translations by tx and ty x1 = 1 x0 + 0 y0 + txy1 = 0 x0 + 1 y0 + tyRotation around the origin by radiansx1 = cos() x0 + sin() y0 + 0y1 = -sin() x0 + cos() y0 + 0Zooms by sx and sy:x1 = sx x0 + 0 y0 + 0y1 = 0 x0 + sy y0 + 0Shearx1 = 1 x0 + h y0 + 0y1 = 0 x0 + 1 y0 + 0
83D Rigid-body Transformations A 3D rigid body transform is defined by:3 translations - in X, Y & Z directions3 rotations - about X, Y & Z axesThe order of the operations mattersTranslationsPitchabout x axisRollabout y axisYawabout z axis
9Voxel-to-world Transforms Affine transform associated with each imageMaps from voxels (x=1..nx, y=1..ny, z=1..nz) to some world co-ordinate system. e.g.,Scanner co-ordinates - images from DICOM toolboxT&T/MNI coordinates - spatially normalisedRegistering image B (source) to image A (target) will update B’s voxel-to-world mappingMapping from voxels in A to voxels in B is byA-to-world using MA, then world-to-B using MB-1MB-1 MA
10Left- and Right-handed Coordinate Systems Analyze™ files are stored in a left-handed systemTalairach & Tournoux uses a right-handed systemMapping between them requires a flipAffine transform with a negative determinant
11OptimisationOptimisation involves finding some “best” parameters according to an “objective function”, which is either minimised or maximisedThe “objective function” is often related to a probability based on some modelMost probable solution (global optimum)Objective functionLocal optimumLocal optimumValue of parameter
12Objective Functions Intra-modal Inter-modal (or intra-modal) Mean squared difference (minimise)Normalised cross correlation (maximise)Entropy of difference (minimise)Inter-modal (or intra-modal)Mutual information (maximise)Normalised mutual information (maximise)Entropy correlation coefficient (maximise)AIR cost function (minimise)
13Transformation Images are re-sampled. An example in 2D: for y0=1..ny0 % loop over rowsfor x0=1..nx0 % loop over pixels in rowx1 = tx(x0,y0,q) % transform according to qy1 = ty(x0,y0,q)if 1x1 nx1 & 1y1ny1 then % voxel in rangef1(x0,y0) = f0(x1,y1) % assign re-sampled valueend % voxel in rangeend % loop over pixels in rowend % loop over rowsWhat happens if x1 and y1 are not integers?
14Simple Interpolation Nearest neighbour Tri-linear Take the value of the closest voxelTri-linearJust a weighted average of the neighbouring voxelsf5 = f1 x2 + f2 x1f6 = f3 x2 + f4 x1f7 = f5 y2 + f6 y1
15B-spline Interpolation A continuous function is represented by a linear combination of basis functions2D B-spline basis functions of degrees 0, 1, 2 and 3B-splines are piecewise polynomialsNearest neighbour and trilinear interpolation are the same as B-spline interpolation with degrees 0 and 1.
17Mean-squared Difference Minimising mean-squared difference works for intra-modal registration (realignment)Simple relationship between intensities in one image, versus those in the otherAssumes normally distributed differences
18Residual Errors from aligned fMRI Re-sampling can introduce interpolation errorsespecially tri-linear interpolationGaps between slices can cause aliasing artefactsSlices are not acquired simultaneouslyrapid movements not accounted for by rigid body modelImage artefacts may not move according to a rigid body modelimage distortionimage dropoutNyquist ghostFunctions of the estimated motion parameters can be modelled as confounds in subsequent analyses
19Movement by Distortion Interaction of fMRI Subject disrupts B0 field, rendering it inhomogeneous=> distortions in phase-encode directionSubject moves during EPI time seriesDistortions vary with subject orientation=> shape varies
21Correcting for distortion changes using Unwarp Estimate reference from mean of all scans.Estimate new distortion fields for each image:estimate rate of change of field with respect to the current estimate of movement parameters in pitch and roll.Unwarp time series.Estimate movement parameters.+Andersson et al, 2001
22Contents Preliminaries Intra-Subject Registration RealignCoregisterMutual Information objective functionInter-Subject Registration
23Inter-modal registration Match images from same subject but different modalities:anatomical localisation of single subject activationsachieve more precise spatial normalisation of functional image using anatomical image.
24Mutual Information Used for between-modality registration Derived from joint histogramsMI= 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)
26Spatial Normalisation - Reasons Inter-subject averagingIncrease sensitivity with more subjectsFixed-effects analysisExtrapolate findings to the population as a wholeMixed-effects analysisStandard coordinate systeme.g., Talairach & Tournoux space
27Spatial Normalisation - Procedure Minimise mean squared difference from template image(s)Affine registrationNon-linear registration
28Spatial Normalisation - Templates TransmT1305PDT2SSEPIPDPETTemplate Images“Canonical” imagesSpatial normalisation can be weighted so that non-brain voxels do not influence the result.Similar weighting masks can be used for normalising lesioned brains.PETA wider range of contrasts can be registered to a linear combination of template images.T1PDSpatial Normalisation - Templates
29Spatial Normalisation - Affine The first part is a 12 parameter affine transform3 translations3 rotations3 zooms3 shearsFits overall shape and sizeAlgorithm simultaneously minimisesMean-squared difference between template and source imageSquared distance between parameters and their expected values (regularisation)
30Spatial Normalisation - Non-linear Deformations consist of a linear combination of smooth basis functionsThese are the lowest frequencies of a 3D discrete cosine transform (DCT)Algorithm simultaneously minimisesMean squared difference between template and source imageSquared distance between parameters and their known expectation
31Spatial Normalisation - Overfitting Without regularisation, the non-linear spatial normalisation can introduce unnecessary warps.Affine registration.(2 = 472.1)TemplateimageNon-linearregistrationwithoutregularisation.(2 = 287.3)Non-linearregistrationusingregularisation.(2 = 302.7)
33SegmentationSegmentation in SPM5 also estimates a spatial transformation that can be used for spatially normalising images.It uses a generative model, which involves:Mixture of Gaussians (MOG)Bias Correction ComponentWarping (Non-linear Registration) Component
34Gaussian Probability Density If intensities are assumed to be Gaussian of mean mk and variance s2k, then the probability of a value yi is:
35Non-Gaussian Probability Distribution A non-Gaussian probability density function can be modelled by a Mixture of Gaussians (MOG):Mixing proportion - positive and sums to one
36Belonging Probabilities Belonging probabilities are assigned by normalising to one.
37Mixing ProportionsThe mixing proportion gk represents the prior probability of a voxel being drawn from class k - irrespective of its intensity.So:
38Non-Gaussian Intensity Distributions Multiple Gaussians per tissue class allow non-Gaussian intensity distributions to be modelled.E.g. accounting for partial volume effects
39Probability of Whole Dataset If the voxels are assumed to be independent, then the probability of the whole image is the product of the probabilities of each voxel:A maximum-likelihood solution can be found by minimising the negative log-probability:
40Modelling a Bias FieldA bias field is included, such that the required scaling at voxel i, parameterised by b, is ri(b).Replace the means by mk/ri(b)Replace the variances by (sk/ri(b))2
41Modelling a Bias FieldAfter rearranging...yr(b)y r(b)
42Tissue Probability Maps Tissue probability maps (TPMs) are used instead of the proportion of voxels in each Gaussian as the prior.ICBM Tissue Probabilistic Atlases. These tissue probability maps are kindly provided by the International Consortium for Brain Mapping, John C. Mazziotta and Arthur W. Toga.
43“Mixing Proportions”Tissue probability maps for each class are included.The probability of obtaining class k at voxel i, given weights g is then:
44Deforming the Tissue Probability Maps Tissue probability images are deformed according to parameters a.The probability of obtaining class k at voxel i, given weights g and parameters a is then:
45The Objective Function The Extended ModelBy combining the modified P(ci=k|q) and P(yi|ci=k,q), the overall objective function (E) becomes:The Objective Function
46OptimisationThe “best” parameters are those that minimise this objective function.Optimisation involves finding them.Begin with starting estimates, and repeatedly change them so that the objective function decreases each time.
47Alternate between optimising different groups of parameters Steepest DescentStartOptimumAlternate between optimising different groups of parameters
48Schematic of optimisation Repeat until convergence…Hold g, m, s2 and a constant, and minimise E w.r.t. b- Levenberg-Marquardt strategy, using dE/db and d2E/db2Hold g, m, s2 and b constant, and minimise E w.r.t. a- Levenberg-Marquardt strategy, using dE/da and d2E/da2Hold a and b constant, and minimise E w.r.t. g, m and s2-Use an Expectation Maximisation (EM) strategy.end
49Levenberg-Marquardt Optimisation LM optimisation is used for nonlinear registration (a) and bias correction (b).Requires first and second derivatives of the objective function (E).Parameters a and b are updated byIncrease l to improve stability (at expense of decreasing speed of convergence).
50Expectation Maximisation is used to update m, s2 and g For iteration (n), alternate between:E-step: Estimate belonging probabilities by:M-step: Set q(n+1) to values that reduce:
51RegularisationSome bias fields and warps are more probable (a priori) than others.Encoded using Bayes rule (for a maximum a posteriori solution):Prior probability distributions modelled by a multivariate normal distribution.Mean vector ma and mbCovariance matrix Sa and Sb-log[P(a)] = (a-ma)TSa-1(a-ma) + const-log[P(b)] = (b-mb)TSb-1(b-mb) + const
52Initial Affine Registration The procedure begins with a Mutual Information affine registration of the image with the tissue probability maps. MI is computed from a 4x256 joint probability histogram.See D'Agostino, Maes, Vandermeulen & P. Suetens. “Non-rigid Atlas-to-Image Registration by Minimization of Class-Conditional Image Entropy”. Proc. MICCAI LNCS 3216, PagesJoint Probability HistogramBackground voxels excluded
53Background Voxels are Excluded An intensity threshold is found by fitting image intensities to a mixture of two Gaussians. This threshold is used to exclude most of the voxels containing only air.
54Spatially normalised BrainWeb phantoms (T1, T2 and PD) Tissue probability maps of GM and WMCocosco, Kollokian, Kwan & Evans. “BrainWeb: Online Interface to a 3D MRI Simulated Brain Database”. NeuroImage 5(4):S425 (1997)
55ReferencesFriston et al. Spatial registration and normalisation of images. Human Brain Mapping 3: (1995).Collignon et al. Automated multi-modality image registration based on information theory. IPMI’95 pp (1995).Ashburner et al. Incorporating prior knowledge into image registration. NeuroImage 6: (1997).Ashburner & Friston. Nonlinear spatial normalisation using basis functions. Human Brain Mapping 7: (1999).Thévenaz et al. Interpolation revisited. IEEE Trans. Med. Imaging 19: (2000).Andersson et al. Modeling geometric deformations in EPI time series. Neuroimage 13: (2001).Ashburner & Friston. Unified Segmentation. NeuroImage in press (2005).