71
NA-MIC National Alliance for Medical Image Computing http://na-mic.org Slicer Advanced Training 11: Registration Sonia Pujol, Ph.D. Surgical Planning Laboratory Radiology, Brigham and Women’s Hospital Harvard Medical School Randy Gollub, M.D., Ph.D. Athinoula A. Martinos Center Psychiatry, Massachusetts General Hospital Harvard Medical School

Registration-3771

Embed Size (px)

DESCRIPTION

http://hdl.handle.net/1926/531

Citation preview

Page 1: Registration-3771

NA-MICNational Alliance for Medical Image Computing http://na-mic.org

Slicer Advanced Training 11: RegistrationSonia Pujol, Ph.D.

Surgical Planning LaboratoryRadiology, Brigham and Women’s Hospital

Harvard Medical School

Randy Gollub, M.D., Ph.D. Athinoula A. Martinos Center

Psychiatry, Massachusetts General Hospital Harvard Medical School

Page 2: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Acknowledgments

National Alliance for Medical ImageComputingNIH U54EB005149

Neuroimage Analysis Center NIH P41RR013218

Surgical Planning Laboratory, Brigham and Women’s HospitalThanks to Steve Pieper, Ph.D.

Page 3: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Disclaimer

It is the responsibility of the user

of 3DSlicer to comply with both the

terms of the license and with the

applicable laws, regulations and rules.

Page 4: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Motivation

Registration algorithms bring

multiple image data sets into

spatial alignment, in order to

achieve anatomical agreement.

Mutual information techniques

can be applied to a wide variety

monomodality and multimodality

images.

Dataset 1

Dataset 2

Page 5: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Goal of the tutorial

Guiding you step-by-step through the process of automatically registering two structural MR datasets using a mutual information algorithm.

In this tutorial, an example of registration of a pre-operative MR dataset with an intra-operative MR dataset is used.

Page 6: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Materials

• Software: Slicer 2.7

• Dataset: RegistrationSample.zip

http://www.namic.org/Wiki/index.php/Slicer:Workshops:User_Training_101

Page 7: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Processing pipeline

Automatic registration

Final Transform

Semi-automatic refinement of the

registration

no

yes

Manual registration

Initial transform

Result OK ?

(Step 2)

(Step 3)

(Step 4)

Data loading

(Step 1)

Page 8: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Data description

Dataset 1 (I1): 1.5 Tesla diagnostic MR scanner

Regsample1/ : reg.nhdr and reg.img (27 slices)

Dataset 2 (I2): 0.5 Tesla intraoperative MR scanner

Regsample2/ : I.xxx (27 slices)

The datasets are images of the same subject, acquired with different scan sessions each using a different MR Scanner. The datasets are located in the directories /regsample1 and /regsample2 in the archive RegistrationSample.zip.

Page 9: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Overview

• Step 1: Load data and visualize mis-alignment • Step 2: Manually define the initial transformation• Step 3: Complete the registration by using the mutual

information algorithm• Step 4: Refine the registration by using the semi-automatic

mode (optional)• Step 5: Apply the registration transform

Page 10: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Loading dataset 1

Click on Add Volume in the Main Panel

Page 11: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Loading dataset 1

Select Properties Nrrd Reader

Browse to load the file reg.nhdr Click on Apply to load the volume

Page 12: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Loading dataset 1

Slicer loads the volume reg.nhdr

Page 13: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Loading dataset 2

Click on AddVolume to load the dataset 2

Page 14: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Loading dataset 2

Browse to load the image I.001

Click on Apply to load the volume

Select the Properties Basic

Page 15: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Loading dataset 2

Slicer loads the volume I

Page 16: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Initial mis-alignment

Left-click on Fg to display the volume reg-nhdr in foreground.

Page 17: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Initial mis-alignment

Click on Fade and use the slider to visualize the initial mis-alignment between the two volumes

Page 18: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Initial mis-alignment

Observe the misalignment on the occipital lobe (axial slice 0) using the Fade function.

I2

I1

Page 19: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Initial mis-alignment

Observe the misalignment on the boundaries between the cerebrum and the cerebellum (sagittal slice 0).

I2

I1

Page 20: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Initial mis-alignment

Observe the misalignment on the lateral edge of the brain (axial slice 30).

I2

I1

Page 21: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Overview

• Step 1: Load data and visualize mis-alignment • Step 2: Manually define the initial transformation• Step 3: Complete the registration by using the mutual

information algorithm• Step 4: Refine the registration by using the semi-automatic

mode (optional)• Step 5: Apply the registration transform

Page 22: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Rigid Transformation

