MRI Registration Using Mutual Information

This application shows how to interface VTK, The Visualization Toolkit, to Insight. The application registers datasets using the Mutual Information Algorithm of Viola and Wells. The data is read using VTK, normalized to a unit variance and zero mean and then passed to Insight using itk's Import facility. Once the registration completes,  the transform produced by Insight is converted to a VTK transform. A VTK TCL script reads the transform and displays the two data sets side-by-side. Another Insight Application approaches similar problems by using the multi-resolution framework in Insight.

What is the Purpose of this Application?
The application illustrates several concepts:
  1. How to use the itk::ImageToImageRigidMutualInformationGradientDescentRegistration to register medical datasets. This class is relatively easy to use. However, the algorithm has several parameters that affect its performance. We have performed a design of experiments analysis to determine the sensitivity and performance of the algorithm on Computed Tomography (CT), Magnetic Resonance Imaging (MRI) and Positron Emission Computed Tomography (PET).
  2. How to build an application with CMake that combines VTK and ITK.
  3. How combine VTK and ITK classes in the same application.
The Pipeline

Getting Started
You will need to build Insight. You will also need to build  VTK4.2 or later. In addition, this application requires two changes to your CMake configuration:
  • BUILD_EXAMPLES:BOOL=ON and run cmake.
  • VTK_BINARY_PATH:PATH=location_of_your VTK binary tree and run cmake
You may want to download the sample dfata for this application. There are two MRI datasets, one is from a 1.5T system and the other is from a 3T system.

A Word About the Mutual Information Parameters
We have found it necessary to "normalize" the datasets. We compute the mean and variance of both datasets and then shift and scale the data. Also, we use a multi-resolution approach, running the algorithm from a resolution of 32 up to 256 (for MRI) and 512 (for CT). Once the data is normalized, we use the following parameters for all of our applications.
  • learningRate - .0005, the relaxation factor for the optimization.
  • standardDeviation - 2, the std for the Parzen Window density estimation
  • numberOfSamples - 50, the number of random samples acquired from the target and source dataset.
  • numberOfIterations - 2000, the number of optimization steps.
  • translateScale - 100, the relaxation multiplier for the translate component of the datasets.
To Use this Application
The applications comes in two parts: a C++ program and a tcl script. The C++ program performs the registration using a combination of VTK and ITK. The tcl script reads the transform created by the C++ program and display the two datasets side-by-side.
  • The registration application is called MRIRegistration, accepting the following command line arguments:
    • --study1Prefix FILEPREFIX
    • --study1Resolution I,J,K
    • --study1Spacing X,Y,Z
    • --study2Prefix, --study2Resolution, --study2Spacing, as above
    • --translateScale S
    • --shrink I,J,K
    • --learningRate N
    • --standardDeviation S
    • --numberOfSamples N
    • --numberOfIterations N
    Each run of the program produces a file reg.tcl that contains the study information and the transformation in a form that VTK can read. We create shell script or batch files to run the program. The program expects a guess on standard input and outputs the final guess to standard output. Thus, scripts multi-resolution runs can be chained together. Here is a sample Unix shell script and a sample Windows batch file that works with the distributed data.
  • The display program is a VTK TCL scrip called MultiCompareAD.tcl and is run by typing:
    vtk MultiCompareAD.tcl reg.tcl.
Results
The following images show results from the multi-field MRI data. The registration was performed on a Dell Latitude laptop, 750 mhz, 512meg memory. The total elapsed time for all resolutions was 48 seconds.

results from multi-field MRI data

The upper left image is a checkerboard with alternating study 1 and study 2 images. The upper right is a difference image. The lower left is study 1, S to align with the lower right image, study 2.
A small interface lets you control the slice, window/level and number of divisions in the checkerboard display.

interface


Go back to Applications.