Registration

Part 5: Registering an MR Volume to a CT Volume

Necessary Files

Your own files, or:

Optional Files (premade Model files use example files above)

The purpose of this tutorial is to teach you how to perform a multimodal image registration. In this tutorial, the MR volume will be adjusted using GradientDescent,
MutualInformationMetric, 3DEulerTransforms, and ImageRegistration blocks to perform the registration. This workflow is much more complicated in comparison to the earlier workflows created to prepare the volumes for this task. Below is a list of the required blocks and the libraries in which they reside.

  • SimITKLibrarySS3D.mdl Library:
    • 5 x itkReaderSS3D (3 for MR, 2 for CT)
    • 2 x itkNearestNeighborInterpolateImageFunctionSS3D
    • 1 x itkMattesMutualInformationImageToImageMetricSS3D
    • 1 x itkCenteredTransformInitializerSS3DCenteredEuler3D
    • 1 x itkStepByStepImageRegistrationMethodSS3D
    • 1 x itkResampleImageFilterSS3D
    • 1 x itkWriterSS3D
  • SimITKTransformLibrary3D.mdl Library:
    • 2 x itkCenteredEuler3DTransform3D
  • SimITKOptimizerLibrary.mdl Library:
    • 1 x itkRegularStepGradientDescentOptimizer


Note: we will be using the SS3D library as the .vtk files that are being manipulated are 3D 16-bit signed integer files. There are a variety of libraries included in the SimITK package that correspond to the data type being used.

Examples of other data types, and how they are abbreviated in the library file names are:

  • FL: 32-bit floating-point (C++ “float” type)
  • DL: 64-bit floating point (C++ “double” type)
  • UC: 8-bit unsigned integer (C++ “unsigned char” type)
  • SC: 8-bit signed integer (C++ “unsigned char” type)
  • US: 16-bit unsigned integer
  • SS: 16-bit signed integer

After you have placed the blocks in the model window, you will notice that any of the blocks with duplicates (such as the itkReaderSS3D) will have a number appended to the name of the block. Since the same block type is used for reading both the MR and CT data volumes, it is beneficial to name these blocks accordingly. Clicking on the text just beneath the block will allow for editing of the block name for your own reference. Note in the workflow below the MR and CT blocks have been labelled accordingly for assistance.

Once properly labelled, connect the blocks as seen below (click to enlarge). Since the MR is being registered to the CT, the CT is considered the “FixedImage” making the MR the “MovingImage”. Note that all of the blocks are clickable in the graphic to see the values set for each block. These blocks will be furtherly explained below proceeding from left to right, top to bottom.

itkReaderSS3D

Just like the vtkDataSetReaders from the previous tutorials, these serve the same purpose: reading in the appropriate volume for use in the workflow. There are a total of 5 of these blocks used in the workflow. 3 are for use with the same MR volume, the other two are for use with the same CT volume.

Double-click one of the blocks to set the FileName parameter. Just like the vtkDataSetReaders, this path needs to be surrounded by single-quotes. Below is an example of an MR itkReaderSS3D block:

itkCenteredEuler3DTransform3D

Two of these blocks are necessary in performing the registration. Details on configuring each and how they differ in use will be described below.

The first block is responsible for being connected to the itkCenteredTransformInitializerSS3DCenteredEuler3D for use in initializing the registration that will take place. This is to ensure that the two volumes have an appropriate overlay and are centred with relation to one another before the image registration takes place. Initially, this block will require parameters, but we need to initially give it none. Uncheck the Parameters as Input and FixedParameters as Input check boxes and ensure that the RotationMatrix Indicator, Center Indicator, and Translation Indicator are all set to “Do Not Set”. When configured, this first block should look like this:

The second instance of the itkCenteredEuler3DTransform3D takes its parameters from the itkStepByStepImageRegistrationMethodSS3D and is applied to the MR volume using the itkResampleImageFilterSS3D. All the blocks before this second itkCenteredEuler3DTransform3D block have been used to determine the necessary parameters that will give the optimal registration. Therefore, we need to ensure that the Parameters as Input check box is checked as the parameters will be the output from the itkStepByStepImageRegistrationMethodSS3D. When configured, this second block should look like this:

