• Aucun résultat trouvé

Introduction to medical image registration Pietro Gori

N/A
N/A
Protected

Academic year: 2022

Partager "Introduction to medical image registration Pietro Gori"

Copied!
58
0
0

Texte intégral

(1)

Introduction to medical image registration

Pietro Gori

Enseignant-chercheur Equipe IMAGES - Télécom ParisTech pietro.gori@telecom-paristech.fr

October 10, 2018

(2)

Summary

1 Introduction

2 Geometric global transformations

3 Image warping and interpolations

4 Intensity based registration

5 Landmark based registration Affine registration

Procrustes superimposition

Non-linear registration (small displacement) Non-linear registration (diffeomorphism)

(3)

Medical image geometric registration

Definition

Geometric: find theoptimal parameters of ageometric

transformationto spatially align two different images of the same object. It establishesspatial correspondence between the pixels of the source (or moving) image with the ones of the target image

Photometric: Modify the intensity of the pixels and not their position Applications

Compare two (or more) images of the same modality (e.g. T1-w MRI of the brain of two different subjects)

Combine information from multiple modalities (e.g. PET, DWI, T1-w MRI of the brain of the same subject)

Longitudinal studies (e.g. monitor anatomical or functional changes of the brain over time)

(4)

Medical Image registration - Applications

(5)

Image registration components

Dimensionality: 2D/2D, 3D/3D, 2D/3D Transformation (linear / non-linear)

Similarity metric(e.g. intensities, landmarks, edges, surfaces) Optimization procedure

Interaction (automatic / semi-automatic / interactive) Modalities(mono-modal / multi-modal)

Subjects(intra-subject / inter-subject / atlas construction)

(6)

Introduction

LetI and J be the source and target images. They show the same anatomical object, most of the time with a different field of view and resolution (sampling)

I(x, y) andJ(u, v) represent the intensity values of the pixels located onto two regular grids: {x, y} ∈ΩI and{u, v} ∈ΩJ

For the same subject, the same anatomical pointz can be in position xz, yz in I and inuz, vz inJ

(7)

Mathematical definition

Both I andJ are functions:

I(x, y) : ΩI⊆R2 → R

(x, y) → I(x, y)

We look for a geometric transformationT, which is a 2D warping parametric function that belongs to a certain familyΓ:

Tφ(x, y) : R2 → R2

(x, y;φ)Tφ(x, y)

φis the vector of parameters of T. We look for a transformation that

(8)

Mathematical definition

Most of the time,I andJ are simply seen as matrices whose coordinates (x, y) and(u, v) are thus integer-valued (number of line and column)

The values of the intensities of the pixels can be real numbers R (better for computations) or integer, usually in the range[0,255] for a gray-scale image

There are several kind of transformations:

modèle global modèle par morceaux

(régional)

modèle local

(9)

Summary

1 Introduction

2 Geometric global transformations

3 Image warping and interpolations

4 Intensity based registration

5 Landmark based registration Affine registration

Procrustes superimposition

Non-linear registration (small displacement) Non-linear registration (diffeomorphism)

(10)

Global transformations

Global means that the transformation is the same for any points p Scaling - multiply each coordinate by a scalar

"

u v

#

=

"

sx 0 0 sy

# "

x y

#

(1)

(11)

Global transformations

Rotation- WRT origin. Let p= [x y]T andp0 = [u v]T

"

x y

#

=

"

rcos(α) rsin(α)

#

"

u v

#

=

"

rcos(α+θ) rsin(α+θ)

#

=

"

r(cos(α) cos(θ)−sin(α) sin(θ)) r(sin(α) cos(θ) + cos(α) sin(θ))

#

=

"

xcos(θ)−ysin(θ) ycos(θ) +xsin(θ)

#

=

"

cos(θ) −sin(θ) sin(θ) cos(θ)

# "

x y

#

R=

"

cos(θ) −sin(θ) sin(θ) cos(θ)

#

det(R) = 1 R−1=RT

(12)

Global transformations

Reflection

Horizontal (Y-axis)

"

u v

#

=

"

rcos(π−α) rsin(π−α)

#

=

"

−1 0 0 1

# "

x y

#

Vertical (X-axis)

"

u v

#

=

"

rcos(32π+α) rsin(32π+α)

#

=

"

1 0

0 −1

# "

x y

#

det(R) =−1 R−1=RT

(13)

Global transformations

Shear- Transvection in french

"

u v

#

=

"

1 λx

λy 1

# "

x y

#

(14)

2D Linear transformations

"

u v

#

=

