Transcript
Page 1: Using Plastimatch for Deformable Registration

-1-Massachusetts General Hospital National Alliance for Medical Image Computing

Using Plastimatch forDeformable Registration

Gregory C. Sharp

Department of Radiation Oncology

Massachusetts General Hospital

3D Slicer Training Compendium

Tutorial Version 1.0, Apr 26, 2010

Page 2: Using Plastimatch for Deformable Registration

-2-Massachusetts General Hospital National Alliance for Medical Image Computing

Learning Objective

This tutorial is a step-by-step guide, and includes:

1) Downloading the Plastimatch extension to 3D Slicer

2) Loading the sample images

3) Running deformable registration on the CPU

4) Running deformable registration on the GPU

5) Inspecting registration quality in 3D Slicer

The plastimatch web site is: http://plastimatch.org

Page 3: Using Plastimatch for Deformable Registration

-3-Massachusetts General Hospital National Alliance for Medical Image Computing

Prerequisites

This tutorial assumes that you have already downloaded the sample data. You can get the data from here:

http://forge.abcd.harvard.edu/gf/download/frsrelease/85/1004/rider-lung-images.tar.gz

Page 4: Using Plastimatch for Deformable Registration

-4-Massachusetts General Hospital National Alliance for Medical Image Computing

Part 1: Downloading the Plastimatch Extension

Page 5: Using Plastimatch for Deformable Registration

-5-Massachusetts General Hospital National Alliance for Medical Image Computing

(This part of the tutorial might not workcorrectly, pending the Slicer 3.6 release)

Page 6: Using Plastimatch for Deformable Registration

-6-Massachusetts General Hospital National Alliance for Medical Image Computing

Start up 3D Slicer

Choose “Extension Manager”from the “View” menu

Page 7: Using Plastimatch for Deformable Registration

-7-Massachusetts General Hospital National Alliance for Medical Image Computing

Click “Next”

Page 8: Using Plastimatch for Deformable Registration

-8-Massachusetts General Hospital National Alliance for Medical Image Computing

Find the plastimatch plugin,and click “Select”Then, click “Download and Install”

Page 9: Using Plastimatch for Deformable Registration

-9-Massachusetts General Hospital National Alliance for Medical Image Computing

The “Status” should become green

Click “Next”

Page 10: Using Plastimatch for Deformable Registration

-10-Massachusetts General Hospital National Alliance for Medical Image Computing

Restart 3D Slicer

Page 11: Using Plastimatch for Deformable Registration

-11-Massachusetts General Hospital National Alliance for Medical Image Computing

Part 2: Loading the example data

Page 12: Using Plastimatch for Deformable Registration

-12-Massachusetts General Hospital National Alliance for Medical Image Computing

Start up 3D Slicer

Page 13: Using Plastimatch for Deformable Registration

-13-Massachusetts General Hospital National Alliance for Medical Image Computing

Choose “Add data” from the menu

Page 14: Using Plastimatch for Deformable Registration

-14-Massachusetts General Hospital National Alliance for Medical Image Computing

Choose “Add files” in dialog box

Page 15: Using Plastimatch for Deformable Registration

-15-Massachusetts General Hospital National Alliance for Medical Image Computing

Select (highlight) both example files:fix.nrrd and mov.nrrd

Then click “Open”

Page 16: Using Plastimatch for Deformable Registration

-16-Massachusetts General Hospital National Alliance for Medical Image Computing

Click “Apply”

Page 17: Using Plastimatch for Deformable Registration

-17-Massachusetts General Hospital National Alliance for Medical Image Computing

The images are now loaded

Page 18: Using Plastimatch for Deformable Registration

-18-Massachusetts General Hospital National Alliance for Medical Image Computing

Part 3: Visualizing the example data

Page 19: Using Plastimatch for Deformable Registration

-19-Massachusetts General Hospital National Alliance for Medical Image Computing

We want to look at how well the images are aligned before we start

3D Slicer can view a “foreground” (F) and “background” (B) image at the same time. After loading, (F) is set to “None” in all views.

Page 20: Using Plastimatch for Deformable Registration

-20-Massachusetts General Hospital National Alliance for Medical Image Computing

Click, and select “fix” as the foreground image.Repeat for all three views.

Page 21: Using Plastimatch for Deformable Registration

-21-Massachusetts General Hospital National Alliance for Medical Image Computing

Use the “Manipulate Slice Views” slider to blend between foreground and background

Page 22: Using Plastimatch for Deformable Registration

-22-Massachusetts General Hospital National Alliance for Medical Image Computing

We can now see the alignment of the images. To see it better, we need to increase the viewport size.

Click on the layout chooser button

Page 23: Using Plastimatch for Deformable Registration

-23-Massachusetts General Hospital National Alliance for Medical Image Computing

Choose “Red slice only”

Page 24: Using Plastimatch for Deformable Registration

-24-Massachusetts General Hospital National Alliance for Medical Image Computing

Much better! Next we're going to try color blending. Choose the “Volumes module.

Page 25: Using Plastimatch for Deformable Registration

-25-Massachusetts General Hospital National Alliance for Medical Image Computing

We're going to modify the color of the moving volume. Choose “mov”as the active volume.

Page 26: Using Plastimatch for Deformable Registration

-26-Massachusetts General Hospital National Alliance for Medical Image Computing

Set it to “Warm Tint 1”

