Spatial Preprocessing John Ashburner [email protected]

36
Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk Smoothing Rigid registration Spatial normalisation With slides by Chloe Hutton and Jesper Andersson With slides by Chloe Hutton and Jesper Andersson

description

Spatial Preprocessing John Ashburner [email protected]. Smoothing Rigid registration Spatial normalisation. With slides by Chloe Hutton and Jesper Andersson. Overview of SPM Analysis. Statistical Parametric Map. Design matrix. fMRI time-series. Motion Correction. Smoothing. - PowerPoint PPT Presentation

Transcript of Spatial Preprocessing John Ashburner [email protected]

Page 1: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Spatial PreprocessingJohn [email protected]

Smoothing Rigid registration Spatial normalisation

With slides by Chloe Hutton and Jesper AnderssonWith slides by Chloe Hutton and Jesper Andersson

Page 2: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Overview of SPM Analysis

MotionCorrection Smoothing

SpatialNormalisation

General Linear Model

Statistical Parametric MapfMRI time-series

Parameter Estimates

Design matrix

Anatomical Reference

Page 3: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

ContentsSmoothingRigid registrationSpatial normalisation

Page 4: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Smoothing

Before convolution Convolved with a circleConvolved with a Gaussian

Each voxel after smoothing effectively becomes the result of applying a weighted region of interest (ROI).

Page 5: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

SmoothingWhy smooth?

Potentially increase sensitivity Inter-subject averaging Increase validity of SPM

Smoothing is a convolution with a Gaussian kernel

Gaussian convolution is

separable

Page 6: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

ContentsSmoothingRigid registration

Rigid-body transforms Optimisation & objective functions Interpolation

Spatial normalisation

Page 7: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Within-subject RegistrationAssumes there is no shape change, and

motion is rigid-bodyUsed by [realign] and [coregister] functionsThe steps are:

RegistrationRegistration - i.e. Optimising the parameters - i.e. Optimising the parameters that describe a rigid body transformation that describe a rigid body transformation between the source and reference imagesbetween the source and reference images

TransformationTransformation - i.e. Re-sampling according - i.e. Re-sampling according to the determined transformationto the determined transformation

Page 8: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Affine TransformsRigid-body transformations are a subsetParallel lines remain parallel Operations can be represented by:

x1 = m11x0 + m12y0 + m13z0 + m14

y1 = m21x0 + m22y0 + m23z0 + m24

z1 = m31x0 + m32y0 + m33z0 + m34

Or as matrices:Y=Mx

1zyx

1000mmmmmmmmmmmm

1zyx

0

0

0

34333231

24232221

14131211

1

1

1

Page 9: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

2D Affine TransformsTranslations 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

Shearx1 = x0 + h y0y1 = y0

Page 10: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

2D Affine TransformsTranslations by tx and ty

x1 = 1 x0 + 0 y0 + tx

y1 = 0 x0 + 1 y0 + ty

Rotation around the origin by radians x1 = cos() x0 + sin() y0 + 0 y1 = -sin() x0 + cos() y0 + 0

Zooms by sx and sy: x1 = sx x0 + 0 y0 + 0 y1 = 0 x0 + sy y0 + 0

Shearx1 = 1 x0 + h y0 + 0y1 = 0 x0 + 1 y0 + 0

Page 11: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

3D Rigid-body TransformationsA 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

1000010000cossin00sincos

10000cos0sin00100sin0cos

10000cossin00sincos00001

1000Zt100Y010X001

rans

trans

trans

ΩΩΩΩ

ΘΘ

ΘΘ

ΦΦΦΦ

Translations Pitchabout x axis

Rollabout y axis

Yawabout z axis

Page 12: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Voxel-to-world TransformsAffine transform associated with each image

Maps 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 normalised

Registering image B (source) to image A (target) will update B’s vox-to-world mapping Mapping from voxels in A to voxels in B is by

A-to-world using MA, then world-to-B using MB-1

MB-1 MA

Page 13: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Left- and Right-handed Coordinate SystemsAnalyze™ files are stored in a left-handed systemTalairach & Tournoux uses a right-handed systemMapping between them requires a flip

Affine transform with a negative determinant

Page 14: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

OptimisationOptimisation involves finding some

“best” parameters according to an “objective function”, which is either minimised or maximised

The “objective function” is often related to a probability based on some model

Value of parameter

Objective function

Most probable solution (global

optimum)Local optimumLocal optimum

Page 15: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Objective Functions for Image RegistrationIntra-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)

Page 16: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

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

Page 17: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Gauss-newton OptimisationWorks best

for least-squares

Minimum is estimated by fitting a quadratic at each iteration

Page 18: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

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

Inter-modal registration

