Difference between revisions of "Documentation/4.1/Modules/BRAINSFit"
(Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887) |
|||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | <noinclude>{{documentation/versioncheck}}</noinclude> | ||
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
{{documentation/{{documentation/version}}/module-header}} | {{documentation/{{documentation/version}}/module-header}} | ||
Line 19: | Line 20: | ||
}} | }} | ||
{{documentation/{{documentation/version}}/module-introduction-end}} | {{documentation/{{documentation/version}}/module-introduction-end}} | ||
− | |||
− | |||
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
{{documentation/{{documentation/version}}/module-section|Module Description}} | {{documentation/{{documentation/version}}/module-section|Module Description}} | ||
{{documentation/{{documentation/version}}/module-description}} | {{documentation/{{documentation/version}}/module-description}} | ||
− | |||
− | |||
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
{{documentation/{{documentation/version}}/module-section|Use Cases}} | {{documentation/{{documentation/version}}/module-section|Use Cases}} | ||
Most frequently used for these scenarios: | Most frequently used for these scenarios: | ||
− | + | # '''''Same Subject: Longitudinal''''' | |
− | For this | + | For this case we're registering a baseline T1 scan with a follow-up T1 scan on the same subject a year later. The two images are available on the [http://midas.kitware.com/item/view/483 Midas site] as test.nii.gz and test2.nii.gz |
− | First | + | First, set the fixed and moving volumes: |
+ | <pre> | ||
+ | --fixedVolume test.nii.gz \ | ||
+ | --movingVolume test2.nii.gz \ | ||
+ | </pre> | ||
+ | Next, set the output transform and volume: | ||
<pre> | <pre> | ||
− | |||
− | |||
--outputVolume testT1LongRegFixed.nii.gz \ | --outputVolume testT1LongRegFixed.nii.gz \ | ||
--outputTransform longToBase.xform \ | --outputTransform longToBase.xform \ | ||
</pre> | </pre> | ||
− | Since | + | Since the input scans are of the same subject we can assume very little has changed in the last year, so we'll use a Rigid registration. |
<pre> | <pre> | ||
--transformType Rigid \ | --transformType Rigid \ | ||
</pre> | </pre> | ||
− | The scans are the same modality so we'll use --histogramMatch to match the intensity profiles as this tends to help registration. If there are lesions or tumors that vary between images this may not be a good idea, | + | {{note}}If the registration is poor or there are reasons to expect anatomical changes (tumor growth, rapid disease progression, etc.) additional transforms may be needed. In that case they can be added in a comma separated list, such as "Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline". Available methods are: |
+ | * Rigid | ||
+ | * ScaleVersor3D | ||
+ | * ScaleSkewVersor3D | ||
+ | * Affine | ||
+ | * BSpline | ||
+ | <pre title="Example: multiple registration methods"> | ||
+ | Example: multiple registration methods | ||
+ | --transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \ | ||
+ | </pre> | ||
+ | The scans are the same modality so we'll use --histogramMatch to match the intensity profiles as this tends to help the registration. If there are lesions or tumors that vary between images this may not be a good idea, since it will make it harder to detect differences between the images. | ||
<pre> | <pre> | ||
--histogramMatch \ | --histogramMatch \ | ||
</pre> | </pre> | ||
− | To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present. | + | To start with the best possible initial alignment we use --initializeTransformMode. The available transform modes are: |
+ | * useCenterOfHeadAlign | ||
+ | * useCenterOfROIAlign | ||
+ | * useMomentsAlign | ||
+ | * useGeometryAlign | ||
+ | We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present. | ||
<pre> | <pre> | ||
--initializeTransformMode useCenterOfHeadAlign \ | --initializeTransformMode useCenterOfHeadAlign \ | ||
</pre> | </pre> | ||
− | ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO. | + | ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO (other options are NOMASK and ROI). |
<pre> | <pre> | ||
--maskProcessingMode ROIAUTO \ | --maskProcessingMode ROIAUTO \ | ||
</pre> | </pre> | ||
− | The registration generally performs better if we include some background in the mask | + | The registration generally performs better if we include some background in the mask to make the tissue boundary very clear. The parameter that expands the mask outside the brain is ROIAutoDilateSize (under "Registration Debugging Parameters" if using the GUI). These values are in millimeters and a good starting value is 3. |
<pre> | <pre> | ||
--ROIAutoDilateSize 3 \ | --ROIAutoDilateSize 3 \ | ||
</pre> | </pre> | ||
− | + | Lastly, we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed. If the best possible interpolation is needed regardless of processing time, select WindowedSync instead. | |
<pre> | <pre> | ||
--interpolationMode Linear | --interpolationMode Linear | ||
Line 68: | Line 83: | ||
The full command is: | The full command is: | ||
<pre> | <pre> | ||
− | BRAINSFit --fixedVolume | + | BRAINSFit --fixedVolume test.nii.gz \ |
− | --movingVolume | + | --movingVolume test2.nii.gz \ |
--outputVolume testT1LongRegFixed.nii.gz \ | --outputVolume testT1LongRegFixed.nii.gz \ | ||
--outputTransform longToBase.xform \ | --outputTransform longToBase.xform \ | ||
Line 85: | Line 100: | ||
|} | |} | ||
− | + | # '''''Same Subject: MultiModal''''' | |
− | For this use case we're registering a T1 scan with a T2 scan collected in the same session. The two images are again available on [http://midas.kitware.com/item/view/483 Midas] as | + | For this use case we're registering a T1 scan with a T2 scan collected in the same session. The two images are again available on the [http://midas.kitware.com/item/view/483 Midas site] as test.nii.gz and standard.nii.gz |
First we set the fixed and moving volumes as well as the output transform and output volume names. | First we set the fixed and moving volumes as well as the output transform and output volume names. | ||
<pre> | <pre> | ||
− | --fixedVolume | + | --fixedVolume test.nii.gz \ |
− | --movingVolume | + | --movingVolume standard.nii.gz \ |
--outputVolume testT2RegT1.nii.gz \ | --outputVolume testT2RegT1.nii.gz \ | ||
--outputTransform T2ToT1.xform \ | --outputTransform T2ToT1.xform \ | ||
Line 100: | Line 115: | ||
--transformType Rigid \ | --transformType Rigid \ | ||
</pre> | </pre> | ||
− | The scans are different modalities so we absolutely DO NOT want to use --histogramMatch to match the intensity profiles | + | The scans are different modalities so we absolutely DO NOT want to use --histogramMatch to match the intensity profiles! This would try to map T2 intensities into T1 intensities resulting in an image that is neither, and hence useless. |
To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present. | To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present. | ||
Line 106: | Line 121: | ||
--initializeTransformMode useCenterOfHeadAlign \ | --initializeTransformMode useCenterOfHeadAlign \ | ||
</pre> | </pre> | ||
− | ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO. | + | ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO (other options are NOMASK and ROI). |
<pre> | <pre> | ||
--maskProcessingMode ROIAUTO \ | --maskProcessingMode ROIAUTO \ | ||
</pre> | </pre> | ||
− | The registration generally performs better if we include some background in the mask | + | The registration generally performs better if we include some background in the mask to make the tissue boundary very clear. The parameter that expands the mask outside the brain is ROIAutoDilateSize (under "Registration Debugging Parameters" if using the GUI). These values are in millimeters and a good starting value is 3. |
<pre> | <pre> | ||
--ROIAutoDilateSize 3 \ | --ROIAutoDilateSize 3 \ | ||
</pre> | </pre> | ||
− | + | Lastly, we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed. If the best possible interpolation is needed regardless of processing time, select WindowedSync instead. | |
<pre> | <pre> | ||
--interpolationMode Linear | --interpolationMode Linear | ||
Line 121: | Line 136: | ||
The full command is: | The full command is: | ||
<pre> | <pre> | ||
− | BRAINSFit --fixedVolume | + | BRAINSFit --fixedVolume test.nii.gz \ |
− | --movingVolume | + | --movingVolume standard.nii.gz \ |
--outputVolume testT2RegT1.nii.gz \ | --outputVolume testT2RegT1.nii.gz \ | ||
--outputTransform T2ToT1.xform \ | --outputTransform T2ToT1.xform \ | ||
Line 137: | Line 152: | ||
|} | |} | ||
− | * ''''' | + | * '''''Mouse Registration''''' |
− | Here we'll register brains from two different mice together. The fixed and moving mouse brains used in this example are available on [http://midas.kitware.com/item/view/483 Midas]. | + | Here we'll register brains from two different mice together. The fixed and moving mouse brains used in this example are available on the [http://midas.kitware.com/item/view/483 Midas site] as mouseFixed.nii.gz and mouseMoving.nii.gz. |
First we set the fixed and moving volumes as well as the output transform and output volume names. | First we set the fixed and moving volumes as well as the output transform and output volume names. | ||
Line 148: | Line 163: | ||
--outputTransform movingToFixed.xform \ | --outputTransform movingToFixed.xform \ | ||
</pre> | </pre> | ||
− | Since the subjects are different we are going to use transforms all the way through BSpline. | + | Since the subjects are different we are going to use transforms all the way through BSpline. |
+ | {{note}}Building up transforms one type at a time can't hurt and might help, so we're including all transforms from Rigid through BSpline in the transformType parameter. | ||
<pre> | <pre> | ||
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \ | --transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \ | ||
Line 156: | Line 172: | ||
--histogramMatch \ | --histogramMatch \ | ||
</pre> | </pre> | ||
− | To start with the best possible initial alignment we use --initializeTransformMode but we | + | To start with the best possible initial alignment we use --initializeTransformMode but we aren't working with human heads this time, so we can't pick useCenterOfHeadAlign! Instead we pick useMomentsAlign which does a reasonable job of selecting the centers of mass. |
<pre> | <pre> | ||
--initializeTransformMode useMomentsAlign \ | --initializeTransformMode useMomentsAlign \ | ||
Line 164: | Line 180: | ||
--maskProcessingMode ROIAUTO \ | --maskProcessingMode ROIAUTO \ | ||
</pre> | </pre> | ||
− | Since the mouse brains are much smaller than human brains there are a few advanced parameters we'll need to tweak, ROIAutoClosingSize and ROIAutoDilateSize (both under Registration Debugging Parameters if using the GUI). These values are in millimeters | + | Since the mouse brains are much smaller than human brains there are a few advanced parameters we'll need to tweak, ROIAutoClosingSize and ROIAutoDilateSize (both under Registration Debugging Parameters if using the GUI). These values are in millimeters and a good starting value for mice is 0.9. |
<pre> | <pre> | ||
--ROIAutoClosingSize 0.9 \ | --ROIAutoClosingSize 0.9 \ | ||
--ROIAutoDilateSize 0.9 \ | --ROIAutoDilateSize 0.9 \ | ||
</pre> | </pre> | ||
− | + | Lastly, we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed. If the best possible interpolation is needed regardless of processing time, select WindowedSync instead. | |
<pre> | <pre> | ||
--interpolationMode Linear | --interpolationMode Linear | ||
Line 196: | Line 212: | ||
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
{{documentation/{{documentation/version}}/module-section|Tutorials}} | {{documentation/{{documentation/version}}/module-section|Tutorials}} | ||
− | + | TODO | |
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
Line 204: | Line 220: | ||
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
{{documentation/{{documentation/version}}/module-section|Similar Modules}} | {{documentation/{{documentation/version}}/module-section|Similar Modules}} | ||
− | * | + | Legacy |
+ | * [[Documentation/4.1/Modules/RigidRegistration]] | ||
+ | * [[Documentation/4.1/Modules/AffineRegistration]] | ||
+ | * [[Documentation/4.1/Modules/BSplineDeformableRegistration]] | ||
+ | * [[Documentation/4.1/Modules/ExpertAutomatedRegistration]] | ||
+ | * [[Documentation/4.1/Modules/LinearRegistration]] | ||
+ | * [[Documentation/4.1/Modules/MultiResolutionAffineRegistration]] | ||
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
Line 210: | Line 232: | ||
* [http://hdl.handle.net/1926/1291 BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit], Johnson H.J., Harris G., Williams K., The Insight Journal, 2007. | * [http://hdl.handle.net/1926/1291 BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit], Johnson H.J., Harris G., Williams K., The Insight Journal, 2007. | ||
* Source repository on [https://github.com/BRAINSia/BRAINSStandAlone/tree/master/BRAINSFit github] | * Source repository on [https://github.com/BRAINSia/BRAINSStandAlone/tree/master/BRAINSFit github] | ||
− | |||
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
{{documentation/{{documentation/version}}/module-section|Information for Developers}} | {{documentation/{{documentation/version}}/module-section|Information for Developers}} | ||
− | {{documentation/{{documentation/version}}/module-developerinfo}} | + | {{documentation/{{documentation/version}}/module-developerinfo-UIowa | BRAINSFit | Registration | See details above.}} |
Latest revision as of 07:27, 14 June 2013
Home < Documentation < 4.1 < Modules < BRAINSFit
For the latest Slicer documentation, visit the read-the-docs. |
Introduction and Acknowledgements
This work is part of the National Alliance for Medical Image Computing (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on NA-MIC can be obtained from the NA-MIC website. | |||||
|
Module Description
Use Cases
Most frequently used for these scenarios:
- Same Subject: Longitudinal
For this case we're registering a baseline T1 scan with a follow-up T1 scan on the same subject a year later. The two images are available on the Midas site as test.nii.gz and test2.nii.gz
First, set the fixed and moving volumes:
--fixedVolume test.nii.gz \ --movingVolume test2.nii.gz \
Next, set the output transform and volume:
--outputVolume testT1LongRegFixed.nii.gz \ --outputTransform longToBase.xform \
Since the input scans are of the same subject we can assume very little has changed in the last year, so we'll use a Rigid registration.
--transformType Rigid \
If the registration is poor or there are reasons to expect anatomical changes (tumor growth, rapid disease progression, etc.) additional transforms may be needed. In that case they can be added in a comma separated list, such as "Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline". Available methods are:
- Rigid
- ScaleVersor3D
- ScaleSkewVersor3D
- Affine
- BSpline
Example: multiple registration methods --transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \
The scans are the same modality so we'll use --histogramMatch to match the intensity profiles as this tends to help the registration. If there are lesions or tumors that vary between images this may not be a good idea, since it will make it harder to detect differences between the images.
--histogramMatch \
To start with the best possible initial alignment we use --initializeTransformMode. The available transform modes are:
- useCenterOfHeadAlign
- useCenterOfROIAlign
- useMomentsAlign
- useGeometryAlign
We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present.
--initializeTransformMode useCenterOfHeadAlign \
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO (other options are NOMASK and ROI).
--maskProcessingMode ROIAUTO \
The registration generally performs better if we include some background in the mask to make the tissue boundary very clear. The parameter that expands the mask outside the brain is ROIAutoDilateSize (under "Registration Debugging Parameters" if using the GUI). These values are in millimeters and a good starting value is 3.
--ROIAutoDilateSize 3 \
Lastly, we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed. If the best possible interpolation is needed regardless of processing time, select WindowedSync instead.
--interpolationMode Linear
The full command is:
BRAINSFit --fixedVolume test.nii.gz \ --movingVolume test2.nii.gz \ --outputVolume testT1LongRegFixed.nii.gz \ --outputTransform longToBase.xform \ --transformType Rigid \ --histogramMatch \ --initializeTransformMode useCenterOfHeadAlign \ --maskProcessingMode ROIAUTO \ --ROIAutoDilateSize 3 \ --interpolationMode Linear
- Same Subject: MultiModal
For this use case we're registering a T1 scan with a T2 scan collected in the same session. The two images are again available on the Midas site as test.nii.gz and standard.nii.gz
First we set the fixed and moving volumes as well as the output transform and output volume names.
--fixedVolume test.nii.gz \ --movingVolume standard.nii.gz \ --outputVolume testT2RegT1.nii.gz \ --outputTransform T2ToT1.xform \
Since these are the same subject, same session we'll use a Rigid registration.
--transformType Rigid \
The scans are different modalities so we absolutely DO NOT want to use --histogramMatch to match the intensity profiles! This would try to map T2 intensities into T1 intensities resulting in an image that is neither, and hence useless.
To start with the best possible initial alignment we use --initializeTransformMode. We're working with human heads so we pick useCenterOfHeadAlign, which detects the center of head even with varying amounts of neck or shoulders present.
--initializeTransformMode useCenterOfHeadAlign \
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO (other options are NOMASK and ROI).
--maskProcessingMode ROIAUTO \
The registration generally performs better if we include some background in the mask to make the tissue boundary very clear. The parameter that expands the mask outside the brain is ROIAutoDilateSize (under "Registration Debugging Parameters" if using the GUI). These values are in millimeters and a good starting value is 3.
--ROIAutoDilateSize 3 \
Lastly, we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed. If the best possible interpolation is needed regardless of processing time, select WindowedSync instead.
--interpolationMode Linear
The full command is:
BRAINSFit --fixedVolume test.nii.gz \ --movingVolume standard.nii.gz \ --outputVolume testT2RegT1.nii.gz \ --outputTransform T2ToT1.xform \ --transformType Rigid \ --initializeTransformMode useCenterOfHeadAlign \ --maskProcessingMode ROIAUTO \ --ROIAutoDilateSize 3 \ --interpolationMode Linear
- Mouse Registration
Here we'll register brains from two different mice together. The fixed and moving mouse brains used in this example are available on the Midas site as mouseFixed.nii.gz and mouseMoving.nii.gz.
First we set the fixed and moving volumes as well as the output transform and output volume names.
--fixedVolume mouseFixed.nii.gz \ --movingVolume mouseMoving.nii.gz \ --outputVolume movingRegFixed.nii.gz \ --outputTransform movingToFixed.xform \
Since the subjects are different we are going to use transforms all the way through BSpline. Building up transforms one type at a time can't hurt and might help, so we're including all transforms from Rigid through BSpline in the transformType parameter.
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \
The scans are the same modality so we'll use --histogramMatch.
--histogramMatch \
To start with the best possible initial alignment we use --initializeTransformMode but we aren't working with human heads this time, so we can't pick useCenterOfHeadAlign! Instead we pick useMomentsAlign which does a reasonable job of selecting the centers of mass.
--initializeTransformMode useMomentsAlign \
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.
--maskProcessingMode ROIAUTO \
Since the mouse brains are much smaller than human brains there are a few advanced parameters we'll need to tweak, ROIAutoClosingSize and ROIAutoDilateSize (both under Registration Debugging Parameters if using the GUI). These values are in millimeters and a good starting value for mice is 0.9.
--ROIAutoClosingSize 0.9 \ --ROIAutoDilateSize 0.9 \
Lastly, we set the interpolation mode to be Linear, which is a decent tradeoff between quality and speed. If the best possible interpolation is needed regardless of processing time, select WindowedSync instead.
--interpolationMode Linear
The full command is:
BRAINSFit --fixedVolume mouseFixed.nii.gz \ --movingVolume mouseMoving.nii.gz \ --outputVolume movingRegFixed.nii.gz \ --outputTransform movingToFixed.xform \ --transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \ --histogramMatch \ --initializeTransformMode useMomentsAlign \ --maskProcessingMode ROIAUTO \ --ROIAutoClosingSize 0.9 \ --ROIAutoDilateSize 0.9 \ --interpolationMode Linear
Tutorials
TODO
Panels and their use
Parameters:
* ' ** ':
Similar Modules
Legacy
- Documentation/4.1/Modules/RigidRegistration
- Documentation/4.1/Modules/AffineRegistration
- Documentation/4.1/Modules/BSplineDeformableRegistration
- Documentation/4.1/Modules/ExpertAutomatedRegistration
- Documentation/4.1/Modules/LinearRegistration
- Documentation/4.1/Modules/MultiResolutionAffineRegistration
References
- BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit, Johnson H.J., Harris G., Williams K., The Insight Journal, 2007.
- Source repository on github
Information for Developers
See details above. |