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

From Slicer Wiki
Jump to: navigation, search
 
(6 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
|[[Image:RegLib_C49_Thumb1.png|150px|left|this is the fixed DTI FA image. We want to align all images into this space]]  
 
|[[Image:RegLib_C49_Thumb1.png|150px|left|this is the fixed DTI FA image. We want to align all images into this space]]  
 
|[[Image:RegLib_C49_Thumb2.png|150px|left|this is associated B0 image. Aligned with FA. Will use this as registration reference (fixed image)]]  
 
|[[Image:RegLib_C49_Thumb2.png|150px|left|this is associated B0 image. Aligned with FA. Will use this as registration reference (fixed image)]]  
|[[Image:RegArrow_Nonrigid.png|100px|left]]  
+
|[[Image:RegArrow_NonRigid.png|100px|left]]  
 
|[[Image:RegLib_C49_Thumb3.png|150px|left|this is the moving MR image, to be aligned with the reference on the left]]
 
|[[Image:RegLib_C49_Thumb3.png|150px|left|this is the moving MR image, to be aligned with the reference on the left]]
 
|[[Image:RegLib_C49_Thumb4.png|150px|left|this is the moving MR image, to be aligned with the reference on the left]]
 
|[[Image:RegLib_C49_Thumb4.png|150px|left|this is the moving MR image, to be aligned with the reference on the left]]
Line 17: Line 17:
  
 
== Description ==
 
== Description ==
Goal is to align the structural T1 and T2 images with the DTI. Particularly the T1, which is associated with additional atlas/segmentation data (not shown). The DTI has strong distortions typical for EPI acquisitions. <br>
+
Goal is to align the structural T1 and T2 images with the DTI. Particularly the T1, which is associated with additional atlas/segmentation data (not shown). The DTI has strong distortions typical for EPI acquisitions. Note that the T1 image had "defacing" applied for anonymization, but the brain portion of the image is unaffected.<br>
 
'''Approach:''' Because the T2 matches the B0 contrast better than the T1, we will use the T2 as registration target. We will then register the T1 to the T2 and finally to the B0. Since the DTI contains strong distortions, a nonrigid registration is necessary. Workflow:
 
'''Approach:''' Because the T2 matches the B0 contrast better than the T1, we will use the T2 as registration target. We will then register the T1 to the T2 and finally to the B0. Since the DTI contains strong distortions, a nonrigid registration is necessary. Workflow:
 
#affine register T2-B0
 
#affine register T2-B0
Line 31: Line 31:
 
== 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=118088 '''RegLib_C49.mrb''': input data only, use this to run the tutorial from the start <small>(Slicer mrb file. 50 MB). </small>]
+
*[http://slicer.kitware.com/midas3/download/?items=118347 '''RegLib_C49.mrb''': input data only, use this to run the tutorial from the start <small>(Slicer mrb file. 50 MB). </small>]
*[http://slicer.kitware.com/midas3/download/?items=118087 '''RegLib_C49_full.mrb''': includes raw data + all solutions and intermediate files, use to browse/verify <small>(Slicer mrb file. 82 MB). </small>]
+
*[http://slicer.kitware.com/midas3/download/?items=118346 '''RegLib_C49_full.mrb''': includes raw data + all solutions and intermediate files, use to browse/verify <small>(Slicer mrb file. 82 MB). </small>]
  
 
== Keywords ==
 
== Keywords ==
MRI, CT, abdominal, image-guided surgery, interventional radiology, intra-subject, fiducial-based registration
+
MRI, pediatric, brain, intra-subject, diffusion MRI, DWI, DTI
  
 
== Video Screencasts ==
 
== Video Screencasts ==
#[[Media:RegLib_C48_FiducialRegistration.mov|'''fiducial-based registration''']]
+
#[[Media:RegLib_C49.mov|'''RegLib_C49 Registration Screencast (start-finish)''']]
  
 
== Procedure ==
 
== Procedure ==
#'''Create CT fiducial list:''': see also movie above  
+
#'''Prepare Masks''': see also movie above  
##load the two datasets. Adjust brightness & contrast if necessary. Place the CT scan in the background and center the views.
+
##two masks for the B0 and T2 are already provided with the dataset. For examples on how to obtain masks quickly from your image data see:
##Open the [[Documentation/Nightly/Modules/Markups|''Markups'' module]]
+
##We will use these masks for the registration. To ensure sufficient points outside the brain surface can participate in the registration, we dilate the two masks slightly to extend beyond the brain:
##''List'': create and rename new list. Name to "fiducials_CT" or similar
+
##go to the [[Documentation/Nightly/Modules/Editor ''Editor'' module]]  
##locate anatomical landmarks that is common to both images and readily identifiable. Smaller and distinctly shaped structures will likely carry less of a selection error than large uniform ones. It is also advisable to select fiducials from or near the region of interest.
+
##''Master Volume'': T2
##switch the mouse function to fiducial mode, by clicking the ''Fiducial'' button in the toolbar. [[Image:Slicer4_FiducialButton.png| ]]
+
##''Merge Volume'': T2_mask
##place a fiducial marker via left mouse-click
+
##click on the ''Dilation Tool''. Set label to 1. Ensure T2_mask is visible in the slice views
##you should see the fiducial appear in the list on the left. Double click the name field and rename the point with a descriptive name that will let you distinguish it from others. The fiducials we generate in the list '''must be in the same order''' in both lists (MR and CT), so it is important we can distinguish which fiducial is which.
+
##click on the "Dilate" button once. You should see the boundary expand. Because there is little interstitial space/cortical CSF, we dilate only little to avoid including the skull in the ROI.
##select 2-3 additional fiducials. The more fiducials we have, the more robust the registration. However, if you feel that the uncertainty/accuracy of a new landmark is significantly above the others, you may do better leaving it out and trying with a smaller set. For a rigid registration at least 3 fiducials are needed. Another advantage of having more than necessary, is that you can later easily test/revise the registration by removing individual points and recalculating the transform. Because the calculation is instant, you can see immediately if the match improves by leaving individual markers out. More on this in the discussion below.
+
##switch ''MergeVolume'' to B0 and the ''Merge Volume'' to B0_mask
##open the ''Advanced'' tab and change the colors for this list (both selected and unselected). This will help you keep the two lists apart, i.e. distingush the CT list from the MR list
+
##again select the Dilate tool and click "Dilate" 2-3 times. We can afford to dilate more here since the skull is very dark in the B0.
##switch the MR image into the backrgound and recenter the views.
+
#'''Affine Register T2-B0'''
#'''Create MRI fiducial list''': see also movie above
+
##go to the [[Documentation/Nightly/Modules/BRAINSFit|''General Registration (BRAINS)'' module]]
##''List'': create and rename new list. Name to "fiducials_MRI" or similar
+
##''Input Images: Fixed Image Volume'': B0
##repeat the selection of fiducials as above.  
+
##''Input Images: Moving Image Volume'': T2
##in the ''Advanced'' tab, you can reshuffle the order of fiducials in the list. '''Important: remember that the fiducials in the two lists must be in the same order, i.e. the same anatomical loci must appear in both lists in the same order. If not you can use the shuffle buttons in the Advanced tab to rearrange.
+
##''Output Settings'':  
##Save both lists. This will create ".csv" with fiducial names and coordinates
+
###''Slicer Linear Transform'' (create new transform, rename to: "Xf1_T2-B0_Affine")
#'''Fiducial Registration:'''
+
###''Output Image Volume'' none. No resampling required for linear transforms
##go to the [[Documentation/Nightly/Modules/Fiducial Registration ''Fiducial Registration'' module]] (menu: ''Registration / Specialized'')
+
##''Registration Phases'':  select/check ''Rigid'' , ''Rigid+Scale'', ''Affine''
##''Fixed Landmarks'': select "Fiducials_CT"
+
##''Main Parameters'':  
##''Moving Landmarks'': select "Fiducials_MR"
+
###increase ''Number Of Samples'' to 300,000
##''Save transform'': select "Create and rename new linear transform'', rename to "FiducialReg_Rigid" or similar.
+
##''Mask Option'': select ROI button
##click ''Apply''. note that the calculation is instantaneous, but you will not see an effect on the image just yet.
+
###''Masking input fixed'': select B0_mask
##place the CT image in the background and center. Place the MR image in the foreground and set the fade slider halfway so you can see both images superimposed
+
###''Masking input moving'': select T2_mask
##Go to the [[Documentation/Nightly/Modules/Data ''Data'' module]]
+
##Leave all other settings at default
###you should see the newly created transform node in the MRML tree. Locate the MR image and drag its node onto the transform node (release the left mouse button when a box appears around the transform node). The MR image is placed inside the new transform. You should see the views update immediately.
+
##click: ''Apply''; runtime < 1 min.
###also drag the "fiducially_MR" node into the transform. Your data hierarchy should look similar to the image on the right. [[Image:RegLib_C48_DataHierarchy.png|right]]
+
#'''BSpline Register T2-B0'''
###use the fade slider to judge the alignment.
+
##leave B0 and T2 as fixed and moving volumes
##the 3D viewer will be very helpful here to assess the alignment of the fiducial pairs in space.
+
##''Output Settings'':  
#'''optional: Revise registration / sensitivity test'''
+
###''Slicer Linear Transform'' select None
##if you have more than the minimal (3) fiducial points available, you can test the effects of individual landmarks by recalculating the transform with individual points deleted.
+
###''Slicer BSpline Transform'' create new, rename to "Xf2_T2-B0_BSpline" or similar
##make sure you have both fiducial lists saved beforehand
+
###''Output Image Volume'': create new and rename to "T2_Xf2". Resampling '''is''' required for nonrigid transforms.
##from the 3D or 3D views, identify a fiducial pair that shows the largest residual misalignment after registration (make sure the MR fiducial list is also within the transform)
+
##''Registration Phases'': unchheck ''Rigid'' , ''Rigid+Scale'', ''Affine'' and check "BSpline" only
##go back to the [[Documentation/Nightly/Modules/Markups|''Markups'' module]] and delete that fiducial from both lists.  
+
##''Main Parameters'':
##make sure you have the CT in the background and the MR in the foreground, the fade slider set to halfway and the MR image inside the result transform
+
###increase ''Number Of Samples'' to at least 300,000
##return to the [[Documentation/Nightly/Modules/Fiducial Registration ''Fiducial Registration'' module]] (menu: ''Registration / Specialized'') and rerun the registration, choosing the same transform result name.
+
###''BSpline Grid Size'': set to 10,10,5 or similar. Note we have lower resolution in the z-direction, hence we reduce the grid size there.
##click apply. This will calculate a new transform with the updated fiducial list and replace the existing transform. You should see the difference immediately as the views update. You can use this to test if a registration can be improved by leaving out indiv. landmarks.
+
###leave masking settings as before
 +
##click: ''Apply''; runtime < 3 min.
 +
##we now have the T2 aligned with the DTI. Place T2_Xf2 and B0 in the foreground and background and use the fade slider to view the result
 +
#'''Affine Register T1-T2'''
 +
##go to the [[Documentation/Nightly/Modules/BRAINSFit|''General Registration (BRAINS)'' module]]
 +
##''Input Images: Fixed Image Volume'': T2
 +
##''Input Images: Moving Image Volume'': T1
 +
##''Output Settings'':
 +
###''Slicer Linear Transform'' (create new transform, rename to: "Xf3_T1-T2_Affine")
 +
###''Output Image Volume'' none. No resampling required for linear transforms
 +
##''Registration Phases'':  select/check ''Rigid'' , ''Rigid+Scale'', ''Affine''
 +
##''Main Parameters'':  
 +
###''Number Of Samples'' to 300,000
 +
##''Mask Option'': select "NOMASK" button
 +
###''Masking input fixed'': select "None"
 +
###''Masking input moving'': select "None"
 +
##Leave all other settings at default
 +
##click: ''Apply''; runtime < 1 min.
 +
##verify the alignment in the Slice views
 +
##go to the [[Documentation/Nightly/Modules/Data|''Data'' module]], note that the T1 has been placed inside the Xf3 transform.
 +
##right click on the T1 image inside the transform. From the pop-up menu select '''Harden Transform'''. You should see the T1 node move back out to the main hierarchy level. You have now applied the new orientation to the T1 image, so we rename it to document that change:
 +
##double click on T1 node, change name to "T1_Xf3" or similar
 +
##we now have the T1 aligned with the T2. We can therefore apply the same transform "Xf2_T2-B0_BSpline" from above to the T1:
 +
#'''Resample T1:'''
 +
##Go to the [[Documentation/Nightly/Modules/BRAINSResample|''Registration/Resample Image (BRAINS)'']] module
 +
###''Image To Warp'': T1_Xf3
 +
###''Reference Image'': T2_Xf2 or B0
 +
###''Output Image'': create new and rename to "T1_Xf3_Xf2" or similar
 +
###''Pixel Type'': set to short
 +
###''Warping Parameters / Transform file'': select "Xf2_T2-B0_BSpline"
 +
###''Interpolation Mode'': select ''linear'' or ''WindowedSinc''
 +
##click Apply.
 +
##we now have all images in the same orientation as the B0.
  
 
==Registration Results==
 
==Registration Results==
  
 
{|cellpadding="10" cellspacing="0" border="0"
 
{|cellpadding="10" cellspacing="0" border="0"
|[[Image:RegLib_C17_unregistered.gif|300px]] ||MR/CT before registration (click to enlarge)
+
|[[Image:RegLib_C49_unregistered.gif|300px]] ||MR/CT before registration (click to enlarge)
 
|-
 
|-
|[[Image:RegLib_C48_registered.gif|300px]]||MR/CT after fiducial rigid alignment (click to enlarge)
+
|[[Image:RegLib_C49_registered1_T2B0.gif|300px]]|| alignment of T2 to B0 (click to enlarge)
 +
|-
 +
|[[Image:RegLib_C49_registered2_T1T2.gif|300px]]|| preliminary affine alignment of T1 to T2 (click to enlarge)
 +
|-
 +
|[[Image:RegLib_C49_registered3_T1B0.gif|300px]]|| final alignment of T1 to B0 (click to enlarge)
 
|}
 
|}
  
 
=== Acknowledgments ===
 
=== Acknowledgments ===
 +
Many thanks to Mojdeh Zamyadi and Dr. E. Widjaja's lab from the Hospital for Sick Children in Toronto, Canada, for sharing the example data.

Latest revision as of 16:51, 2 October 2013

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

Back to Registration Library

Slicer Registration Library Case #49: Pediatric Brain DTI

Input

this is the fixed DTI FA image. We want to align all images into this space
this is associated B0 image. Aligned with FA. Will use this as registration reference (fixed image)
RegArrow NonRigid.png
this is the moving MR image, to be aligned with the reference on the left
this is the moving MR image, to be aligned with the reference on the left
fixed image/target
DTI (FA)
fixed image/target
DTI (B0)
moving image
T2 MRI
moving image
T1 MRI

Description

Goal is to align the structural T1 and T2 images with the DTI. Particularly the T1, which is associated with additional atlas/segmentation data (not shown). The DTI has strong distortions typical for EPI acquisitions. Note that the T1 image had "defacing" applied for anonymization, but the brain portion of the image is unaffected.
Approach: Because the T2 matches the B0 contrast better than the T1, we will use the T2 as registration target. We will then register the T1 to the T2 and finally to the B0. Since the DTI contains strong distortions, a nonrigid registration is necessary. Workflow:

  1. affine register T2-B0
  2. BSpline register T2-B0, using the above affine as starting point
  3. affine register T1-T2. Apply transform without resampling
  4. resample T1 with nonrigid transform obtained for the T2.

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, pediatric, brain, intra-subject, diffusion MRI, DWI, DTI

Video Screencasts

  1. RegLib_C49 Registration Screencast (start-finish)

Procedure

  1. Prepare Masks: see also movie above
    1. two masks for the B0 and T2 are already provided with the dataset. For examples on how to obtain masks quickly from your image data see:
    2. We will use these masks for the registration. To ensure sufficient points outside the brain surface can participate in the registration, we dilate the two masks slightly to extend beyond the brain:
    3. go to the Documentation/Nightly/Modules/Editor ''Editor'' module
    4. Master Volume: T2
    5. Merge Volume: T2_mask
    6. click on the Dilation Tool. Set label to 1. Ensure T2_mask is visible in the slice views
    7. click on the "Dilate" button once. You should see the boundary expand. Because there is little interstitial space/cortical CSF, we dilate only little to avoid including the skull in the ROI.
    8. switch MergeVolume to B0 and the Merge Volume to B0_mask
    9. again select the Dilate tool and click "Dilate" 2-3 times. We can afford to dilate more here since the skull is very dark in the B0.
  2. Affine Register T2-B0
    1. go to the General Registration (BRAINS) module
    2. Input Images: Fixed Image Volume: B0
    3. Input Images: Moving Image Volume: T2
    4. Output Settings:
      1. Slicer Linear Transform (create new transform, rename to: "Xf1_T2-B0_Affine")
      2. Output Image Volume none. No resampling required for linear transforms
    5. Registration Phases: select/check Rigid , Rigid+Scale, Affine
    6. Main Parameters:
      1. increase Number Of Samples to 300,000
    7. Mask Option: select ROI button
      1. Masking input fixed: select B0_mask
      2. Masking input moving: select T2_mask
    8. Leave all other settings at default
    9. click: Apply; runtime < 1 min.
  3. BSpline Register T2-B0
    1. leave B0 and T2 as fixed and moving volumes
    2. Output Settings:
      1. Slicer Linear Transform select None
      2. Slicer BSpline Transform create new, rename to "Xf2_T2-B0_BSpline" or similar
      3. Output Image Volume: create new and rename to "T2_Xf2". Resampling is required for nonrigid transforms.
    3. Registration Phases: unchheck Rigid , Rigid+Scale, Affine and check "BSpline" only
    4. Main Parameters:
      1. increase Number Of Samples to at least 300,000
      2. BSpline Grid Size: set to 10,10,5 or similar. Note we have lower resolution in the z-direction, hence we reduce the grid size there.
      3. leave masking settings as before
    5. click: Apply; runtime < 3 min.
    6. we now have the T2 aligned with the DTI. Place T2_Xf2 and B0 in the foreground and background and use the fade slider to view the result
  4. Affine Register T1-T2
    1. go to the General Registration (BRAINS) module
    2. Input Images: Fixed Image Volume: T2
    3. Input Images: Moving Image Volume: T1
    4. Output Settings:
      1. Slicer Linear Transform (create new transform, rename to: "Xf3_T1-T2_Affine")
      2. Output Image Volume none. No resampling required for linear transforms
    5. Registration Phases: select/check Rigid , Rigid+Scale, Affine
    6. Main Parameters:
      1. Number Of Samples to 300,000
    7. Mask Option: select "NOMASK" button
      1. Masking input fixed: select "None"
      2. Masking input moving: select "None"
    8. Leave all other settings at default
    9. click: Apply; runtime < 1 min.
    10. verify the alignment in the Slice views
    11. go to the Data module, note that the T1 has been placed inside the Xf3 transform.
    12. right click on the T1 image inside the transform. From the pop-up menu select Harden Transform. You should see the T1 node move back out to the main hierarchy level. You have now applied the new orientation to the T1 image, so we rename it to document that change:
    13. double click on T1 node, change name to "T1_Xf3" or similar
    14. we now have the T1 aligned with the T2. We can therefore apply the same transform "Xf2_T2-B0_BSpline" from above to the T1:
  5. Resample T1:
    1. Go to the Registration/Resample Image (BRAINS) module
      1. Image To Warp: T1_Xf3
      2. Reference Image: T2_Xf2 or B0
      3. Output Image: create new and rename to "T1_Xf3_Xf2" or similar
      4. Pixel Type: set to short
      5. Warping Parameters / Transform file: select "Xf2_T2-B0_BSpline"
      6. Interpolation Mode: select linear or WindowedSinc
    2. click Apply.
    3. we now have all images in the same orientation as the B0.

Registration Results

RegLib C49 unregistered.gif MR/CT before registration (click to enlarge)
RegLib C49 registered1 T2B0.gif alignment of T2 to B0 (click to enlarge)
RegLib C49 registered2 T1T2.gif preliminary affine alignment of T1 to T2 (click to enlarge)
RegLib C49 registered3 T1B0.gif final alignment of T1 to B0 (click to enlarge)

Acknowledgments

Many thanks to Mojdeh Zamyadi and Dr. E. Widjaja's lab from the Hospital for Sick Children in Toronto, Canada, for sharing the example data.