Page 19: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Mutual Information

Used for between-modality registrationDerived 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)

Page 20: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Image TransformationsImages are re-sampled. An example in 2D:

for y0=1..ny0 % loop over rowsfor x0=1..nx0 % loop over pixels in row

x1 = tx(x0,y0,q) % transform according to qy1 = ty(x0,y0,q) if 1x1 nx1 & 1y1ny1 then % voxel in range

f1(x0,y0) = f0(x1,y1) % assign re-sampled valueend % voxel in range

end % loop over pixels in rowend % loop over rows

What happens if x1 and y1 are not integers?

Page 21: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Nearest neighbour Take the value of

the closest voxelTri-linear

Just a weighted average of the neighbouring voxels

f5 = f1 x2 + f2 x1

f6 = f3 x2 + f4 x1

f7 = f5 y2 + f6 y1

Simple Interpolation

Page 22: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

B-spline Interpolation

B-splines are piecewise polynomials

A continuous function is represented by a linear combination of basis

functions

2D B-spline basis functions of degrees 0, 1,

2 and 3

Nearest neighbour and trilinear interpolation are the same as B-spline interpolation with degrees 0 and 1.

Page 23: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

• 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

Residual Errors from aligned fMRI

Page 24: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Movement by Distortion Interaction of fMRI•Subject disrupts B0 field, rendering it inhomogeneous

=> distortions in phase-encode direction

•Subject moves during EPI time series•Distortions vary with subject orientation

=> shape varies

Page 25: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Movement by distortion interaction

Page 26: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Correcting for distortion changes using Unwarp

Estimate movement parameters.

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.

Estimate reference from mean of all scans.

Unwarp time series.

0B 0B

+

Andersson et al, 2001

Page 27: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

ContentsSmoothingRigid registrationSpatial normalisation

Affine registration Nonlinear registration Regularisation

Page 28: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Spatial Normalisation - Reasons

Inter-subject averaging Increase sensitivity with more subjects

Fixed-effects analysis Extrapolate findings to the population as a

wholeMixed-effects analysis

Standard coordinate system e.g., Talairach & Tournoux space

Page 29: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Spatial Normalisation - ObjectiveWarp the images such that functionally

homologous regions from different subjects are as close together as possible Problems:

No exact match between structure and functionDifferent brains are organised differentlyComputational problems (local minima, not enough

information in the images, computationally expensive)Compromise by correcting gross differences

followed by smoothing of normalised images

Page 30: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Very hard to define a one-to-one mappingof cortical

folding

Use only approximat

e registration

.

Page 31: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Spatial Normalisation - Procedure

Non-linear registration

Minimise mean squared difference from template image(s)

Affine registration

Page 32: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

EPI

T2 T1 Transm

PD PET

305T1

PD T2 SS

Template Images “Canonical” images

A wider range of contrasts can be registered to a linear combination of template images.

Spatial normalisation can be weighted so that non-brain voxels do not influence the result.

Similar weighting masks can be used for normalising lesioned brains.Spatial Normalisation -

TemplatesT1 PD

PET

Page 33: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Spatial Normalisation - AffineThe first part is a 12 parameter

affine transform 3 translations 3 rotations 3 zooms 3 shears

Fits overall shape and size

Algorithm simultaneously minimises Mean-squared difference between template and

source image Squared distance between parameters and their

expected values (regularisation)

Page 34: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Spatial Normalisation - Non-linear Deformations consist of a

linear combination of smooth basis functions

These are the lowest frequencies of a 3D discrete cosine transform (DCT)

Algorithm simultaneously minimises Mean squared difference between

template and source image Squared distance between parameters

and their known expectation

Page 35: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Templateimage

Affine registration.(2 = 472.1)

Non-linearregistration

withoutregularisation.(2 = 287.3)

Non-linearregistration

usingregularisation.(2 = 302.7)

Without regularisation, the non-linear spatial normalisation can introduce unnecessary warps.

Spatial Normalisation - Overfitting

Page 36: Spatial Preprocessing John Ashburner john@fil.ion.ucl.ac.uk

Friston et al (1995): Spatial registration and normalisation of images. Human Brain Mapping 3:165-189

Collignon et al (1995): Automated multi-modality image registration based on information theory. IPMI’95 pp 263-274

Andersson et al (2001): Modeling geometric deformations in EPI time series. Neuroimage 13:903-919

Thévenaz et al (2000): Interpolation revisited. IEEE Trans. Med. Imaging 19:739-758.

Ashburner et al (1997): Incorporating prior knowledge into image registration. NeuroImage 6:344-352

Ashburner et al (1999): Nonlinear spatial normalisation using basis functions. Human Brain Mapping 7:254-266

References