Documentation:Nightly:Registration:RegistrationLibrary:RegLib C21

From Slicer Wiki
Jump to: navigation, search
Home < Documentation:Nightly:Registration:RegistrationLibrary:RegLib C21

Back to Registration Library

Slicer Registration Library Case #21: Align knee MRI of two different subjects

Input

this is the fixed MRI reference image.
RegArrow NonRigid.png
this is the moving image, to be aligned with the reference MRI on the left
fixed image/target
MRI
moving image
MRI

Description

This case shows knee MRI of two different individuals. We explore the possibility of aligning those complex structures via intensity-based automated registration. Because we have two different anatomies, nonrigid registration is necessary. Also no perfect solution exists for such a case. Usually there is a particular target structure of interest, for which alignment is more relevant than for the rest of the image. Masking those regions tends to produce better results, provided there is enough matching image content remaining to keep the registration stable.
Approach: we will perform registrations of increasing degrees of freedom (DOF) in individual steps. This way we can verify progress. While it is possible to run all steps in a single pass, it is difficult to judge where thing went wrong should registration fail. We will also use more sample points for this example, because some of the key structures (e.g. cartilage) are small and we want to be sure enough points are sampled from this region to get a good result (remember sample points are drawn randomly from the entire image area). Sample sizes therefore depend critically on the image size. See here for an illustration of what typical sampling sizes look like.

Modules used

Download (from NAMIC MIDAS)

Keywords

MRI, knee, inter-subject, nonrigid

Procedure

It is possible to perform all 3 steps of rigid, affine and BSpline registration in a single pass within the General Registration (BRAINS) module, but to better show/judge progress we perform each separately and feed the results of one the the next step. Hence we first run a rigid registration, then use that to compute an affine registration, and finally use the affine as starting point for a BSpline registration. For the last one we will need to generate a quick mask to prevent aliasing artifacts in the image from influencing the result. The masks are available in the download set.

  1. Compute Rigid Registration: open the General Registration (BRAINS) module
    1. Input Images: Fixed Image Volume: MRI_58
    2. Input Images: Moving Image Volume: MRI_64
    3. Output Settings:
      1. Slicer Linear Transform: (create new transform, rename to: "Xf1_Rigid")
      2. Output Image Volume: none (we need no resampled volume at this stage, only the transform)
    4. Registration Phases: select/check Rigid
    5. Main Parameters:
      1. increase Number Of Samples to 200,000
    6. Leave all other settings at default
    7. click: Apply; runtime < 1 min.
    8. check the result
      1. Place "MRI_58" in the background and "MRI_64" in the foreground
      2. switch to the Data module, locate the "MRI_64" node, and drag it onto the newly created "Xf1_Rigid" node.
      3. fade between background and foreground to judge the alignment.
      4. for better visibility, you can change the colormaps of the two volumes, as used in the examples shown here. Switch to the Volumes module, select "MRI_58" and then select "Green" from the Lookup Table menu. Similarly select "Cyan" for "MRI_64".
  2. Compute Affine Registration: return to the General Registration (BRAINS) module
    1. Input Images: Fixed Image Volume: MRI_58
    2. Input Images: Moving Image Volume: MRI_64
    3. Output Settings:
      1. Slicer Linear Transform: (create new transform, rename to: "Xf2_Affine")
      2. Output Image Volume: none (we need no resampled volume at this stage, only the transform)
    4. Initialization: for the Initialization transform select the "Xf1_Rigid" transform created above.
    5. Initialize Transform Mode: switch to Off
    6. Registration Phases: uncheck Rigid and select Rigid+Scale and Affine only
    7. Main Parameters:
      1. leave Number Of Samples to 200,000
    8. Leave all other settings at default
    9. click: Apply; runtime < 1 min.
    10. check the result
      1. Place "MRI_58" in the background and "MRI_64" in the foreground
      2. switch to the Data module, locate the "MRI_64" node, and drag it onto the newly created "Xf1_Affine" node.
      3. fade between background and foreground to judge the alignment.
      4. for better visibility, you can change the colormaps of the two volumes, as used in the examples shown here. Switch to the Volumes module, select "MRI_58" and then select "Green" from the Lookup Table menu. Similarly select "Cyan" for "MRI_64".
  3. Compute BSpline Registration: return to the General Registration (BRAINS) module
    1. Input Images: Fixed Image Volume: MRI_58
    2. Input Images: Moving Image Volume: MRI_64
    3. Output Settings:
      1. Slicer BSpline Transform: Create and rename new. Rename to "MRI_64_Xf3"
      2. Slicer Linear Transform: set to none
      3. Output Image Volume: Create and rename new. Rename to "MRI_64_Xf3"
    4. Initialization: for the Initialization transform select the "Xf1_Affine" transform created above.
    5. Initialize Transform Mode: switch to Off
    6. Registration Phases: uncheck Rigid+Scale and Affine and select BSpline only
    7. Main Parameters:
      1. increase Number Of Samples to 400,000
      2. set B-Spline Grid Size to 5,5,3
    8. Mask Option
      1. select the ROI button
      2. ROI Masking input fixed: select "58_MRI_mask" (provided in download set)
      3. ROI Masking input moving: select "64_MRI_mask" (provided in download set)
    9. Leave all other settings at default
    10. click: Apply; runtime for this will be more than 1 minute, depending on CPU.
    11. check the result
      1. Place "MRI_58" in the background and "MRI_64_Xf3" in the foreground
  4. Apply and save transforms
    1. To apply the rigid and affine transforms you need not resample the volume. Simply drag the MRI_64 volume into the transform node (Xf1_Rigid or Xf2_Affine), and then right click on the "MRI_64" volume node and from the pop-up menu, select Harden Transform. This will apply the transform without resampling and move it back to the main hierarchy level. Note that now you have a reoriented volume although the name is the same. It is advisable to immediately rename the node to document this fact. Then save it as a new file under a new name.
    2. To apply the nonrigid transform resampling is required. You already have a resampled volume "MRI_64_Xf3" from above. This uses linear interpolation and float as default. You can change these settings under the Advanced Output Settings tab. For this example "short" as Pixel Type and "Windowed Sinc" is recommended. To obtain a new resampled copy without repeating the whole registration step, use the BRAINSResample module

Registration Results

RegLib C21 Unregistered.png before registration (click to enlarge)
RegLib C21 Rigid.png after rigid registration (click to enlarge)
RegLib C21 Affine.png after affine registration (click to enlarge)
RegLib C21 BSpline.png after BSpline registration (click to enlarge)
RegLib C21 registered.gif animated gif showing the progression of all 3 steps(click to enlarge)


Acknowledgments