itkNearestNeighborInterpolateImageFunctionSS3D

This block was the interpolation block chosen for use with this workflow. There are no parameters that need to be set. Two instances of this block are necessary in this workflow: one connected to the itkStepByStepImageRegistrationMethodSS3D and another connected to the itkResampleImageFilterSS3D.

itkMattesMutualInformationImageToImageMetricSS3D

The MutualInformation block was chosen as the metric for use in this workflow as a registration is being performed, thus we are looking for areas of similarity. Connect this block to the itkStepByStepImageRegistrationMethodSS3D and double-click on it to configure it.

There are three parameters that can be adjusted: NumberOfSpatialSamples, NumberOfHistogramBins and UseAllPixels. We will disregard using the NumberOfSpatialSamples variable as we are going to set the UseAllPixels variable to “1″ so that all information in both volumes is used when making the registration. While this will cause the registration to take longer, it will perform a more robust registration as all data is being taken into account.

The NumberOfHistogramBins variable is typically a value between 16 to 64. It is a threshold for the algorithm to decide upon a match. The lower the number, the lower the threshold but the quicker the registration. Conversely, the higher the value, the more accurate the registration, but it will take longer. For this tutorial, set the value to the mid-point: 32.

When configured, this block should look like this:

itkRegularStepGradientDescentOptimizer

This block has 5 parameters that will need to be set accordingly: MaximumStepLength, MinimumStepLength, NumberOfIterations, RelaxationFactor, and Scales. This block works in conjunction with Simulink’s step process, a part of the configuration parameters initially set.

Since the configuration parameters have been set to a maximum step size of 1, set the MaximumStepLength also to 1.

Jumping ahead a parameter, it is crucial that the number of iterations is decided. Once this is decided, diving 1 by the number of iterations determines the MinimumStepLength. In this tutorial, to ensure an accurate registration, 2000 iterations were performed. This makes the MinimumStepLength 1/2000 or 0.0005 and the NumberOfIterations 2000. While 2000 iterations sounds like a lot, the algorithm has built-in thresholds that will stop the iteration count if the difference between the nth and n+1th iteration falls beneath that threshold.

The RelaxationFactor is set to a value of 0.6, which is typically used for comparing these modalities. Set this accordingly.

The final variable in this block is the Scales variable. This is a 9 value vector that defines the scale to be applied to parameters before being evaluated in the algorithm. For our example, we will use [1 1 1 0.01 0.01 0.01 0.0001 0.0001 0.0001] which will cause an incremental 100-fold decrease and keep the registration algorithm within boundaries.

The block used in this tutorial was configured as below:

itkCenteredTransformInitializerSS3DCenteredEuler3D

This block has only one adjustable parameter Mode. Leave it as “GeometryOn”.

itkStepByStepImageRegistrationMethodSS3D

This block needs nothing more than all of the appropriate inputs connected to it to perform the registration to be output to the second Euler block. There are no parameters that need configuration.

itkResampleImageFilterSS3D

This block will need configuring that corresponds to the “MovingImage”, or in this case, the MR image. Of the four variables, we are concerned with the latter three: OutputOrigin (in mm), OutputSpacing (in mm), and Size (in pixels). Each of these parameters takes a three valued vector as an input. If using the tutorial files, these parameters are set:

  • OutputOrigin – [0.001 0 -0.0003]
  • OutputSpacing – [0.99998 0.54686 0.54686]
  • Size – [113 161 259]

itkWriterSS3D

Last, the name of the output file needs to be specified, complete with filepath and surrounded by single-quotes, just like the itkReaderSS3D. See below for an example:

Congratulations! You have completed the tutorial!

> Continue onto the Volume Rendering tutorial.

Comments are closed.