"

a b c d

# "

x y

#

Linear transformations are combinations of:

scaling rotation reflection shear

Properties of linear transformations:

origin is always transformed to origin parallel lines remain parallel

ratios are preserved lines remain lines

(15)

Translation

It does not have a fixed point→ no matrix multiplication

"

u v

#

=

"

x y

# +

"

tx ty

#

=

"

x+tx y+ty

#

(2)

(16)

Homogeneous coordinates - 2D affine transformation

Instead than 2D matrices we use 3D matrices.

Affine transformation: combination of linear transformations and translations

Letp= [x y]T and p0 = [u v]T, we obtain p0 =Tp

u v 1

=

a b tx

c d ty

0 0 1

| {z }

T

x y 1

Properties of affine transformations:

origin isnot always transformed to origin parallel lines remain parallel

ratios are preserved lines remain lines

(17)

2D Projective transformations (homographies)

u v 1

=

a b g c d h e f i

x y 1

Properties of projective transformations:

origin isnot always transformed to origin parallel lines donot necessarily remain parallel ratios arenotpreserved

lines remain lines

(18)

Examples

(19)

Summary

1 Introduction

2 Geometric global transformations

3 Image warping and interpolations

4 Intensity based registration

5 Landmark based registration Affine registration

Procrustes superimposition

Non-linear registration (small displacement) Non-linear registration (diffeomorphism)

(20)

Forward warping

Tφ(x, y) : R2 → R2

(x, y;φ)Tφ(x, y)

Ideally, ifΩI andΩJ were continuous domains, we would simply map (x, y)to (u, v) =Tφ(x, y)and then compare I(x, y) with J(u, v) However, ΩI andΩJ are regular grids ! What if Tφ(x, y) is not on the grid ΩJ ? → Splatting, add contribution to neighbor pixels.

(21)

Inverse warping

Find the pixel intensities for the deformed imageIT starting fromΩJ: (x, y) =T−1φ (u, v)

Assign toIT(u, v)the pixel intensity in I(x, y) What ifT−1φ (u, v) is not on ΩI ? → Interpolation !

(22)

Interpolation

Goal: estimate the intensity value on points not located onto the regular grids

nearest neighbor bilinear

cubic lanczos ...

(23)

Interpolation

Nearest neighbor: J(u, v) =I(round(x),round(y)) Bilinear: f(x,q)−f(x,y)

∆y = f(x,y+1)−f(x,q)

1−∆y

f(x, q) = (1−∆y)f(x, y) +f(x, y+ 1)∆y. Similarly,

f(x+ 1, q) = (1−∆y)f(x+ 1, y) +f(x+ 1, y+ 1)∆y. Then, f(p, q) =f(x, q)(1−∆x) +f(x+ 1, q)∆x

(24)

Interpolation examples

Every time we deform an image, we need to interpolate it. For instance, this is the result on Lena after 10 rotations of 36 degrees:

Figure 1:Original image - Nearest Neighbour - Bilinear

Source : http://bigwww.epfl.ch/demo/jaffine/index.html (Michael Unser)

(25)

Deformation algorithm

Recipe:

Given a source imageI and a global affine transformationT, compute the forward warping of the extremities of I. This gives the bounding box of the deformed image IT

Given the bounding box ofIT, create a new grid within it with, for instance, the same characteristics of ΩJ to allow comparison between IT andJ

Use the inverse warping and interpolation to compute the intensity values at the grid points of the warped imageIT (we avoid holes) Be careful! During the inverse warping, points that are mapped outside ΩI are rejected.

(26)

Transformation parameters

Given a transformationT defined by a set of parameterθ and two imagesI andJ, how do we estimateθ ?

By minimizing a cost function:

θ= arg min

θ

d(IT, J) (3)

The similarity measure dmight be based on the pixel intensities and/or on corresponding geometric objects such as control points (i.e. landmarks), curves or surfaces

(27)

Transformation parameters

Given a transformationT defined by a set of parameterθ and two imagesI andJ, how do we estimateθ ?

By minimizing a cost function:

θ= arg min

θ

d(IT, J) (3)

The similarity measure dmight be based on the pixel intensities and/or on corresponding geometric objects such as control points (i.e.

landmarks), curves or surfaces

(28)

Summary

1 Introduction

2 Geometric global transformations

3 Image warping and interpolations

4 Intensity based registration

5 Landmark based registration Affine registration

Procrustes superimposition

Non-linear registration (small displacement) Non-linear registration (diffeomorphism)

(29)

Intensity based registration

Same modality