Page 27: Using Plastimatch for Deformable Registration

-27-Massachusetts General Hospital National Alliance for Medical Image Computing

Page 28: Using Plastimatch for Deformable Registration

-28-Massachusetts General Hospital National Alliance for Medical Image Computing

Part 4: Running Plastimatch

Page 29: Using Plastimatch for Deformable Registration

-29-Massachusetts General Hospital National Alliance for Medical Image Computing

Go back to the module selector

Page 30: Using Plastimatch for Deformable Registration

-30-Massachusetts General Hospital National Alliance for Medical Image Computing

Choose “B-spline deformableregistration” from the “Plastimatch” section

Page 31: Using Plastimatch for Deformable Registration

-31-Massachusetts General Hospital National Alliance for Medical Image Computing

Set “Fixed Volume” to “fix”Set “Moving Volume” to “mov”

Set “Output Volume” to “Create New Volume”

Page 32: Using Plastimatch for Deformable Registration

-32-Massachusetts General Hospital National Alliance for Medical Image Computing

Click “Apply”

(You might need to scroll down)

Page 33: Using Plastimatch for Deformable Registration

-33-Massachusetts General Hospital National Alliance for Medical Image Computing

Check the status in the status bar

With a Tesla C1060 GPU, the registration takes 6 seconds

A laptop might take 1 or 2 minutes

Page 34: Using Plastimatch for Deformable Registration

-34-Massachusetts General Hospital National Alliance for Medical Image Computing

When the registration is complete, the warped image is automatically displayed

Page 35: Using Plastimatch for Deformable Registration

-35-Massachusetts General Hospital National Alliance for Medical Image Computing

You have to set the foreground view again to see the registration quality

Page 36: Using Plastimatch for Deformable Registration

-36-Massachusetts General Hospital National Alliance for Medical Image Computing

Your results should look like this.

Page 37: Using Plastimatch for Deformable Registration

-37-Massachusetts General Hospital National Alliance for Medical Image Computing

Part 5: Optimizing Your Registration

Page 38: Using Plastimatch for Deformable Registration

-38-Massachusetts General Hospital National Alliance for Medical Image Computing

We're going to try to improve the registration result.

Page 39: Using Plastimatch for Deformable Registration

-39-Massachusetts General Hospital National Alliance for Medical Image Computing

Click on “Enable Stage 2”Then click “Apply”

This takes 12 seconds on the Tesla C1060. Might be 3-4 minutes on a laptop.

Page 40: Using Plastimatch for Deformable Registration

-40-Massachusetts General Hospital National Alliance for Medical Image Computing

Like before, the output is automatically loaded.

Page 41: Using Plastimatch for Deformable Registration

-41-Massachusetts General Hospital National Alliance for Medical Image Computing

Your results should look like this.

Note improvement in the alignment of the mediastinum

Page 42: Using Plastimatch for Deformable Registration

-42-Massachusetts General Hospital National Alliance for Medical Image Computing

Part 6: Advanced Plastimatch Options

Page 43: Using Plastimatch for Deformable Registration

-43-Massachusetts General Hospital National Alliance for Medical Image Computing

By default, plastimatch optimizes Mean-squared error (MSE).

But you can choose Mutual Information (MI) instead

Page 44: Using Plastimatch for Deformable Registration

-44-Massachusetts General Hospital National Alliance for Medical Image Computing

By default, plastimatch uses the GPU. But you can choose to use the CPU instead.

Plastimatch CPU uses OpenMP to take advantage of modern multi-core systems

However, in Plastimatch 1.4, mutual information does not take advantage of the GPU, nor is it multi-threaded.

Page 45: Using Plastimatch for Deformable Registration

-45-Massachusetts General Hospital National Alliance for Medical Image Computing

In our tutorial, the images were sufficiently well aligned that we could use B-spline registration.

But if they are not well aligned, you can do a “rough alignment” using translation, rigid, or affine registration.

Click “Enable Stage 0” to enable the rough alignment.

Page 46: Using Plastimatch for Deformable Registration

-46-Massachusetts General Hospital National Alliance for Medical Image Computing

For each stage, you can modify the subsampling rate, grid size, and maximum iterations

Decreasing the subsampling rate improves accuracy

Increasing the subsampling rate improves reliability

Page 47: Using Plastimatch for Deformable Registration

-47-Massachusetts General Hospital National Alliance for Medical Image Computing

Decreasing max iterations improves registration speed

Increasing max iterations improves registration accuracy

Page 48: Using Plastimatch for Deformable Registration

-48-Massachusetts General Hospital National Alliance for Medical Image Computing

Decreasing the grid spacing improves accuracy

Increasing the grid spacing improves reliability

Page 49: Using Plastimatch for Deformable Registration

-49-Massachusetts General Hospital National Alliance for Medical Image Computing

Conclusion

Congratulations! You have completed the tutorial.

Please send corrections or suggestions to:

Greg [email protected]

Or visit the web page at:

http://plastimatch.org

Page 50: Using Plastimatch for Deformable Registration

-50-Massachusetts General Hospital National Alliance for Medical Image Computing

National Alliance for Medical Image ComputingNIH U54EB005149

Acknowledgements

National Institutes of HealthNIH / NCI 6-PO1 CA 21239Federal share of program income earned by MGH on C06CA059267

Progetto Rocca FoundationA collaboration between MIT and Politecnico di Milano


Recommended