• A rigid transform T is an image coordinate transformation composed of a translation vector (Tx, Ty, Tz) and a rotation matrix defined by three Euler angles (θ,Φ,Ψ).

),,,,,( TzTyTxfT

Page 23: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Rigid Transformation

),,,,,(21 TzTyTxfTT imageSpaceimageSpace

Image Space 1 Image Space 2

I1 T(I1)

21 imageSpaceimageSpaceT

Page 24: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

By applying the registration transform to the initial volume I1,

we’ll generate a new volume spatially aligned with the volume I2. This allows the extraction of complementary information from the two volumes.

Rigid Transform

)(~

11 ITI

Image Space 1 Image Space 2

I2I1

1

~I

Page 25: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Adding a transformation

To perform an initial manual registration between the two volumes, select the volume reg-nhdr and click on Add Transform.

You will manually define the parameters of the initial registration matrix by using the mouse to superimpose the two volumes.

Page 26: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Adding a transformation

Slicer adds the transform transform0 defined by the Identity matrix manual0.

Double-click on manual0 to display the translation and rotation elements.

Page 27: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Adding a transformation

Slicer displays the three translation parameters and the three rotation angles of the matrix manual0 (identity).

The six degrees of freedom are defined in the anatomical directions Left-Right (LR), Posterior-Anterior (PA) and Inferior-Superior (IS).

Page 28: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Processing pipeline

Automatic registration

Final Transform

Semi-automatic refinement of the

registration

no

yes

Manual registration

Initial transform

Result OK ?

(Step 2)

(Step 3)

(Step 4)

Data loading

(Step 1)

Page 29: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Defining an initial transformation

Click on Local and set the Mouse Action to Translate

Page 30: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Defining an initial transformation

Hold the left mouse button down while clicking in the in the Axial view, and translate the slice in the anterior direction by 10 mm.

Page 31: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Defining an initial transformation

Slicer displays the value of the applied manual translation in the PA direction.

Page 32: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Defining an initial transformation

Click on Rotate to define the rotation component of the initial transformation.

Page 33: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Defining an initial transformation

Hold the left mouse button down while clicking in the coronal view. Use the mouse to rotate the slice until you see the value of 3 degrees (counterclockwise) in the coronal view.

Page 34: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Defining an initial transformation

Slicer displays the value of the applied manual rotation.

Page 35: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Overview

• Step 1: Load data and visualize mis-alignment • Step 2: Manually define the initial transformation• Step 3: Complete the registration by using the mutual

information algorithm• Step 4: Refine the registration by using the semi-automatic

mode (optional)• Step 5: Apply the registration transform

Page 36: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Similarity Measure

I2T(I1)

The registration algorithm computes the parameters of the transformation T that optimizes a measure of similarity between the target image I2 and the initial image that has been manually transformed T(I1).

T

Page 37: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Mutual information

•The mutual information MI is a measure of similarity of the images I2 and T(I1) based on the entropy H (*):

MI(I2,T(I1))= H(I2) + H(T(I1)) – H(I2 ,T(I1))

(*) Wells S, Viola P, Kikinis R. Multi-modal volume registration by maximization of mutual information. Medical Robotics and Computer-assisted Surgery 1995, 55-62.

Collignon A, Maes F, Delaere D, Vandermeulen D, Suetens P, Marchal G. Automated multimodality image registration based on information theory. Information Processing in Medical Imaging, 1995, 263-274.

•The automatic alignment of the images I2 and T(I1) is achieved by maximizing the mutual information MI(I2,T(I1)).

Page 38: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Processing pipeline

Final Transform

Semi-automatic refinement of the

registration

no

yes

Manual registration

Initial transform

Result OK ?

(Step 2)

(Step 3)

(Step 4)

Data loading

(Step 1)

Automatic registration

Page 39: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Automatic registration

Select the panel Auto in the module Alignments.

Set the Volume to Move to reg-nhdr (I1) and the Reference Volume to I (I2).

Select the Registration Mode to Intensity

Page 40: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Automatic registration

Slicer has two modes for intensity based registration:

•Semi-automatic mode: Fine or Coarse

•Automatic mode: Good and Slow, or Very Good and Very Slow

Page 41: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Automatic registration

•Semi-automatic mode (Fine or Coarse): the registration goes on in the background, and the transformation can be interactively manipulated during the process.

The user has to stop manually this mode to obtain the final value of the registration matrix.

Page 42: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Automatic registration

•Automatic mode (Good and Slow, or Very Good and Very Slow): the registration goes on in the background, and repeats until a predefined criterion is reached* set in the parameters.

* The default parameters can be modified to adjust the specificity of your data.

Page 43: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Choose the Run Objective ‘Good and Slow’ and click on the button Start.

Automatic registration

Page 44: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Automatic registration

A Rigid Registration window appears, and Slicer displays the progress of the registration process.

Page 45: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Registration result

Slicer displays the result of the automatic registration of the two volumes.

Page 46: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Registration result

Slice through the volume to visualize the result of the registration

Page 47: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Observe the results of the registration in the occipital bone (axial slice 0).

I2

T(I1)

Registration result

Page 48: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Observe a better alignment of the boundaries between the cerebrum and the cerebellum (sagittal slice 0).

I2

T(I1)

Registration result

Page 49: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Registration result

Observe the results of the registration on the lateral edge of the brain (axial slice 30).

I2

T(I1)

Page 50: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Registration result: summary

Before registration

After registration

Page 51: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Registration result

Click on the Props tab to display the parameters of the resulting rigid transformation T between the two datasets.

Page 52: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Overview

• Step 1: Load data and visualize mis-alignment • Step 2: Manually define the initial transformation• Step 3: Complete the registration by using the mutual

information algorithm• Step 4: Refine the registration by using the semi-automatic

mode (optional)• Step 5: Apply the registration transform

Page 53: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Registration result

Note a tilt and a misalignment in the Inferior-Superior direction: observe the difference in shape of the ventricles in T(I1) and I2.

I2

T(I1)

Page 54: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Registration result

Note a misalignment in the Inferior-Superior direction: observe the difference in white matter localization on the middle line in T(I1) and I2.

I2

T(I1)

Page 55: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Processing pipeline

Automatic registration

Final Transform

Semi-automatic refinement of the

registration

no

yes

Manual registration

Initial transform

Result OK ?

(Step 2)

(Step 3)

(Step 4)

Data loading

(Step 1)

Page 56: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Refine the registration

Click on the tab Auto and select the mode Coarse to refine the result of the registration.

Click on Start to launch the algorithm.

Page 57: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Refine the registration

Left-click in the sagittal view, and slightly move the slice with the mouse to correct the tilt.

Page 58: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Refine the registration

Left-click in the saggital view and slightly move the slice down with the mouse to correct the vertical misalignment

Page 59: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Refine the registration

Observe Slicer iterating the registration algorithm, and updating the position of the volume in the three anatomical views.

Iterate the process until you are satisfied with the alignment of the two volumes.

Page 60: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Refine the registration

Click on Stop to terminate the semi-automatic registration process

Information on details and performances of the registration algorithm are available at http://www.itk.org/HTML/MutualInfo.htm

Page 61: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Example of registration result

Before registration

After automatic registration

The results might differ very slightly: these pictures show an example of a good outcome.

After semi-automatic refinement

Page 62: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Processing pipeline

Automatic registration

Final Transform

Semi-automatic refinement of the

registration

no

yes

Manual registration

Initial transform

Result OK ?

(Step 2)

(Step 3)

(Step 4)

Data loading

(Step 1)

Page 63: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Overview

• Step 1: Load data and visualize mis-alignment • Step 2: Manually define the initial transformation• Step 3: Complete the registration by using the mutual

information algorithm• Step 4: Refine the registration by using the semi-automatic

mode (optional)• Step 5: Apply the registration transform

Page 64: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

By applying the registration transform to the initial volume I1,

we’ll generate a new volume spatially aligned with the volume I2. This allows the extraction of complementary information from the two volumes.

Apply the registration transform

)(~

11 ITI

Image Space 1 Image Space 2

I2I1

1

~I

Page 65: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Apply the registration transform

Click on ModulesExamples and select the module TransformVolume.

In the following section, we’ll use the transform Volume module to resample the initial volume reg-nhdr through the transform transform0 calculated by the registration.

Page 66: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Select the Reference Volume reg-nhdr and the Resample Mode ReferenceVolume

Choose the Interpolation Mode Cubic

Click on Show Preview to visualize a preview of the transformed volume.

Apply the registration transform

Page 67: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

A pop-up window displays a preview of the resampled volume, after applying transform0.

Click on DoTransform to apply the final transform calculated through the registration to the volume reg-nhdr.

Apply the registration transform

Page 68: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Slicer generates the final volume xformed-reg-nhdr, which has the same orientation and spacing as the volume reg-nhdr.

Apply the registration transform

(See ‘SlicerTraining7: Saving Data’ to save the volume on disk.)

Page 69: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Conclusion

• Registration of a pre-operative dataset with an intra-operative dataset

• Initial registration by manual alignment

• Automatic and semi-automatic registration by maximization of mutual information

Page 70: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Appendix: TransformVolume

The TransformVolume module offers the possibility to resample several volumes using the same transform. All the volumes will then be aligned to the same voxel space.

Page 71: Registration-3771

Pujol S., Gollub R.National Alliance for Medical Image Computing

Appendix: Transform Volume Exemplar Case

The Expectation-Maximization

(EM) algorithm* performs

automatic segmentation of

brain structures from MR data.

Multiple channel resampling

can be accomplished using the

TransformVolume module.

atlas

T1 normalized

T(T2) normalized

(*) See SlicerTraining11:EMBrainAtlasClassifier.

White matter Grey matter CSF