44
RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative Diseases Department of Radiology and Biomedical Imaging [email protected]

RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative Diseases Department of Radiology and Biomedical Imaging [email protected]

Page 2: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

What is image registration? •  Image registration is the process of estimating an

optimal geometric transformation to bring homologous points of two images as close as possible

Page 3: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Why image registration? •  Longitudinal analysis • Motion correction • Distortion correction • Multi-modal integration • Atlas generation • Kinematic analysis • Morphometry

Page 4: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Image registration categories • Feature-based •  Intensity-based

Page 5: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

How is intensity-based image registration done?

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Page 6: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Fixed image Moving image

• The moving image is the image that will be transformed and resampled in to the fixed image coordinate system

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Moving Transform Registered

moving Fixed

Page 7: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

How do we represent an image?

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

(1,1,c)

columns

Row

s

(m,1,1) Coordinates are in units of voxels

(1,1,1) (1,n,1)

l

p The intensity at a given voxel p of a 3D image I is usually expressed as

I(r,c,z)

Page 8: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

How do we represent an image?

•  Always ask for the spatial resolution

•  Medical image registration is done in physical coordinates, not in voxel coordinates

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

(1,1,c)

columns

Row

s

(m,1,1)

(1,1,1) (1,n,1)

p

Column voxel size in mm

Row

vox

el s

ize

in m

m

Page 9: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

How do we represent an image?

•  The center of the physical coordinate system is usually given by the scanner

•  Be aware that still many images are not isotropic

•  In the physical coordinate ystem we usually express the position of a point p as [x y z]’

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Coordinates are in units of mm

y

z

x

(0,0,0)

Page 10: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

How do we go from one coordinate system to another? • We need a geometric transformation • A geometric transformation maps coordinates from one

coordinate system to another • The transformation model is often described by its

Degrees of Freedom (DoF), which is the number of independent ways that the transformation can be changed

•  In general, increasing the number of DoF allows the transformations greater scope to make one image match the other

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Page 11: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Rigid transformation •  In 3D it has 6 DoF:

•  3 translations

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

x 'y 'z '1

!

"

####

$

%

&&&&

=

1 0 0 tx0 1 0 ty0 0 1 tz0 0 0 1

!

"

#####

$

%

&&&&&

xyz1

!

"

####

$

%

&&&&

T

Page 12: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Rigid transformation •  In 3D it has 6 DoF:

•  3 translations •  3 rotations

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

x 'y 'z '1

!

"

####

$

%

&&&&

=

cos(θ ) −sin(θ ) 0 0sin(θ ) cos(θ ) 0 00 0 1 00 0 0 1

!

"

####

$

%

&&&&

xyz1

!

"

####

$

%

&&&&

Mz

Page 13: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Rigid transformation •  In 3D it has 6 DoF:

•  3 translations •  3 rotations

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

x 'y 'z '1

!

"

####

$

%

&&&&

=

cos(ϕ ) 0 −sin(ϕ ) 00 1 0 0

sin(ϕ ) 0 cos(ϕ ) 00 0 0 1

!

"

#####

$

%

&&&&&

xyz1

!

"

####

$

%

&&&&

My

Page 14: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Rigid transformation •  In 3D it has 6 DoF:

•  3 translations •  3 rotations

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

x 'y 'z '1

!

"

####

$

%

&&&&

=

1 0 0 00 cos(ω) −sin(ω) 00 sin(ω) cos(ω) 00 0 0 1

!

"

####

$

%

&&&&

xyz1

!

"

####

$

%

&&&&

Mx

Page 15: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Affine transformation •  In 3D it has 9 DoF:

•  3 translations •  3 rotations •  3 scalings

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

x 'y 'z '1

!

"

####

$

%

&&&&

=

sx 0 0 00 sy 0 0

0 0 sz 00 0 0 1

!

"

#####

$

%

&&&&&

xyz1

!

"

####

$

%

&&&&

S

Page 16: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Affine transformation •  In 3D it has 12 DoF:

•  3 translations •  3 rotations •  3 scalings •  3 skew

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

x 'y 'z '1

!

"

####

$

%

&&&&

=

1 0 a 00 1 b 00 0 1 00 0 0 1

!

"

####

$

%

&&&&

xyz1

!

"

####

$

%

&&&&

Kz Shear along any pair of axes is proportional to the third axis e.g., to shear along z: x and y are altered by an amount proportional to z, leaving z unchanged. x ' = x + azy ' = y+ bzz ' = z

Page 17: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Affine transformation Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

• Maps lines to lines • Maps parallel lines to parallel lines

• Preserves ratios of distance along a line

• Does NOT preserve absolute distances and angles

Page 18: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Transformations Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Page 19: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Transformations

•  In medical imaging, you usually need some combination of these basic transformations

• This is accomplished by concatenating the transformations:

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

x

y

x

y

= x

y

Composition

Tx Mz

Page 20: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Transformations Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Matrix multiplication is not commutative!

y

x

y

Composition

Tx Mz

x

y

x

y

Composition

Tx Mz

x

MzMT ≠MTMz

Page 21: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Nonlinear transformation

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

• The non-linear transformation model includes all transformations that do not fit into the affine transformation model

•  In 3D, it can go from those that are nearly linear with fed DoF to the most general transformations which have a separate displacement (3 DoF) for each voxel, giving well over a million DoF for typical images

Page 22: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Rigid transformation example

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

•  Intra-subject longitudinal registration

Baseline scan Fixed image

Follow-up scan Moving image

Follow-up scan After rigid registration

Page 23: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Rigid transformation example

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

•  Intra-subject longitudinal registration

