Difference between revisions of "Documentation:Nightly:Registration:RegistrationLibrary:RegLib C04"

From Slicer Wiki
Jump to: navigation, search
 
(8 intermediate revisions by the same user not shown)
Line 30: Line 30:
  
 
==Description ==
 
==Description ==
This scenario occurs in many forms whenever we wish to assess change in a series of multi-contrast MRI. The follow-up scan(s) are to be aligned with the baseline, but also the different series within each exam need to be co-registered, since the subject may have moved between acquisitions. Hence we have a set of nested registrations. This particular exam features a dual echo scan (PD/T2), where the two structural scans are aligned by default. The post-contrast T1-GdDTPA scan however is not necessarily aligned with the dual echo. Also the post-contrast scan is taken with a clipped field of view (FOV) and a lower axial resolution, with 4mm slices and a 1mm gap (which we treat here as a de facto 5mm slice).
+
This scenario occurs in many forms whenever we wish to assess change in a series of multi-contrast MRI. The follow-up scan(s) are to be aligned with the baseline, but also the different series within each exam need to be co-registered, since the subject may have moved between acquisitions. Hence we have a set of nested registrations. This particular exam features a dual echo scan (PD/T2), where the two structural scans are aligned by default. The post-contrast T1-GdDTPA scan however is not necessarily aligned with the dual echo. Also the post-contrast scan is taken with a clipped field of view (FOV) and a lower axial resolution, with 4mm slices and a 1mm gap (which we treat here as a de facto 5mm slice). You can find
[http://na-mic.org/Wiki/index.php/Projects:RegistrationLibrary:RegLib_C04:About read more about this dataset here]
+
[http://na-mic.org/Wiki/index.php/Projects:RegistrationLibrary:RegLib_C04:read more about this dataset here.]
 
<br>
 
<br>
'''Approach''': we first compute the 2 intra-exam registrations aligning the T1Gd contrast exam with the PD of the same exam. We then register the PDs of the two exams to eachother. This provides a complete hierarchy that aligns everything to the baseline. Placing the  follow-up/"exam 2" T2 and (T1Gd incl. transform) inside the inter-exam transform will bring all scans into alignment. We will have a hierarchy that looks like this:
+
'''Approach''': we first compute the 2 intra-exam registrations aligning the T1Gd contrast exam with the PD of the same exam. We then register the PDs of the two exams to eachother. This provides a complete hierarchy that aligns everything to the baseline. Placing the  follow-up/"exam 2" T2 and (T1Gd incl. transform) inside the inter-exam transform will bring all scans into alignment.
[[Image:RegLib_C04_TransformHierarchy.png|100px|lleft|transform hierarchy of inter- and intra-exam registration, bringing everything into alignment with the baseline PD/T2 pair. ]]
 
  
 
== Modules used ==
 
== Modules used ==
Line 41: Line 40:
 
== Download (from NAMIC MIDAS) ==
 
== Download (from NAMIC MIDAS) ==
 
<small>''Why 2 sets of files?  The "input data" mrb includes only the unregistered data to try the method yourself from start to finish. The full dataset includes intermediate files and results (transforms, resampled images etc.). If you use the full dataset we recommend to choose different names for the images/results you create yourself to distinguish the old data from the new one you generated yourself. ''</small>
 
<small>''Why 2 sets of files?  The "input data" mrb includes only the unregistered data to try the method yourself from start to finish. The full dataset includes intermediate files and results (transforms, resampled images etc.). If you use the full dataset we recommend to choose different names for the images/results you create yourself to distinguish the old data from the new one you generated yourself. ''</small>
*[http://slicer.kitware.com/midas3/download/?items=xx '''RegLib_C04.mrb''': input data only, use this to run the tutorial from the start <small>(Slicer mrb file. 19 MB). </small>]
+
*[http://slicer.kitware.com/midas3/download/?items=116480 '''RegLib_C04.mrb''': input data only, use this to run the tutorial from the start <small>(Slicer mrb file. 19 MB). </small>]
*[http://slicer.kitware.com/midas3/download/?items=xx '''RegLib_C04_full.mrb''': includes raw data + all solutions and intermediate files, use to browse/verify <small>(Slicer mrb file. 19 MB). </small>]
+
*[http://slicer.kitware.com/midas3/download/?items=116479 '''RegLib_C04_full.mrb''': includes raw data + all solutions and intermediate files, use to browse/verify <small>(Slicer mrb file. 19 MB). </small>]
  
 
== Keywords ==
 
== Keywords ==
Line 51: Line 50:
  
 
== Procedure ==
 
== Procedure ==
#'''Compute Registration''': open the [[Documentation/Nightly/Modules/BRAINSFit|''General Registration (BRAINS)'' module]]
+
#'''Intra-Exam''': register intra-examT1Gd to PD
##''Input Images: Fixed Image Volume'': T1
+
##open the [[Documentation/Nightly/Modules/BRAINSFit|''General Registration (BRAINS)'' module]]
##''Input Images: Moving Image Volume'': FLAIR
+
##''Fixed Image Volume'': e1_PD
##''Output Settings'':  
+
##''Moving Image Volume'': e1_T1Gd
###''Slicer Linear Transform'' (create new transform, rename to: "Xf1_Affine")
+
##Output Settings:
###''Output Image Volume'' none. No resampling required for linear transforms
+
###''Slicer BSpline Transform": none
##''Registration Phases'': select/check ''Rigid'' , ''Rigid+Scale'', ''Affine''
+
###''Slicer Linear Transform'': create & rename new transform: Xf1_e1-T1Gd_Affine.tfm
##''Main Parameters'':
+
###''Output Image Volume'': none
###increase ''Number Of Samples'' to 200,000
+
##''Registration Phases'': check boxes for ''Rigid'', ''Rigid+Scale'' and ''Affine''
##Leave all other settings at default
+
##''Main Parameters''
##click: ''Apply''; runtime < 1 min.
+
###'''Number of Samples''': 200,000
#'''Align Labelmap:''' We have now computed the registration transform. To reorient both FLAIR and its label map, we place both volumes inside the transform.
+
##click: Apply; runtime < 10 sec (MacPro QuadCore 2.4GHz)
###Place "T1" in the background and "FLAIR" in the foreground. Select "LesionSeg" as the labelmap to display.
+
#'''repeat for exam 2''', i.e
##Go to the [[Documentation/Nightly/Modules/Data|''Data'']] module
+
##''Fixed Image Volume'': e2_PD
###the "FLAIR" image should already be placed within the transform "Xf1_Affine", that was done by the registration module. If not, left click on the "FLAIR" node and drag it onto the "Xf1_Affine" node. You will see a "+" sign appear indicating that the image is placed within the transform.
+
##''Moving Image Volume'': e2_T1Gd
###Do the same for the "LesionSeg" node, i.e. drag it into the "Xf1_Affine" transform.
+
##''Slicer Linear Transform'': create & rename new transform: Xf2_e2-T1Gd_Affine.tfm
#'''Apply the transforms without resampling / Save result images'''
+
#'''Inter-Exam Registration''': register exam 2 -> exam 1
 +
#open the [[Documentation/Nightly/Modules/BRAINSFit|''General Registration (BRAINS)'' module]]
 +
##''Fixed Image Volume'': e1_PD
 +
##''Moving Image Volume'': e2_PD
 +
##Output Settings:
 +
###''Slicer BSpline Transform": none
 +
###''Slicer Linear Transform'': create & rename new transform: Xf3_e21_Affine.tfm
 +
###''Output Image Volume'': none
 +
##''Registration Phases'': check boxes for ''Rigid''  and ''Affine''
 +
##''Main Parameters''
 +
###'''Number of Samples''': 200,000
 +
##click: Apply; runtime < 10 sec (MacPro QuadCore 2.4GHz)
 +
#'''Organize transform hierarchies'''
 +
##go to the [[Documentation/Nightly/Modules/Data|''Data'' module]]
 +
##drag the volume node e1_T1Gd onto the transform Xf1_e1-T1Gd_Affine; let go of the mouse button when you see a hilight box appear around the transform node name
 +
##drag the volume node e2_T1Gd onto the transform  Xf2_e2-T1Gd_Affine;
 +
##drag the volume node e2_T2 onto the transform Xf3_e21_Affine.tfm
 +
##drag the transform node Xf3_e2_T1Gd_Rigid.tfm onto the transform Xf1_e21_Affine.tfm
 +
##drag the entire transform  Xf2_e2-T1Gd_Affine '''and its contents''' onto the transform Xf3_e21_Affine.tfm
 +
##your MRML data tree should look something like this: [[Image:RegLib_C04_TransformHierarchy.png|100px|lleft|transform hierarchy of inter- and intra-exam registration, bringing everything into alignment with the baseline PD/T2 pair. ]]
 +
 
 +
#'''Apply Transform (without resampling''')
 
##for linear (rigid to affine) transforms you have two options for generating a result image in the new orientation: with and without resampling. The method without resampling leaves the original image data untouched and writes the new orientation into the image header. This preserves the full original image quality and is the preferred method, provided that the software using the result image can read the spatial information in the header correctly. If you open an image with a software that does not account for this header information, the image will appear in its original orientation. The resampling method will create a new image volume by interpolating the data into the new space. This has the advantage that your registered volume will have matching size and resolution as your reference image, but it is associated with some data loss from the interpolation during resampling.
 
##for linear (rigid to affine) transforms you have two options for generating a result image in the new orientation: with and without resampling. The method without resampling leaves the original image data untouched and writes the new orientation into the image header. This preserves the full original image quality and is the preferred method, provided that the software using the result image can read the spatial information in the header correctly. If you open an image with a software that does not account for this header information, the image will appear in its original orientation. The resampling method will create a new image volume by interpolating the data into the new space. This has the advantage that your registered volume will have matching size and resolution as your reference image, but it is associated with some data loss from the interpolation during resampling.
 
##''Apply Transform without resampling'':
 
##''Apply Transform without resampling'':
Line 76: Line 96:
 
#Alternative: '''Apply Transform with resampling''':
 
#Alternative: '''Apply Transform with resampling''':
 
##Go to the [[Documentation/Nightly/Modules/BRAINSResample|''BRAINSResample'' module]]
 
##Go to the [[Documentation/Nightly/Modules/BRAINSResample|''BRAINSResample'' module]]
###''Image To Warp'': select FLAIR
+
###''Image To Warp'': select e2_PD
###''Reference Image'': select T1
+
###''Reference Image'': select e1_PD
###''Outputs:OutputImage'': create & rename new, rename to "FLAIR_Xf1"
+
###''Outputs:OutputImage'': create & rename new, rename to "e2_PD_Xf3"
 
###''Pixel Type'': select ''short'' , or match the datatype of the original image.
 
###''Pixel Type'': select ''short'' , or match the datatype of the original image.
###''Transform File'': select "Xf1_Affine"
+
###''Transform File'': select "Xf3_e21_Affine.tfm"
 
###''Interpolation Mode'': select "WindowedSinc" (recommended for 3D MRI). For labelmaps select ''Nearest Neighbor''
 
###''Interpolation Mode'': select "WindowedSinc" (recommended for 3D MRI). For labelmaps select ''Nearest Neighbor''
 
###Click Apply. This will generate a new volume with the same resolution as the reference image.
 
###Click Apply. This will generate a new volume with the same resolution as the reference image.
Line 88: Line 108:
  
 
{|cellpadding="10" cellspacing="0" border="0"
 
{|cellpadding="10" cellspacing="0" border="0"
|[[Image:RegLib_C02_unregistered.gif|300px]] ||baseline & T2 before registration (click to enlarge)
+
|[[Image:RegLib_C04_unregistered1.gif|300px]] ||baseline PD & contrast T1Gd before registration (click to enlarge)
 +
|-
 +
|[[Image:RegLib_C04_unregistered2.gif|300px]]||baseline and follow-up PD before registration (click to enlarge)
 +
|-
 +
|[[Image:RegLib_C04_registered1.gif|300px]]||baseline PD & contrast T1Gd after registration (click to enlarge)
 +
|-
 +
|[[Image:RegLib_C04_registered2.gif|300px]]||baseline and follow-up PD after registration (click to enlarge)
 
|-
 
|-
|[[Image:RegLib_C02_registered.gif|300px]]||baseline to T2 after affine+nonrigid alignment (click to enlarge)
+
|[[Image:RegLib_C04_registered3.gif|300px]]||baseline and follow-up T1Gd contrast after registration(click to enlarge)
 
|}
 
|}
  
 
=== Acknowledgments ===
 
=== Acknowledgments ===

Latest revision as of 22:07, 30 August 2013

Home < Documentation:Nightly:Registration:RegistrationLibrary:RegLib C04

Back to Registration Library

Slicer Registration Library Case #2: Multi-contrast brain MRI of Multiple Sclerosis

Input

this is the main fixed reference image. All images are ev. aligned into this space this is the main fixed reference image. All images are ev. aligned into this space lleft this is the intra-subject moving image.
exam 1: PD exam 1: T2 exam 1: T1-Gd
lleft
this is the inter-subject moving image, but also the reference for exam 2 this is the inter-subject moving image, but also the reference for exam 2 lleft this is the moving image.
exam 2: PD exam 2: T2 exam 2: T1-Gd

Description

This scenario occurs in many forms whenever we wish to assess change in a series of multi-contrast MRI. The follow-up scan(s) are to be aligned with the baseline, but also the different series within each exam need to be co-registered, since the subject may have moved between acquisitions. Hence we have a set of nested registrations. This particular exam features a dual echo scan (PD/T2), where the two structural scans are aligned by default. The post-contrast T1-GdDTPA scan however is not necessarily aligned with the dual echo. Also the post-contrast scan is taken with a clipped field of view (FOV) and a lower axial resolution, with 4mm slices and a 1mm gap (which we treat here as a de facto 5mm slice). You can find more about this dataset here.
Approach: we first compute the 2 intra-exam registrations aligning the T1Gd contrast exam with the PD of the same exam. We then register the PDs of the two exams to eachother. This provides a complete hierarchy that aligns everything to the baseline. Placing the follow-up/"exam 2" T2 and (T1Gd incl. transform) inside the inter-exam transform will bring all scans into alignment.

Modules used

Download (from NAMIC MIDAS)

Why 2 sets of files? The "input data" mrb includes only the unregistered data to try the method yourself from start to finish. The full dataset includes intermediate files and results (transforms, resampled images etc.). If you use the full dataset we recommend to choose different names for the images/results you create yourself to distinguish the old data from the new one you generated yourself.

Keywords

MRI, brain, head, intra-subject, multiple sclerosis

Video Screencasts

  1. Movie/screencast showing registration for Case #02

Procedure

  1. Intra-Exam: register intra-examT1Gd to PD
    1. open the General Registration (BRAINS) module
    2. Fixed Image Volume: e1_PD
    3. Moving Image Volume: e1_T1Gd
    4. Output Settings:
      1. Slicer BSpline Transform": none
      2. Slicer Linear Transform: create & rename new transform: Xf1_e1-T1Gd_Affine.tfm
      3. Output Image Volume: none
    5. Registration Phases: check boxes for Rigid, Rigid+Scale and Affine
    6. Main Parameters
      1. Number of Samples: 200,000
    7. click: Apply; runtime < 10 sec (MacPro QuadCore 2.4GHz)
  2. repeat for exam 2, i.e
    1. Fixed Image Volume: e2_PD
    2. Moving Image Volume: e2_T1Gd
    3. Slicer Linear Transform: create & rename new transform: Xf2_e2-T1Gd_Affine.tfm
  3. Inter-Exam Registration: register exam 2 -> exam 1
  4. open the General Registration (BRAINS) module
    1. Fixed Image Volume: e1_PD
    2. Moving Image Volume: e2_PD
    3. Output Settings:
      1. Slicer BSpline Transform": none
      2. Slicer Linear Transform: create & rename new transform: Xf3_e21_Affine.tfm
      3. Output Image Volume: none
    4. Registration Phases: check boxes for Rigid and Affine
    5. Main Parameters
      1. Number of Samples: 200,000
    6. click: Apply; runtime < 10 sec (MacPro QuadCore 2.4GHz)
  5. Organize transform hierarchies
    1. go to the Data module
    2. drag the volume node e1_T1Gd onto the transform Xf1_e1-T1Gd_Affine; let go of the mouse button when you see a hilight box appear around the transform node name
    3. drag the volume node e2_T1Gd onto the transform Xf2_e2-T1Gd_Affine;
    4. drag the volume node e2_T2 onto the transform Xf3_e21_Affine.tfm
    5. drag the transform node Xf3_e2_T1Gd_Rigid.tfm onto the transform Xf1_e21_Affine.tfm
    6. drag the entire transform Xf2_e2-T1Gd_Affine and its contents onto the transform Xf3_e21_Affine.tfm
    7. your MRML data tree should look something like this: transform hierarchy of inter- and intra-exam registration, bringing everything into alignment with the baseline PD/T2 pair.
  1. Apply Transform (without resampling)
    1. for linear (rigid to affine) transforms you have two options for generating a result image in the new orientation: with and without resampling. The method without resampling leaves the original image data untouched and writes the new orientation into the image header. This preserves the full original image quality and is the preferred method, provided that the software using the result image can read the spatial information in the header correctly. If you open an image with a software that does not account for this header information, the image will appear in its original orientation. The resampling method will create a new image volume by interpolating the data into the new space. This has the advantage that your registered volume will have matching size and resolution as your reference image, but it is associated with some data loss from the interpolation during resampling.
    2. Apply Transform without resampling:
    3. Go to the Data module
    4. left click on the moving image node and drag it into/onto the transform node. You should see a "+" sign appear next to the transform node indicating the volume is now placed under that transform. If the image is in either foreground or background and visible in the slice views or 3D view, you will see the image update to its new position immediately.
    5. right click on the image node and from the pop-up menu, select Harden Transform. This will apply the transform and move the image node back outside onto the main level.
    6. double click on the image node and rename it to document that this is no longer the original image but the reoriented one. Note that the image in its original position is replaced in memory and no longer accessible. There is no "undo" for this step, so if you wish to return to the original image, you must reload it from the original file. Be careful not to accidentally overwrite the original image file with the resampled one. Use a new filename when saving the image.
  2. Alternative: Apply Transform with resampling:
    1. Go to the BRAINSResample module
      1. Image To Warp: select e2_PD
      2. Reference Image: select e1_PD
      3. Outputs:OutputImage: create & rename new, rename to "e2_PD_Xf3"
      4. Pixel Type: select short , or match the datatype of the original image.
      5. Transform File: select "Xf3_e21_Affine.tfm"
      6. Interpolation Mode: select "WindowedSinc" (recommended for 3D MRI). For labelmaps select Nearest Neighbor
      7. Click Apply. This will generate a new volume with the same resolution as the reference image.
    2. repeat the same for the label map, but select Nearest Neighbor as the interpolation type.

Registration Results

RegLib C04 unregistered1.gif baseline PD & contrast T1Gd before registration (click to enlarge)
RegLib C04 unregistered2.gif baseline and follow-up PD before registration (click to enlarge)
RegLib C04 registered1.gif baseline PD & contrast T1Gd after registration (click to enlarge)
RegLib C04 registered2.gif baseline and follow-up PD after registration (click to enlarge)
RegLib C04 registered3.gif baseline and follow-up T1Gd contrast after registration(click to enlarge)

Acknowledgments