Sum of squared intensity differences (SSD). Best measure whenI and J only differ by Gaussian noise. Very sensitive to “outliers” pixels, namely pixels whose intensity difference is very large compared to others.

d(IT, J) =X

u

X

v

(J(u, v)−I(T−1φ (u, v)))2= (J(u, v)−IT(u, v))2 (4) Correlation coefficient. Assumption is that there is a linear

relationship between the intensity of the images

d(IT, J) =

P

u

P

v(J(u, v)−J¯)(IT(u, v)−I¯T) q

P P

(J(u, v)−J¯)2P P (I (u, v)−I¯ )2 (5)

(30)

Intensity based registration

Multi modality

Mutual information. We first need to define the joint histogram between IT and J. The value at location (a, b) is equal to the number of intensity values that have intensityain IT(u, v)and intensity bin J(u, v). For example, a joint histogram which has the value of 2 in the position (7,3) means that we have found two locations (u, v) where the intensity of the first image was 7

(IT(u, v) = 7) and the intensity of the second was 3 (J(u, v) = 3).

By dividing by the total number of pixels, we obtain a joint probability density function (pdf) pIT,J.

The definition of joint entropy is:

H(IT, J) =−X

a

X

b

pIT,J(a, b) log(pIT,J(a, b)) (6) whereaand bare defined within the range of intensities in IT andJ respectively

(31)

Intensity based registration

Figure 2:Joint histogram of a) same modality (IRM) b) different modality

(32)

Intensity based registration

The definition of Mutual information is:

M(IT, J) =H(IT) +H(J)H(IT, J) (7) whereH(IT) =−PapIT(a) log(pIT(a))and

H(J) =−PbpJ(b) log(pJ(b)). The two marginal pdf pIT andpJ are simply the accumulations over the columns and rows ofpIT,J

respectively. It results:

M(IT, J) =X

a

X

b

pIT,J(a, b) log pIT,J(a, b)

pIT,J(a)pJ(b) (8)

(33)

Intensity based registration

M(IT, J) =H(IT) +H(J)−H(IT, J) =H(J)H(J|IT) (9) where the conditional entropy

H(J|IT) =−PaPbpIT,J(a, b) logpJ|IT(b|a).

Mutual information measures the amount of uncertainty about J minus the uncertainty aboutJ when IT is known, that is to say, how much we reduce the uncertainty aboutJ after observing IT. It is maximized when the two images are aligned. [8]

Maximizing M means finding a transformations Tthat makesIT the best predictor for J. Or, equivalently, knowing the intensity IT(u, v) allows us to perfectly predictJ(u, v).

(34)

Optimization procedure

Pixel-based similarity measures need an iterativeapproach where an initial estimate of the transformation is gradually refined using the gradient and, depending on the method, also the Hessian of the similarity measure with respect to the parametersθ

Possible algorithms: gradient descent, Newton-Raphson, Levenberg-Marquardt

Problem of the “local minima”→ stochastic optimization, line search, trust region, multi-resolution (first low resolution and then higher resolution)

Validation →visual inspection, alignment of manually segmented objects, value of similarity measure

(35)

Summary

1 Introduction

2 Geometric global transformations

3 Image warping and interpolations

4 Intensity based registration

5 Landmark based registration Affine registration

Procrustes superimposition

Non-linear registration (small displacement) Non-linear registration (diffeomorphism)

(36)

Anatomical landmarks

Definition: anatomical landmark

An anatomical landmark is a point precisely defined onto an anatomical structure which establishes a correspondence among the population of homologous anatomical objects

Figure 3:Example of manually labeled landmarks

(37)

Anatomical landmarks

Given a set ofN landmarksi defined onI andN corresponding landmarksj defined onJ, we seek to minimize:

θ= arg min

θ N

X

p=1

||T(ip)−jp||2 (10)

whereT(ip) means that we apply the deformationT to thep-th landmarkip

We suppose that all landmarks belong toR2 (it would be similar for R3)

The metric is the Euclidean norm (or Frobenius when using matrices)

(38)

Landmark based affine registration

We define:

T(ip) =Aip+t ∀i∈[1, N] (11) Thus,θ=A, t

A, t= arg min

A,t

f(A, t) =

N

X

p=1

||Aip+tjp||2 (12) From which it results:

∂f

∂t = 2

N

X

p=1

(Aip+tjp) = 0→t = ¯jA¯i (13) We notice that if we center the data (i.e. ˜ip=ip−¯iand˜jp=jp−¯j) then t = 0. The criterion thus becomesf =PNp=1||A˜ip−˜jp||2