Baseline scan Fixed image

Follow-up scan Moving image

Follow-up scan After rigid registration

Page 24: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Affine transformation example

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

•  Inter-subject registration

Fixed image Model – Young females

(n=94)

Moving image No registration

Moving image Rigid registration

Page 25: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Affine transformation example

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

•  Inter-subject registration

Fixed image Model – Young females

(n=94)

Moving image No registration

Moving image Affine registration

Page 26: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Affine transformation example

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

•  Inter-subject registration

Fixed image Model – Young females

(n=94)

Moving image No registration

Moving image Nonlinear registration

Page 27: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Affine transformation example

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

•  Inter-subject registration

Rigid Affine Nonlinear

Fixed image Moving image

Page 28: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

How do we apply the transformation to get an aligned moving image?

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

• How to change from voxel coordinates to physical coordinates…

Transform

Transform Transform

Voxel coordinates Voxel coordinates

Physical coordinates

(r,c) (r,c)

(x,y) (x,y)

Page 29: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

How do we apply the transformation to get an aligned moving image?

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Transform

Transform Transform

Voxel coordinates Voxel coordinates

Physical coordinates

(r,c) (r,c)

(x,y) (x,y)

• To go from voxel coordinates to the physical coordinates system we need a transformation matrix that includes scalings and translations so that:

x = c x Spacingx + Ox y = r x Spacingy + Oy

After the geometric transformation has been completed, change from the physical coordinate system to the fixed voxel space

Page 30: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

How do we apply the transformation to get an aligned moving image?

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Transform

Transform Transform

Voxel coordinates Voxel coordinates

Physical coordinates

(r,c) (r,c)

(x,y) (x,y)

• Once in the physical space we can apply the geometric transformation to align the moving image to the fixed image

• However, remember that the final goal is to have the moving image aligned to the fixed image in the space of the fixed image, so we have to take into account the mapping of the voxel intensities

Page 31: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Forward mapping

•  Moving image voxels are mapped onto the fixed image •  Multiple moving voxels could hit the same fixed image voxel:

•  The transformation has to keep track and accumulate this overlapping

•  The registered moving image could have holes •  Fixed image voxels with no hits

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Forward mapping

Moving image

Page 32: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Backward mapping

•  Fixed image coordinates are mapped back onto the moving image •  Output voxel values must be interpolated from a neighborhood in

the moving image •  All fixed coordinates are scanned sequentially thus avoiding holes

and overlaps in the output image •  This can sometimes become a problem if the mapping function is

non-invertible

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Backward mapping

Moving image

Page 33: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Parameters Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

•  Image registration in medical imaging is commonly done with backward mapping requiring intensity interpolation

• The parameters of the transformation are thus those that map each voxel position in the fixed image to the moving image

Page 34: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Intensity interpolation

• Nearest neighbor

•  Linear

• Spline

• Sinc

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Page 35: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Linear interpolation

•  Intensity at a given point is computed based on a weighted average of the surrounding voxels (e.g., 4 in 2D and 8 in 3D)

• Weights are calculated based on the distances between the coordinates of the point of interest and those of the surrounding voxels

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Page 36: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Linear interpolation Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

p

Δx

Δy

IM (x, y)

IM (x, y+1) IM (x +1, y+1)

IM (x +1, y)

I(p) = (1−Δx)(1−Δy)IM (x, y)+Δx(1−Δy)IM (x +1, y)+(1−Δx)ΔyIM (x, y+1)+ΔxΔyIM (x +1, y+1)

Page 37: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Optimizer

• The optimizer helps us to find the optimal set of transformation parameters

• Different optimization strategies, e.g. Gradient Descent

• Optimization is usually an iterative process

• The optimizer needs a metric to tell it how well the images are aligned

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Page 38: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Optimization metrics

•  Intra-model intensity metrics •  Mean-squared differences (MSD; cost function) •  Absolute differences (MAD; cost function) •  Normalized correlation (NCC; similarity function)

•  Inter-modal intensity metrics •  Mutual information (MI; similarity function) •  Normalized mutual information (NMI; cost function) •  Correlation ratio (CR; similarity function)

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Page 39: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Optimization metrics MSD

• F = Fixed image • T = Transformed moving image • N = Number of voxels in the overlapping region • H(.) = Marginal entropy • H(.,.) = Joint entropy

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

MSD =1N

IFj − ITj( )2

j∑

Page 40: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Optimization metric MI Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

MI = H (IF )+H (IT )−H (.IF, IT )

H (IF ) = − pF ( f )log∑ pF ( f )[ ]

H (IT ) = − pT ( f )log∑ pT ( f )[ ]

H (IF, IT ) = − pFT ( f , t)log pFT ( f , t)[ ]∑∑

• F = Fixed image • T = Transformed moving image • N = Number of voxels in the overlapping region • H(.) = Marginal entropy • H(.,.) = Joint entropy

Page 41: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Multi-resolution

•  Improves speed •  Improves robustness •  Improves accuracy

Fixed image

Moving image

Comparison

Interpolator Parameters

Optimizer

Transform

Moving image Fixed image

Registration

Registration

Registration

Page 42: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Nonlinear registration • Basis functions • Splines • Elastic-solid • Viscous fluid • Smoothed

displacement fields

Page 43: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Nonlinear registration - FFD

Page 44: RIGID IMAGE REGISTRATION › ... › files › wysiwyg › education › RigidRegistrati… · RIGID IMAGE REGISTRATION Duygu Tosun-Turgut, Ph.D. Center for Imaging of Neurodegenerative

Nonlinear registration - FFD

Active region