(39)

Landmark based affine registration

Now we differentiate wrtA. :

∂f

∂A =

N

X

p=1

∂||A˜ip||2

∂A −2∂hA˜ip,˜jpi

∂A

=2

N

X

p=1

A˜ip˜iTp −˜jp˜iTp = 2

N

X

p=1

(A˜ip−˜jpiTp = 0

(14)

It results:

A =

N

X

p=1

˜jp˜iTp

N

X

p=1

˜ip˜iTp

−1

(15)

The matrix PN ˜i ˜iTis invertible if the landmarks are not all

(40)

Landmark based affine registration

From a computational point of view, it is easier to use homogeneous coordinates:

T= arg min

T

||xT−y||2F (16) where we define

x1 y1 1 0 0 0 ...

xN yN 1 0 0 0 0 0 0 x1 y1 1

...

0 0 0 xN yN 1

| {z }

x

a1 a2 t1

a3 a4 t2

| {z }

T

u1

... uN

v1 ... vN

| {z }

y

(17)

T= (xTx)−1xTy (18)

(41)

Procrustes superimposition (similarity transformation)

We seek to minimize:

(s, R, t) = arg min

s,R,t N

X

p=1

||sRip+tjp||22 (19) wheresis a uniform scaling factor (scalar) andR is a rotation matrix.

The translation vector tis, as before, equal tot= ¯jN1 PNp=1sRip. Thus, by centering the data, we obtain:

(s, R)= arg min

s,R

f(s, R) =

N

X

p=1

||sR˜ip−˜jp||22=||sXR−Y||2F (20)

Remember that: PN ||˜ip−˜jp||2 =||X−Y||2 where

(42)

Procrustes superimposition (similarity transformation)

We minimize wrt s:

f(s, R)∝s2||XR||2F −2shXR, YiF

∂f(s, R)

∂s = 2s||X||2F −2hXR, YiF s = hXR, YiF

||X||2F

(21)

where we use the fact thatRTR=RRT =I. Substituting intof: R = arg min

R

f(R) =−(hXR, YiF)2

||X||2F

= arg max

R

|hXR, YiF|=|hR, XTYiF|

= arg max

R

|hR, UΣVTiF|=|hUTRV,ΣiF|=|hZ,ΣiF|

(22)

where we use the SVD decomposition XTY =UΣVT and the definition of the trace hXR, YiF =Tr(RTXTY) =hR, XTYiF

(43)

Procrustes superimposition (similarity transformation)

Notice thatZ =UTRV is an orthogonal matrix since it is the product of orthogonal matrices. ThusZTZ =I andzjTzj = 1. It follows thatzij ≤1.

R = arg max

R

|hZ,ΣiF|=|Tr(ΣTZ)|=

=|Tr "

σ1 0 0 σ2

# "

z11 z12 z21 z22

#!

|=

2

X

d=1

σdzdd

2

X

d=1

σd

(23)

The maximum is obtained whenzdd= 1 ∀d, which means when:

Z =UTRV =IR=U VT (24) In order to be sure thatR is a rotation matrix (det(R) = 1), we compute [5]:

"

1 0 #

(44)

Procrustes superimposition (similarity transformation)

To recap [5]:

R =U SVT s = hR, Y XTiF

||X||2F = Tr(SΣ)

||X||2F t = ¯j− 1

N

N

X

p=1

sRip

(26)

(45)

Non-linear registration (small displacement)

We define the deformation of a pixel at location z= (x, y) as:

T(z) =z+v(z) with v(z) =

N

X

p=1

K(z, ipp (27)

whereK(z, ip) is a kernel, for instanceK(z, ip) = exp (−||z−iλ2p||22) andαp is a 2D vector which need to be estimated.

The displacement at any pointz depends on the displacement of the neighbor landmarks

(46)

Non-linear registration (small displacement)

We minimize

α = arg min

α f(α;λ) =

N

X

p=1

||ip+v(ip)−jp||22

=

N

X

p=1

||ip+ (

N

X

d=1

K(ip, idd)−jp||22

=||i+j||2F

(28)

whereK=

1 K(i1, i2) ... K(i1, iN) K(i2, i1) 1 ... K(i2, iN)

... ... ... ...

K(iN, i1) K(iN, i2) ... 1

and α= [αT1;...;αTN]

(47)

Non-linear registration (small displacement)

By differentiating wrtα:

∂||i+j||2F

∂α = 2KT(i+j) = 0 α=K−1(j−i)

(29) The matrix Kmight not always be invertible (ifλis too big for instance). We need to regularize it. A possible solution is to use a Tikhonov matrix such asαTKα, thus obtaining:

α= arg min

α f(α;λ, γ) =||i+j||2F +γαT (30)

∂f(α;λ, γ)

∂α = 2KT(i+j) + 2γKα= 0

(31)

(48)

Non-linear registration (small displacement)

Why only small displacement ? → We could approximate the inverse of T(z) as T−1(z0) =z0v(z0) obtaining:

T(T−1(z0)) =z0v(z0) +v(z0v(z0))6=z0 (32) The error is small only ifv(z0v(z0))−v(z0) is small, which is the case only when the displacement is small !

We might have intersections, holes or tearing in area where the displacement is large

(49)

Small-displacement registration

Figure 4:First row: forward and inverse transformation. The first one is a one-to-one mapping whereas the second one presents intersections. Second row:

(50)

Large-displacement registration: diffeomorphism

Instead than using small-displacement transforms we should use diffeomorphisms

A diffeomorphism is a differentiable (smooth and continuous) bijective transformation (one-to-one) with differentiable inverse (i.e.

nonzero Jacobian determinant)

Using diffeomorphic transformations we can preserve the topology and spatial organization, namely no intersection, folding or shearing may occur

(51)

Diffeomorphism

Figure 5:First row: forward and inverse diffeomorphic transformation (both are one-to-one). Second row: composition of forward and inverse transformations.

(52)

Diffeomorphism

One of the most used algorithm in medical imaging to create diffeomorphic deformations is called LDDMM: Large Deformation Diffeomorphic Metric Mapping

Deformations are built by integrating a time-varying vector fieldvt(x) overt∈[0,1]wherevt(x) represents the instantaneous velocity of any pointx at time t(and no more a displacement vector !)

(53)

Diffeomorphism

Callingφt(x) the position of a point at time twhich was located in x at time t= 0, its evolution is given by: ∂φ∂tt(x) =vtt(x))with φ0(x) =x

Integrating ∂φ∂tt(x) =vtt(x))between t∈[0,1]produces a flow of

(54)

Diffeomorphism

(55)

Diffeomorphism

Figure 6:Image taken from T. Mansi - MICCAI - 2009

(56)

Diffeomorphism

http://www.deformetrica.org/

(57)

Diffeomorphism

The flow of diffeomorphisms produces a dense deformation of the entire 3D space. We know how to deform every point in the space.

The last diffeomorphism is parametrised by the initial velocityv0

From a mathematical point of view, to register a source image or meshI to a target image or mesh J we minimize:

arg min

v0

D(φ1(I), T) +γReg(v0) (33) whereDis a data term, Regis a regularization term and γ their trade-off. We use an optimization scheme (e.g. gradient descent) to estimate the optimal deformation parameters v0.

(58)

References

1 J. Modersitzki (2004). Numerical methods for image registration.

Oxford university press

2 J. V. Hajnal, D. L.G. Hill, D. J. Hawkes (2001). Medical image registration. CRC press

3 G. Wolberg (1990). Digital Image Warping. IEEE

4 The Matrix Cookbook

5 S. Umeyama (1991). Least-squares estimation of transformation parameters.... IEEE TPAMI

6 S. Durrleman et al. (2014). Morphometry of anatomical shape complexes ... . NeuroImage.

7 J. Ashburner (2007). A fast diffeomorphic image registration algorithm. NeuroImage

8 J. P. W. Pluim (2003). Mutual information based registration of medical images: a survey. IEEE TMI

Références

Documents relatifs

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

Recently, Zentner [20] showed that the fundamental group of any integral homology 3-sphere M admits an irreducible SL(2, C )-representation, and therefore, it is worth studying RT

The 2D view of this line is depicted in Fig. 5B) and illustrates where the maximum acceleration factor for each image size is located in practice for this particular sequence to

For notational semplicity, in what follows, whenever such a norm arises, we assume that we choose a fixed norm from the class of all those equivalent norms.. For

In documentation, just as in history, it is possible to distinguish sources , which indicate the type of information (press, administrative documents, the web, the radio,

[Stefan Wörz, Karl Rohr Localization of anatomical point landmarks in 3D medical images by fitting 3D parametric intensity models, Medical Image Analysis Volume 10, Issue 1,

The most widely used applications of image registration involve determining the rigid body transformation that aligns 3D tomographic images of the same subject acquired using

The problem here consists in extracting the cleavage facets from a fractured surface in steel (MEB image).. A rather complex combination of contrast and distance functions is used