<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hjmjohnson</id>
	<title>Slicer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hjmjohnson"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/wiki/Special:Contributions/Hjmjohnson"/>
	<updated>2026-07-06T14:46:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer&amp;diff=63178</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer&amp;diff=63178"/>
		<updated>2020-04-15T12:35:08Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Slicer backward incompatible changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__TOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
==Slicer backward incompatible changes==&lt;br /&gt;
&lt;br /&gt;
===Slicer 5.0: API changes since 4.10===&lt;br /&gt;
&lt;br /&gt;
*Removed protected method &amp;lt;tt&amp;gt;vtkMRMLModelDisplayableManager::FindPickedDisplayNodeFromMesh&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Python 2 to Python 3====&lt;br /&gt;
&lt;br /&gt;
Slicer core has been updated to only support Python 3.&lt;br /&gt;
&lt;br /&gt;
C++ classes and python scripts have been updated to use idioms and constructs only available in Python 3.&lt;br /&gt;
&lt;br /&gt;
Update to python scripts have been done leveraging the CLI provided by https://python-future.org by (1) iteratively applying each one of the associates &amp;quot;fixes&amp;quot;, (2) reviewing associated changes and (3) updating as needed.&lt;br /&gt;
&lt;br /&gt;
Updates specific to extensions are discussed in [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Slicer_5.0:_Python2_to_Python3]]&lt;br /&gt;
&lt;br /&gt;
====Interactor styles====&lt;br /&gt;
&lt;br /&gt;
Limitations of VTK widgets (editable points, lines, curves, etc.) prevented Slicer from having sophisticated user interaction in slice and 3D views. In Slicer5, we replaced VTK widgets with MRML widgets. These widgets are still VTK-based and somewhat similar to VTK widgets, but they operate directly on MRML nodes, they use direct method calls between widgets and their representation, and they use a more efficient and flexible event processing. Instead of hardcoding how viewers behave in response to interaction (mouse move, button click, keyboard, ...) events in an interactor style, all these events are translated to actions and performed in a MRML widget. Most modules are not expected to observe interactor events or styles directly, but if they did, then they may need to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
*vtkSliceViewInteractorStyle renamed to vtkMRMLSliceDViewInteractorStyle to reflect that it uses MRML classes directly.&lt;br /&gt;
*vtkThreeDViewInteractorStyle renamed to vtkMRMLThreeDViewInteractorStyle to reflect that it uses MRML classes directly.&lt;br /&gt;
&lt;br /&gt;
====slicer.util functions====&lt;br /&gt;
&lt;br /&gt;
*slicer.util.loadVolume (and other node load functions) now return the loaded node instead of a True/False flag. In case of an error, a RuntimeError exception is thrown.&lt;br /&gt;
**Old way of loading a node and get it in a variable: &amp;lt;code&amp;gt;volumeNode = slicer.util.loadVolume('path/to/volume.nrrd', returnNode=True)[1]&amp;lt;/code&amp;gt;&lt;br /&gt;
**New way of loading a node and get it in a variable: &amp;lt;code&amp;gt;volumeNode = slicer.util.loadVolume('path/to/volume.nrrd')&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Markups====&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;tt&amp;gt;vtkCommand::Modified&amp;lt;/tt&amp;gt; events are no longer invoked when control points are added/removed/modified to improve performance. Modules that need to know If a point position is modified need to add observers to &amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointAddedEvent&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointRemovedEvent&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointModifiedEvent&amp;lt;/tt&amp;gt; events. See example in [[Documentation/Nightly/ScriptRepository#Get_a_notification_if_a_markup_point_position_is_modified|script repository]].&lt;br /&gt;
*&amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::MarkupAddedEvent&amp;lt;/tt&amp;gt; is renamed to &amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointAddedEvent&amp;lt;/tt&amp;gt;. This is called even when preview point is created. Use &amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointPositionDefinedEvent&amp;lt;/tt&amp;gt; to get notification only when position of a point becomes defined (and not during preview).&lt;br /&gt;
*&amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::MarkupRemovedEvent&amp;lt;/tt&amp;gt; is renamed to &amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointRemovedEvent&amp;lt;/tt&amp;gt;. This is called even when preview point is removed. Use &amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointPositionUndefinedEvent&amp;lt;/tt&amp;gt; to get notification only when position of a point becomes undefined (and not during preview).&lt;br /&gt;
*&amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::NthMarkupModifiedEvent&amp;lt;/tt&amp;gt; is replaced by &amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointModifiedEvent&amp;lt;/tt&amp;gt;&lt;br /&gt;
*During placement of markups, a preview markup point is created. If number of already placed markup points needs to be determined then &amp;lt;code&amp;gt;GetNumberOfDefinedControlPoints()&amp;lt;/code&amp;gt; method can be used.&lt;br /&gt;
*&amp;lt;tt&amp;gt;GetDefaultMarkups...()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;SetDefaultMarkups...()&amp;lt;/tt&amp;gt; methods are removed. Instead default display node can be accessed by &amp;lt;tt&amp;gt;GetDefaultMarkupsDisplayNode()&amp;lt;/tt&amp;gt; method and default values can be get/set in that class.&lt;br /&gt;
*&amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::GetNthMarkupSelected()&amp;lt;/tt&amp;gt; is replaced by &amp;lt;tt&amp;gt;GetNthControlPointSelected()&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointPositionDefinedEvent&amp;lt;/tt&amp;gt; event is added. This event is invoked whenever position is defined for a new point.&lt;br /&gt;
*&amp;lt;tt&amp;gt;vtkMRMLMarkupsNode::PointPositionUndefinedEvent&amp;lt;/tt&amp;gt; event is added. This event is invoked whenever point with defined position is removed (point is deleted or its position gets undefined).&lt;br /&gt;
*For more details, see [{{doxygen-class-url|vtkMRMLMarkupsNode}} vtkMRMLMarkupsNode]&lt;br /&gt;
&lt;br /&gt;
====Segmentations====&lt;br /&gt;
&lt;br /&gt;
Binary labelmap segmentations can now be represented as shared labelmaps.&lt;br /&gt;
The previous implementation of binary labelmaps was performance intensive as each labelmap was represented using a separate vtkDataObject.&lt;br /&gt;
Visualizing and editing segmentations that contained a large number of segments could cause performance issues, due to the large number of vtkActors required, as well as calculating masks and overwriting other segments when editing.&lt;br /&gt;
&lt;br /&gt;
By default, newly created segments will now be contained on the same layer.&lt;br /&gt;
Segments will only be separated into multiple layers if the user creates an overlapping segment when editing.&lt;br /&gt;
&lt;br /&gt;
Segments are now saved as a 4D volume with shared 3D layers.&lt;br /&gt;
For a segmentation that only uses one layer, the resulting image is a 3D volume.&lt;br /&gt;
Before saving, the labelmaps will be collapsed into as few layers as possible.&lt;br /&gt;
&lt;br /&gt;
*seg.nrrd files now contain two additional attributes for each segment: SegmentX_LabelValue and SegmentX_Layer&lt;br /&gt;
*The label value of a segment can be found using vtkSegment::GetLabelValue()&lt;br /&gt;
*Whether or not a segment is shared can be found using vtkSegmentation::IsSharedBinaryLabelmap()&lt;br /&gt;
*The other segments sharing the same labelmap can be found using vtkSegmentation::GetSegmentIDsSharingBinaryLabelmapRepresentation()&lt;br /&gt;
*Segment editor effects should generally use modifySelectedSegmentByLabelmap rather than SetBinaryLabelmapToSegment to manage layer separation&lt;br /&gt;
*Conversion rules now call PreConvert() and PostConvert() before and after conversion to perform pre and post processing steps on the segmentation as a whole&lt;br /&gt;
*The function signature for vtkSegmentationConverterRule::Convert now accepts a vtkSegment rather than two vtkDataObjects&lt;br /&gt;
*slicer.util.arrayFromSegment has been deprecated. slicer.util.arrayFromSegmentBinaryLabelmap and slicer.util.arrayFromSegmentInternalBinaryLabelmap can be used instead&lt;br /&gt;
&lt;br /&gt;
=====Erase the contents of a single segment=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentation = segmentationNode.GetSegmentation()&lt;br /&gt;
segmentation.ClearSegment(segmentId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Move a segment from a shared labelmap to a separate layer=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentation = segmentationNode.GetSegmentation()&lt;br /&gt;
segmentation.SeparateSegmentLabelmap(segmentId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Combine all binary labelmaps to as few layers as possible=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentation = segmentationNode.GetSegmentation()&lt;br /&gt;
segmentation.CollapseBinaryLabelmaps(forceToSingleLayer=false)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Get a read-only labelmap for a single segment:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
labelmap = slicer.vtkOrientedImageData()&lt;br /&gt;
segmentationNode.GetBinaryLabelmapRepresentation(segmentId, labelmap)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(similarly, use GetClosedSurfaceRepresentation with an additional vtk.vtkPolyData parameter to get a read-only surface mesh)&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
labelmapNumpyArray = slicer.util.arrayFromSegmentBinaryLabelmap(segmentationNode, segmentId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Get a modifiable shared labelmap=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
labelmap = slicer.vtkOrientedImageData()&lt;br /&gt;
segmentationNode.GetBinaryLabelmapInternalRepresentation(segmentId, labelmap)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(similarly, use GetClosedSurfaceInternalRepresentation to get a modifiable surface mesh)&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
labelmapNumpyArray = slicer.util.arrayFromSegmentInternalBinaryLabelmap(segmentationNode, segmentId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Export segments to models=====&lt;br /&gt;
&lt;br /&gt;
Model hierarchies no longer exist in Slicer5, but instead various kinds of hierarchies are now replaced by &amp;quot;subject hierarchy&amp;quot;, which can accommodate any node types in a single hierarchy. Accordingly, `ExportSegmentsToModelHierarchy`, `ExportAllSegmentsToModelHierarchy`, etc. are replaced by `ExportSegmentsToModels`, `ExportAllSegmentsToModels`, which take a subject hierarchy folder item ID as input.&lt;br /&gt;
Documentation/Nightly&lt;br /&gt;
See code example in [[Documentation/{{documentation/version}}/ScriptRepository#Export_model_nodes_from_segmentation_node|script repository]].&lt;br /&gt;
&lt;br /&gt;
====Volume rendering====&lt;br /&gt;
&lt;br /&gt;
vtkMRMLVolumeRenderingDisplayNode::SetAndObserveVolumeNodeID method was removed, as display node base class already maintains a pointer to the displayed (volume) node. To associate a volume display node with a volume node, call &amp;lt;pre&amp;gt;volumeNode-&amp;gt;AddAndObserveDisplayNodeID(volumeRenderingDisplayNode-&amp;gt;GetID());&amp;lt;/pre&amp;gt; after both nodes are added to the scene.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5.0 : Avoid typedef of anonymous structure ==&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://reviews.llvm.org/D74103&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Due to a recent (but retroactive) C++ rule change, only sufficiently&lt;br /&gt;
&lt;br /&gt;
C-compatible classes are permitted to be given a typedef name for&lt;br /&gt;
&lt;br /&gt;
linkage purposes. Add an enabled-by-default warning for these cases, and&lt;br /&gt;
&lt;br /&gt;
rephrase our existing error for the case where we encounter the typedef&lt;br /&gt;
&lt;br /&gt;
name for linkage after we've already computed and used a wrong linkage&lt;br /&gt;
&lt;br /&gt;
in terms of the new rule.&amp;lt;blockquote&amp;gt;Slicer/Libs/MRML/Core/vtkMRMLTableStorageNode.h:95:17:&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;  typedef struct&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;                ^&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;                ColumnInfo&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;Slicer/Libs/MRML/Core/vtkMRMLTableStorageNode.h:99:5:&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;note: type is not C-compatible due to this default member initializer&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;    int ScalarType = VTK_STRING;&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;nowiki&amp;gt;    ^~~~~~~~~~~~~~&amp;lt;/nowiki&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;Slicer/Libs/MRML/Core/vtkMRMLTableStorageNode.h:102:5:&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;note: type is given name 'ColumnInfo' for linkage purposes by this typedef declaration&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;  } ColumnInfo;&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;    ^&amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;For consistency, Use 'using' to a named structure definintion for all &amp;lt;/blockquote&amp;gt;&amp;lt;blockquote&amp;gt;structures.&amp;lt;/blockquote&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Slicer 4.11: Variable CMAKE_DEFAULT_BUILD_TYPE renamed to Slicer_DEFAULT_BUILD_TYPE===&lt;br /&gt;
&lt;br /&gt;
Setting the default build type for single config generator may be done setting &amp;lt;tt&amp;gt;Slicer_DEFAULT_BUILD_TYPE&amp;lt;/tt&amp;gt; instead of &amp;lt;tt&amp;gt;CMAKE_DEFAULT_BUILD_TYPE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  CMake Error:&lt;br /&gt;
     Generator&lt;br /&gt;
&lt;br /&gt;
       Visual Studio 15 2017&lt;br /&gt;
&lt;br /&gt;
     does not support variable&lt;br /&gt;
&lt;br /&gt;
       CMAKE_DEFAULT_BUILD_TYPE&lt;br /&gt;
&lt;br /&gt;
     but it has been specified.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://github.com/Slicer/Slicer/pull/4799&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.11: teem python module renamed to vtkTeem, explicit import required===&lt;br /&gt;
&lt;br /&gt;
*Since the module provides VTK classes interfacing with &amp;quot;teem&amp;quot;, the name is now representative of the class it contains.&lt;br /&gt;
*&amp;lt;tt&amp;gt;vtkTeem&amp;lt;/tt&amp;gt; classes are expected to be used by explicitly importing the module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Replace code like this:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import teem&lt;br /&gt;
&lt;br /&gt;
class CalculateTensorScalars(object):&lt;br /&gt;
  def __init__(self):&lt;br /&gt;
    self.dti_math = teem.vtkDiffusionTensorMathematics()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;By this:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import vtkTeem&lt;br /&gt;
&lt;br /&gt;
class CalculateTensorScalars(object):&lt;br /&gt;
  def __init__(self):&lt;br /&gt;
    self.dti_math = vtkTeem.vtkDiffusionTensorMathematics()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.11: Display window/level (brightness/contrast) adjustment===&lt;br /&gt;
&lt;br /&gt;
*A new &amp;quot;Window/level&amp;quot; mouse interaction mode was introduced. Volume display window/level can only be changed if this mode is activated by clicking the corresponding button in the toolbar. The new mouse mode prevents accidental modification of volume window/level (when for example the user accidentally clicked too far from a markup) and it also allows more sophisticated window/level adjustments.&lt;br /&gt;
*New region-based auto window/level feature added: activate &amp;quot;Window/level&amp;quot; mouse mode and use Ctrl + left-click-and-drag to highlight a region and optimize window/level for that (pressing Escape or right-click cancels the operation).&lt;br /&gt;
*Auto window/level reset: activate &amp;quot;Window/level&amp;quot; mouse mode and double-click the left mouse button.&lt;br /&gt;
*Improved auto window/level algorithm to prevent too bright display of images. Window/level is set to display values between 0.1th and 99.9th percentile of gray levels. See details here: https://discourse.slicer.org/t/feedback-requested-how-to-improve-mouse-interaction-in-views/6420.&lt;br /&gt;
*Removed class &amp;lt;tt&amp;gt;vtkImageBimodalAnalysis&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.10: Registration of runTest function done in ScriptedLoadableModule base class===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27617 r27617]:&lt;br /&gt;
&lt;br /&gt;
*the &amp;lt;code&amp;gt;ScriptedLoadableModule&amp;lt;/code&amp;gt; class takes care of registering the &amp;lt;code&amp;gt;runTest&amp;lt;/code&amp;gt; function.&lt;br /&gt;
*the &amp;lt;code&amp;gt;runTest&amp;lt;/code&amp;gt; function expects &amp;lt;code&amp;gt;msec&amp;lt;/code&amp;gt; keyword argument.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File &amp;quot;/path/to/Slicer-SuperBuild/Slicer-build/bin/Python/slicer/ScriptedLoadableModule.py&amp;quot;, line 205, in onReloadAndTest&lt;br /&gt;
    test(msec=int(slicer.app.userSettings().value(&amp;quot;Developer/SelfTestDisplayMessageDelay&amp;quot;)), **kwargs)&lt;br /&gt;
TypeError: runTest() got an unexpected keyword argument 'msec'&lt;br /&gt;
Reload and Test: Exception!&lt;br /&gt;
&lt;br /&gt;
runTest() got an unexpected keyword argument 'msec'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Replace code like this:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class sceneImport2428(ScriptedLoadableModule):&lt;br /&gt;
  [...]&lt;br /&gt;
  def __init__(self, parent):&lt;br /&gt;
    ScriptedLoadableModule.__init__(self, parent)&lt;br /&gt;
    parent.title = &amp;quot;...&amp;quot;&lt;br /&gt;
    [...]&lt;br /&gt;
    parent.acknowledgementText = &amp;quot;...&amp;quot;&lt;br /&gt;
    self.parent = parent 	 &lt;br /&gt;
	  	 &lt;br /&gt;
    # Add this test to the SelfTest module's list for discovery when the module 	 &lt;br /&gt;
    # is created.  Since this module may be discovered before SelfTests itself, 	 &lt;br /&gt;
    # create the list if it doesn't already exist. 	 &lt;br /&gt;
    try: 	 &lt;br /&gt;
      slicer.selfTests 	 &lt;br /&gt;
    except AttributeError: 	 &lt;br /&gt;
      slicer.selfTests = {} 	 &lt;br /&gt;
    slicer.selfTests['sceneImport2428'] = self.runTest 	 &lt;br /&gt;
 &lt;br /&gt;
  def runTest(self): 	 &lt;br /&gt;
    tester = sceneImport2428Test() 	 &lt;br /&gt;
    tester.runTest()&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;By this:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class sceneImport2428(ScriptedLoadableModule):&lt;br /&gt;
  [...]&lt;br /&gt;
  def __init__(self, parent):&lt;br /&gt;
    ScriptedLoadableModule.__init__(self, parent)&lt;br /&gt;
    parent.title = &amp;quot;...&amp;quot;&lt;br /&gt;
    [...]&lt;br /&gt;
    parent.acknowledgementText = &amp;quot;...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Update of VTK version from 9.0 to 8.2===&lt;br /&gt;
&lt;br /&gt;
Following [https://github.com/Kitware/VTK/commit/b703d78be3ffd8ae69c319afa0230097ff270f26 kitware/VTK@b703d78be], VTK has updated to use version number 8.2 instead of 9.0. This was discussed in on the VTK mailing list in http://vtk.1045678.n5.nabble.com/Discussion-OK-to-change-VTK-s-version-number-from-9-0-to-8-2-tt5748702.html&lt;br /&gt;
&lt;br /&gt;
At first, this VTK commit and its companion [https://github.com/Kitware/VTK/commit/8a00b357e84eec695bda049216f30f2b76d80855 kitware/VTK@8a00b357e] were both reverted from the [https://github.com/Slicer/VTK/ Slicer/VTK] fork. Then, since having the corresponding changes reverted in VTK was not possible, it was decided to also update Slicer. This was done in the following commits:&lt;br /&gt;
&lt;br /&gt;
*[http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27472 r27472]: COMP: Update c++ classes to support building against VTK &amp;gt;= 9 and VTK &amp;gt;= 8.2&lt;br /&gt;
*[http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27473 r27473]: COMP: Update VTK to include version change from 9.0 to 8.2. Fixes #4623&lt;br /&gt;
&lt;br /&gt;
This means that code depending on VTK must also be updated to include similar fixes.&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
  #if VTK_MAJOR_VERSION &amp;gt;= 9&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
  #if VTK_MAJOR_VERSION &amp;gt;= 9 || (VTK_MAJOR_VERSION &amp;gt;= 8 &amp;amp;&amp;amp; VTK_MINOR_VERSION &amp;gt;= 2)&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
  #if VTK_MAJOR_VERSION &amp;lt; 9&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
  #if VTK_MAJOR_VERSION &amp;lt;= 7 || (VTK_MAJOR_VERSION &amp;lt;= 8 &amp;amp;&amp;amp; VTK_MINOR_VERSION &amp;lt;= 1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: ITK_LEGACY_REMOVE is now OFF===&lt;br /&gt;
In preparation to switch to ITK 5.0, we disable legacy functionality in ITK. This might affect some modules which rely on ITK. Take a look at [https://itk.org/migrationv4 ITK 4 migration guide] before [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md ITK 5 migration guide].&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: vtkMRMLPlotDataNode renamed to vtkMRMLPlotSeriesNode===&lt;br /&gt;
Plotting was improved in [https://github.com/Slicer/Slicer/commit/082edc40c this commit]&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
  vtkMRMLPlotDataNode&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
  vtkMRMLPlotSeriesNode&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: CMake: Module MIDAS not available===&lt;br /&gt;
&lt;br /&gt;
The test infrastructure of your project should be updated to use [https://cmake.org/cmake/help/latest/module/ExternalData.html ExternalData] built-in CMake module&lt;br /&gt;
instead of the specific &amp;lt;tt&amp;gt;MIDAS&amp;lt;/tt&amp;gt; module.&lt;br /&gt;
&lt;br /&gt;
See EMSegment commit [http://viewvc.slicer.org/viewvc.cgi/Slicer3?view=revision&amp;amp;revision=17150 r17150] for an example of transition.&lt;br /&gt;
&lt;br /&gt;
This means that instead of using &amp;lt;tt&amp;gt;midas_add_test&amp;lt;/tt&amp;gt; with the &amp;lt;tt&amp;gt;MIDAS{path/to/file.ext.md5}&amp;lt;/tt&amp;gt;&lt;br /&gt;
syntax for addressing the test data, the function [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_test ExternalData_add_target] is used by&lt;br /&gt;
specifying both &amp;lt;tt&amp;gt;DATA{path/to/file.ext}&amp;lt;/tt&amp;gt; and a download target name.&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
  midas_add_test(NAME test1 COMMAND ...)&lt;br /&gt;
  midas_add_test(NAME test2 COMMAND ...)&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
&lt;br /&gt;
  ExternalData_add_test(EMSegmentData NAME test1 COMMAND ...)&lt;br /&gt;
  ExternalData_add_test(EMSegmentData NAME test2 COMMAND ...)&lt;br /&gt;
  &lt;br /&gt;
  [...]&lt;br /&gt;
  &lt;br /&gt;
  ExternalData_add_target(EMSegmentData)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A key difference with the former approaches is that instead of adding two tests (one named&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;testName&amp;gt;_fetchData&amp;lt;/tt&amp;gt; to downoad the data and one running the test command), only one&lt;br /&gt;
test is added but a common download target is added at the end using [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_target ExternalData_add_target]&lt;br /&gt;
function.&lt;br /&gt;
&lt;br /&gt;
This means that test data can now be downloaded in parallel (and cached) at build time instead&lt;br /&gt;
of testing time.&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: CMake: Module SlicerMacroCheckExternalProjectDependency not available===&lt;br /&gt;
&lt;br /&gt;
Since the module was removed in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26992 r26992], consider updating&lt;br /&gt;
your build system to use CMake module &amp;lt;code&amp;gt;ExternalProjectDependency&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: CMake: Module SlicerMacroEmptyExternalProject not available===&lt;br /&gt;
&lt;br /&gt;
Since the module was removed in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26991 r26991]&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include(SlicerMacroEmptyExternalProject)&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
SlicerMacroEmptyExternalProject(&amp;quot;${proj}&amp;quot; &amp;quot;${${proj}_DEPENDENCIES}&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include(ExternalProjectDependency)&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: CMake: Module SlicerBlockSetCMakeOSXVariables not available===&lt;br /&gt;
&lt;br /&gt;
Since it was renamed to &amp;lt;tt&amp;gt;SlicerInitializeOSXVariables&amp;lt;/tt&amp;gt; in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26982 r26982]&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include(SlicerBlockSetCMakeOSXVariables)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include(SlicerInitializeOSXVariables)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Application: isRelease() function not available===&lt;br /&gt;
&lt;br /&gt;
See [[#Slicer_4.8:_Application:_isRelease.28.29_function_not_available_or_deprecated]]&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: slicer.util.getNode() raises exception if node not found===&lt;br /&gt;
&lt;br /&gt;
If slicer.util.getNode() is called and the node is not found then instead of just returning None (Slicer 4.8 behavior), the method now raises a MRMLNodeNotFoundException. This makes code debugging easier (the error is reported when it happens), and in general more consistent with Python conventions.&lt;br /&gt;
&lt;br /&gt;
How to update existing code:&lt;br /&gt;
&lt;br /&gt;
It is advisable to only use slicer.util.getNode in tests, or interactively in the Python console, as its behavior is somewhat unpredictable (it may either found a node by name or ID, and result of wildcard search is even less deterministic). In general, it is recommended to use the MRML scene's GetFirstNodeByName and GetNodeByID methods instead.&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n = slicer.util.getNode(nodeNameOrID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''By one of these:'''&lt;br /&gt;
&lt;br /&gt;
If node is to be found by name:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  n = slicer.mrmlScene.GetFirstNodeByName(nodeName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If node is to be found by ID:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  n = slicer.mrmlScene.GetNodeByID(nodeID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If node is to be found by name or ID (slower, less predictable, recommended for testing only):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
  n = slicer.util.getNode(nodeNameOrID)&lt;br /&gt;
except slicer.util.MRMLNodeNotFoundException:&lt;br /&gt;
  n = None&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More information: https://github.com/Slicer/Slicer/commit/b63484af1b1b413f35396f8f7efb73e870448bd4&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.8: Application: isRelease() function not available or deprecated===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Missing/deprecated qSlicerCoreApplication::isRelease()&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    Missing/deprecated slicer.app.isRelease()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;qSlicerCoreApplication::releaseType() == &amp;quot;Stable&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Summary:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prior to r26420, the variable &amp;lt;tt&amp;gt;Slicer_VERSION_TWEAK&amp;lt;/tt&amp;gt; was used to check if a &amp;quot;stable release&amp;quot; was built. The variable value&lt;br /&gt;
was set by updating the sources and defining the variable to an integer greater or equal to 0. In other word, if the variable&lt;br /&gt;
evaluated to an empty string, a nighty or experimental build was being done, if it evaluated to an integer, a stable release build&lt;br /&gt;
was being done.&lt;br /&gt;
&lt;br /&gt;
The approach had few issues:&lt;br /&gt;
&lt;br /&gt;
*the name of the variable was confusing&lt;br /&gt;
*identifying a &amp;quot;stable release&amp;quot; only from a source tree revision was not enough. Indeed the environment defining a &amp;quot;release&amp;quot; is the one found on the build machines used to generate the installer.&lt;br /&gt;
*nightly build are also considered as release&lt;br /&gt;
&lt;br /&gt;
To address this, the CMake variable &amp;lt;tt&amp;gt;Slicer_RELEASE_TYPE&amp;lt;/tt&amp;gt; was introduced. As of 2017-10-04, it can be set to &amp;lt;tt&amp;gt;Experimental&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Nightly&amp;lt;/tt&amp;gt;&lt;br /&gt;
or &amp;lt;tt&amp;gt;Stable&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;Experimental&amp;lt;/tt&amp;gt; being the value hard-coded in the source.&lt;br /&gt;
&lt;br /&gt;
Identifying a build as &amp;quot;stable&amp;quot; is now explicitly done by setting &amp;lt;tt&amp;gt;Slicer_RELEASE_TYPE&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;Stable&amp;lt;/tt&amp;gt; at configure time.&lt;br /&gt;
&lt;br /&gt;
Also, since the concept of release types was introduced, the function &amp;lt;tt&amp;gt;isRelease()&amp;lt;/tt&amp;gt; has been removed in favor of &amp;lt;tt&amp;gt;releaseType()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://github.com/Slicer/Slicer/pull/354&lt;br /&gt;
&lt;br /&gt;
===Slicer Python Module: modulewidget and others removed.===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Summary&amp;lt;/b&amp;gt;&lt;br /&gt;
Python classes formerly in &amp;quot;slicer.moduledm&amp;quot;, &amp;quot;slicer.modulelogic&amp;quot;,  &amp;quot;slicer.modulemrml&amp;quot;&lt;br /&gt;
and &amp;quot;slicer.modulewidget&amp;quot; are now directly available in the slicer module.&lt;br /&gt;
&lt;br /&gt;
See example of change [https://github.com/QIICR/LongitudinalPETCT/pull/11 here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rational:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See comments in commit messages referenced blow.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://github.com/Slicer/Slicer/commit/628f83fe7a6f4e0710e306bcaf7c04b9e3e5e6bd&lt;br /&gt;
&lt;br /&gt;
https://github.com/Slicer/Slicer/commit/9cb5668fde1abc8f0430a91ca37fc29277ceeb4e&lt;br /&gt;
&lt;br /&gt;
===MRML: Slicer 4.6: Moved up vtkMRMLStorableNode in the MRML node hierarchy.===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rational:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vtkMRMLStorableNode is not a children of vtkMRMLTransformable node anymore,&lt;br /&gt;
but directly a children of vtkMRMLNode.&lt;br /&gt;
    &lt;br /&gt;
This allows making a node storable without requiring it to be also&lt;br /&gt;
transformable. It is important for several node types (color maps, tables,&lt;br /&gt;
etc), which require separate storage node but are not transformable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Changed introduced in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=24891 r24891]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    /tmp/LongitudinalPETCT/MRML/vtkMRMLLongitudinalPETCTStudyNode.cxx: In member function ‘void vtkMRMLLongitudinalPETCTStudyNode::ObserveRegistrationTransform(bool)’:&lt;br /&gt;
    /tmp/LongitudinalPETCT/MRML/vtkMRMLLongitudinalPETCTStudyNode.cxx:478:28: error: ‘class vtkMRMLVolumePropertyNode’ has no member named ‘GetParentTransformNode’&lt;br /&gt;
                   &amp;amp;&amp;amp; propNode-&amp;gt;GetParentTransformNode()&lt;br /&gt;
                                ^&lt;br /&gt;
    /tmp/LongitudinalPETCT/MRML/vtkMRMLLongitudinalPETCTStudyNode.cxx:480:23: error: ‘class vtkMRMLVolumePropertyNode’ has no member named ‘SetAndObserveTransformNodeID’&lt;br /&gt;
                 propNode-&amp;gt;SetAndObserveTransformNodeID(&lt;br /&gt;
                           ^&lt;br /&gt;
    /tmp/LongitudinalPETCT/MRML/vtkMRMLLongitudinalPETCTStudyNode.cxx:503:23: error: ‘class vtkMRMLVolumePropertyNode’ has no member named ‘SetAndObserveTransformNodeID’&lt;br /&gt;
                 propNode-&amp;gt;SetAndObserveTransformNodeID(NULL);&lt;br /&gt;
                           ^&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes lines and/or refactor code&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===MRML: Slicer 4.5: Introduction of vtkMRMLLabelMapVolumeNode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rational:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before &amp;lt;tt&amp;gt;vtkMRMLScalarVolumeNode&amp;lt;/tt&amp;gt; was used for both scalar and label map&lt;br /&gt;
volumes and the LabelMap custom MRML node attribute was used for&lt;br /&gt;
distinguishing between them (0=scalar; 1=label map volume).&lt;br /&gt;
&lt;br /&gt;
This made conversion between labelmap/scalar volumes very easy but made&lt;br /&gt;
it difficult to customize behavior, display, processing of segmentation&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Now a new &amp;lt;tt&amp;gt;vtkMRMLLabelMapVolumeNode&amp;lt;/tt&amp;gt; class is used for storing segmentation&lt;br /&gt;
information (still using &amp;lt;tt&amp;gt;vtkMRMLScalarVolume&amp;lt;/tt&amp;gt; used as base class for backward&lt;br /&gt;
compatibility; but in the future the base class may be changed to reflect&lt;br /&gt;
that segmentation can be represented in various ways, not just as volumes).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  error: ‘class vtkMRMLScalarVolumeNode’ has no member named ‘SetLabelMap’&lt;br /&gt;
     outputVolumeNode-&amp;gt;SetLabelMap(1);&lt;br /&gt;
                       ^&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part1: down cast to &amp;lt;tt&amp;gt;vtkMRMLLabelMapVolumeNode&amp;lt;/tt&amp;gt;, remove call to &amp;lt;tt&amp;gt;SetLabelMap&amp;lt;/tt&amp;gt;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
     vtkMRMLNode* outputNode = d-&amp;gt;OutputLabelVolumeMRMLNodeComboBox-&amp;gt;currentNode();&lt;br /&gt;
     vtkMRMLScalarVolumeNode* outputVolumeNode = vtkMRMLScalarVolumeNode::SafeDownCast(outputNode);&lt;br /&gt;
     [...]&lt;br /&gt;
     outputVolumeNode-&amp;gt;SetLabelMap(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
     vtkMRMLLabelMapVolumeNode* outputVolumeNode =&lt;br /&gt;
       vtkMRMLLabelMapVolumeNode::SafeDownCast(d-&amp;gt;OutputLabelVolumeMRMLNodeComboBox-&amp;gt;currentNode());&lt;br /&gt;
     [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part2: Update UI file):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;widget class=&amp;quot;qMRMLNodeComboBox&amp;quot; name=&amp;quot;InputLabelVolumeMRMLNodeComboBox&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;property name=&amp;quot;nodeTypes&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;stringlist&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;vtkMRMLScalarVolumeNode&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;/stringlist&amp;gt;&lt;br /&gt;
   &amp;lt;/property&amp;gt;&lt;br /&gt;
   [...]&lt;br /&gt;
  &amp;lt;/widget&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;widget class=&amp;quot;qMRMLNodeComboBox&amp;quot; name=&amp;quot;InputLabelVolumeMRMLNodeComboBox&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;property name=&amp;quot;nodeTypes&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;stringlist&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;vtkMRMLLabelMapVolumeNode&amp;lt;/string&amp;gt;      &amp;lt;------------- Update Here&lt;br /&gt;
    &amp;lt;/stringlist&amp;gt;&lt;br /&gt;
   &amp;lt;/property&amp;gt;&lt;br /&gt;
   [...]&lt;br /&gt;
  &amp;lt;/widget&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part3: Update node selector configuration):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  nodeSelector.setNodeTypes(QStringList(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;));&lt;br /&gt;
  nodeSelector.addAttribute(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;, &amp;quot;LabelMap&amp;quot;, &amp;quot;1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  nodeSelector.setNodeTypes(QStringList(&amp;quot;vtkMRMLLabelMapVolumeNode&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*https://www.slicer.org/wiki/Documentation/Labs/Segmentations#vtkMRMLLabelMapVolumeNode_integration* http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=24291&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CLI: Slicer 4.3: Add ITKFactoryRegistration library centralizing ITK IO factory registration===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rational:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Linking against &amp;lt;tt&amp;gt;ITKFactoryRegistration&amp;lt;/tt&amp;gt; ensures that ITK IO factory are properly registered on all supported platforms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Undefined symbols for architecture x86_64:&lt;br /&gt;
  &amp;quot;itk::itkFactoryRegistration()&amp;quot;, referenced from:&lt;br /&gt;
  _main in ImageMakerTest.cxx.o&lt;br /&gt;
  ld: symbol(s) not found for architecture x86_64&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  target_link_libraries(${CLP}Test ${CLP}Lib)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  target_link_libraries(${CLP}Test ${CLP}Lib ${SlicerExecutionModel_EXTRA_EXECUTABLE_TARGET_LIBRARIES})&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21592&lt;br /&gt;
*https://issues.slicer.org/view.php?id=2813&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Labs/BRAINS_and_ITKv4_issue&amp;diff=31209</id>
		<title>Documentation/Labs/BRAINS and ITKv4 issue</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Labs/BRAINS_and_ITKv4_issue&amp;diff=31209"/>
		<updated>2013-04-18T19:53:57Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Experiment results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This page documents the experiment done while trying to sort the issue causing BRAINS to crash when built within Slicer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Experiment Setup ==&lt;br /&gt;
&lt;br /&gt;
Here is the VERY simple program that is failing:&lt;br /&gt;
https://github.com/BRAINSia/BRAINSTools/blob/SlicerDebugBRAINSFitInstrumentation/BRAINSFit/DebugSlicerProg.cxx&lt;br /&gt;
&lt;br /&gt;
In my slicer build tree:&lt;br /&gt;
/scratch/johnsonhj/src/Slicer-DEBUG/BRAINSTools (SlicerDebugBRAINSFitInstrumentation)&lt;br /&gt;
&lt;br /&gt;
With git remove –v:&lt;br /&gt;
origin git://github.com/BRAINSia/BRAINSTools.git (push)&lt;br /&gt;
&lt;br /&gt;
And BRAINSTools hash   31beee592eba2d98655b864e6dc704ac9bf995e8&lt;br /&gt;
&lt;br /&gt;
== Experiment results ==&lt;br /&gt;
&lt;br /&gt;
* BRAINS standalone&lt;br /&gt;
** ITKv4 tag: &lt;br /&gt;
** ITKv4 options: DCMTK disabled&lt;br /&gt;
** Result:&lt;br /&gt;
&lt;br /&gt;
* BRAINS slicer&lt;br /&gt;
** ITKv4 tag:&lt;br /&gt;
** ITKv4 options: DCMTK disabled, EMsegment disabled&lt;br /&gt;
** Result:&lt;br /&gt;
&lt;br /&gt;
=======================&lt;br /&gt;
[FAILED]&lt;br /&gt;
Build Slicer:  Run Slicers version of Debug&lt;br /&gt;
johnsonhj@neuron$ /scratch/johnsonhj/src/Slicer-DEBUG/Slicer-build/bin/DebugSlicerProg&lt;br /&gt;
TESTING: STARTED&lt;br /&gt;
PRE : 9945 Segmentation fault: 11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=======================&lt;br /&gt;
[PASSED]&lt;br /&gt;
&lt;br /&gt;
Build Stand Alone version of BRAINSTools using the same source code:&lt;br /&gt;
&lt;br /&gt;
johnsonhj@neuron$ /scratch/johnsonhj/src/Slicer-DEBUG/BT_DEBUG/bin/DebugSlicerProg &lt;br /&gt;
TESTING: STARTED&lt;br /&gt;
PRE : 9945 0&lt;br /&gt;
POST: 9945 9945&lt;br /&gt;
PRE : 9945 0&lt;br /&gt;
POST: 9945 9945&lt;br /&gt;
TESTING: STOPPED&lt;br /&gt;
&lt;br /&gt;
========================================&lt;br /&gt;
I have a separate build of Slicer available under a branch named &amp;quot;InstrumentForBRAINSFitFailures&amp;quot; at git@github.com:hjmjohnson/Slicer.git ( a version built on top of today's SlicerSVN)&lt;br /&gt;
&lt;br /&gt;
This branch includes a version of BRAINSTools with a very small program that demonstrates the problem we are seeing in BRAINSFit.&lt;br /&gt;
&lt;br /&gt;
I still think there is something that is overwriting the vtable of this object, and that is the root cause of our problems, but I don't know how to continue debugging that guess.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is mostly for my own note taking:&lt;br /&gt;
There are the experiments that I have done to try to figure out what the heck is going on:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;StandAlone Shared library build of BRAINSTools&amp;quot;&lt;br /&gt;
BSA_BASE=/scratch/johnsonhj/src/BT_FAILURED_SHARED/BT-DEBUG-SHARED/&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slicer build of BRAINSTools&amp;quot;&lt;br /&gt;
SLICER_BASE=/Volumes/scratch/johnsonhj/src/Slicer-DEBUG&lt;br /&gt;
&lt;br /&gt;
TEST #1:  [PASS]&lt;br /&gt;
===========================&lt;br /&gt;
BIN=${BSA_BASE}/bin/BRAINSFit&lt;br /&gt;
DYLD_LIBRARY_PATH=${BSA_BASE}/ITKv4-install/lib&lt;br /&gt;
&lt;br /&gt;
TEST #2:  [PASS]&lt;br /&gt;
===========================&lt;br /&gt;
BIN=${SLICER_BASE}/Slicer-build/lib/Slicer-4.2/cli-modules/BRAINSFit&lt;br /&gt;
DYLD_LIBRARY_PATH=${BSA_BASE}/ITKv4-install/lib&lt;br /&gt;
&lt;br /&gt;
TEST #3:  [FAIL]&lt;br /&gt;
===========================&lt;br /&gt;
BIN=${BSA_BASE}/bin/BRAINSFit&lt;br /&gt;
DYLD_LIBRARY_PATH=${SLICER_BASE}/ITKv4-build/lib&lt;br /&gt;
&lt;br /&gt;
TEST #4:  [FAIL]&lt;br /&gt;
===========================&lt;br /&gt;
BIN=${SLICER_BASE}/Slicer-build/lib/Slicer-4.2/cli-modules/BRAINSFit&lt;br /&gt;
DYLD_LIBRARY_PATH=${SLICER_BASE}/ITKv4-build/lib&lt;br /&gt;
&lt;br /&gt;
TEST #5: [FAIL]&lt;br /&gt;
================================&lt;br /&gt;
Build with DICOM support turned off.&lt;br /&gt;
BIN=${SLICER_BASE}/Slicer-build/lib/Slicer-4.2/cli-modules/BRAINSFit&lt;br /&gt;
DYLD_LIBRARY_PATH=${SLICER_BASE}/ITKv4-build/lib&lt;br /&gt;
&lt;br /&gt;
TEST #6: [FAIL]&lt;br /&gt;
================================&lt;br /&gt;
Build minimum CLI based program to replicate the problem. &lt;br /&gt;
&lt;br /&gt;
When debugging TEST #6 I put a break point at:&lt;br /&gt;
/Volumes/scratch/johnsonhj/src/Slicer-DEBUG/BRAINSTools/BRAINSFit/DebugSlicerCLI.cxx   line 59&lt;br /&gt;
59├&amp;gt;      std::cout &amp;lt;&amp;lt; &amp;quot;PRE : &amp;quot; &amp;lt;&amp;lt; LBFGSBoptimizer-&amp;gt;GetUpperBound().size() &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; upperBound.size() &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When stepping into the line, it reports segfault at line 209 of /Volumes/scratch/johnsonhj/src/Slicer-DEBUG/ITKv4/Modules/Numerics/Optimizers/src/itkLBFGSBOptimizer.cxx &lt;br /&gt;
204│ void&lt;br /&gt;
205│ LBFGSBOptimizer&lt;br /&gt;
206│ ::SetUpperBound(&lt;br /&gt;
207│   const BoundValueType &amp;amp; value)&lt;br /&gt;
208│ {&lt;br /&gt;
209├&amp;gt;  m_UpperBound = value;&lt;br /&gt;
210│   if ( m_OptimizerInitialized )&lt;br /&gt;
211│     {&lt;br /&gt;
212│     m_VnlOptimizer-&amp;gt;set_upper_bound(m_UpperBound);&lt;br /&gt;
213│     }&lt;br /&gt;
214│&lt;br /&gt;
215│   this-&amp;gt;Modified();&lt;br /&gt;
216│ } &lt;br /&gt;
&lt;br /&gt;
NOTE: NOTE: NOTE:  Line 59 of DebugSlicerCLI.cxx DOES NOT CALL &amp;quot;SetUpperBound&amp;quot; it calls &amp;quot;GetUpperBound&amp;quot;,  and that is the same type of problem we are seeing in BRAINSFit.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29479</id>
		<title>ITKv4 Migration plan</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29479"/>
		<updated>2012-12-05T15:28:10Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Timeline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Slicer4#Plan| Back to Slicer]]&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is designed to identify and track the work that needs to be done during the month of 2012-12-01 to 2012-12-31 in order to transition Slicer to a solid and uniform ITKv4 platform. Originally this document, created following the NAMIC Engineering TCon of July 28th [http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28], discuss the element that should be considered before transitioning Slicer to ITKv4.&lt;br /&gt;
&lt;br /&gt;
Historical and other old pages with possibly outdated information. If the information on these other pages is relevant, they need to be pushed here.&lt;br /&gt;
&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/ITKv4_Migration_plan&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/Developer_Meetings/20121106#ITKv4&lt;br /&gt;
* http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28&lt;br /&gt;
&lt;br /&gt;
== Issue To Address ==&lt;br /&gt;
&lt;br /&gt;
== Timeline ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;color:firebrick; background-color:ltgrey;&amp;quot; cellpadding=&amp;quot;5&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Issues for migration to ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! _Due_Date_ &lt;br /&gt;
! Progress Status&lt;br /&gt;
! Team Members &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-31 &lt;br /&gt;
| Started&lt;br /&gt;
| Hans J., Steve P., JC, Bill L., Matt M., Kent W.&lt;br /&gt;
| http://www.na-mic.org/Bug/search.php?project_id=3&amp;amp;amp;sticky_issues=on&amp;amp;amp;sortby=last_updated&amp;amp;amp;dir=DESC&amp;amp;amp;hide_status_id=80&amp;amp;amp;tag_string=ITKv4&lt;br /&gt;
|-&lt;br /&gt;
|  2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Steve P., Bill L., Matt M., Kent W.&lt;br /&gt;
| Test Slicer/ITKv4 on all platforms, especially 64bit VS2008.  ( see comments in table below for checkout information:  2012-12-01 )&lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Matt M., Bill L.&lt;br /&gt;
| Look into reducing the number of ITKv4 Modules enabled when building&lt;br /&gt;
|-&lt;br /&gt;
| N/A to ITKv4&lt;br /&gt;
|&lt;br /&gt;
| Matt M., Steve P., Bill L., Matt M.&lt;br /&gt;
| Slicer modules to reduce load time on Windows&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Timeline ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;color:green; background-color:white;&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Timeline for ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! _Due_Date_ &lt;br /&gt;
! Progress Status &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-01&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| Done&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot; |Hans provides a first pass reference set of patches that build on Mac and demonstrates that nearly all functionality is maintained identically between ITKv3 and ITKv4&lt;br /&gt;
|- &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| I've successfully created a mac dmg package. &amp;amp;quot;CPack: - package: /Users/johnsonhj/src/Slicer-git-itkv4/Slicer-build/Slicer-4.2.0-macosx-amd64.dmg generated.&amp;amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
The package is not yet completely successful though :(.&amp;amp;nbsp; It seems to run just fine on the machine I used to build the package, but when running on my wifes laptop, it can not find a Qt library in /usr/local/lib/&lt;br /&gt;
&lt;br /&gt;
This is probably something best left for discussion next Wednesday.&lt;br /&gt;
&lt;br /&gt;
I am building on 10.8 with a private build of clang 3.1 tagged as stable from svn.&amp;lt;br/&amp;gt;&lt;br /&gt;
I also installed homebrew, and from that installed QT 4.8.3. ( I manually set the required Qt version to 4.8.3)&lt;br /&gt;
&lt;br /&gt;
*FROM THE SAME SOURCE TREE* I also am building Slicer built with ITKv3, and that also seems to be building a reasonable package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;&lt;br /&gt;
git clone git@github.com:BRAINSia/Slicer43.git&lt;br /&gt;
cd  Slicer43&lt;br /&gt;
git checkout origin/next-slicer43 &amp;amp;ndash;b next-slicer43&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv3  &amp;amp;amp;&amp;amp;amp; sl-itkv3  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=3 ../Slicer43&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv4  &amp;amp;amp;&amp;amp;amp; sl-itkv4  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=4 ../Slicer43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-05&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| Matt McCormick coordinates a Google Hang out&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| In preparation for the upcoming Slicer 4.3 and the NA-MIC Winter Project Week, we are planning a hackathon to help with migration to ITKv4 as the default version of ITK in Slicer.&amp;amp;nbsp; For some time, 	community members such as Hans Johnson, Bill Lorensen, and Jean-Christophe Fillion-Robin have made sure ITKv4 works well with Slicer, and we hope to gather and focus on remaining issues that should be addressed.&lt;br /&gt;
&lt;br /&gt;
The hackathon will take place on:&amp;amp;nbsp; &amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;background-color:Yellow;&amp;quot;&amp;gt;&lt;br /&gt;
* Wednesday, December 5th from 10AM Eastern Time until we run out of energy :-). &amp;lt;br\&amp;gt;&lt;br /&gt;
* Primary Connection Information: Google Hangout to be announce at 10AM Eastern time on the ITK and Slicer mailing lists.  The link to join the hangout:   https://plus.google.com/hangouts/_/a52d596290231e5806eec50e14ab2dcddad72fcd?authuser=2&amp;amp;eid=106512397331641956186&amp;amp;hl=en&lt;br /&gt;
* Fallback/Auxiliary connection information:  GoTo Meeting for sharing screens with mouse control:   &amp;lt;br\&amp;gt;&lt;br /&gt;
Please join my meeting, Dec 5, 2012 at 9:00 AM CST. &amp;lt;br\&amp;gt;&lt;br /&gt;
https://www1.gotomeeting.com/join/739397184 &amp;lt;br\&amp;gt;&lt;br /&gt;
Meeting ID: 739-397-184&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;The hackathon will take place on a Google+ Hangout.&amp;amp;nbsp; I will follow up with the link to the hangout on this email thread when we starts.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues to address at Google Hangout:&lt;br /&gt;
&lt;br /&gt;
Issues in the Slicer bug tracker with the ITKv4 tag:  ( See table above )&lt;br /&gt;
&lt;br /&gt;
If there are other issues to address, please report them in the Slicer bug tracker and reply to this thread.&lt;br /&gt;
&lt;br /&gt;
Work will occur on the following repository on Github.&amp;amp;nbsp;&amp;amp;nbsp; https://github.com/BRAINSia/Slicer43&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Historical (and probably outdated) information =&lt;br /&gt;
&lt;br /&gt;
== Consensus as of 2011 ==&lt;br /&gt;
&lt;br /&gt;
* Slicer RSNA 2011 will be built against ITKv3&lt;br /&gt;
&lt;br /&gt;
* External module requiring ITKv4 will be linked statically against ITKv4&lt;br /&gt;
** Associated command line module will be built as executable only. Indeed having both ITKv3 and ITKv4 in the same process will most likely result in some weird symbol clash.&lt;br /&gt;
&lt;br /&gt;
=== Questions ===&lt;br /&gt;
&lt;br /&gt;
* Should each extension depending on ITKv4 download and build its own copy of ITKv4 or should Slicer build and expose both ITKv3 and ITKv4 ?&lt;br /&gt;
&lt;br /&gt;
== Custom MetaIO in SlicerITK ==&lt;br /&gt;
&lt;br /&gt;
* To minimize memory usage and increase efficiency of Command line module execution, itkImageFileReader.txx in SlicerITK has been patched. See https://github.com/Slicer/ITK/commit/8c73dc57e4ae67328ff8e44934b72fd4cc5d4dd3 and https://github.com/Slicer/ITK/commit/12349021b152ac6546c2caf09bbbee4266baddad&lt;br /&gt;
&lt;br /&gt;
* Bill mentioned it should be possible to avoid patching SlicerITK by creating a custom Factory / plugins. &lt;br /&gt;
&lt;br /&gt;
* From Bradley Lowekamp - ITK mailing list - Sun, Jul 17, 2011 at 11:33 AM  subject '''Re: [Insight-developers] ITK 3 tag to use with slicer? Fwd: Slicer release schedule'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Stephen,&lt;br /&gt;
&lt;br /&gt;
If I understand this change correctly, this patch allows the usage of a buffer allocated by the ImageIO to be passed &lt;br /&gt;
all the way to the Image class if  all the types match up. The is accomplished by adding the following &lt;br /&gt;
methods: ImageIO::CanUseOwnBuffer, ImageIO::ReadUsingOwnBuffer() and ImageIO::GetOwnBuffer.&lt;br /&gt;
&lt;br /&gt;
I assume that this change is for the MemoryImageFileReader that is used with Slicer. ( can see how this could be &lt;br /&gt;
quite advantageous ( and also the potential for scary alias when combined with InPlace filters ). But as not one &lt;br /&gt;
single ITK ImageIO has support for these methods. I'd like to question if they should be brought into the ITK main repo, &lt;br /&gt;
as they don't appear to currently provide any benefit to ITK and only complicate as already complicated interface to the &lt;br /&gt;
ImageIO. If these changes are desired in ITK, then I would strongly encourage better documentation for the new methods in &lt;br /&gt;
ImageIO, to enable new developers with add this feature to ImageIO classes.&lt;br /&gt;
&lt;br /&gt;
Brad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From Bill - Thu, Jul 28, 2011 at 5:19 PM '''Re: [slicer-devel] Engineering:TCON 2011 - NAMIC'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I checked the patches. Two classes are patched: ImageIOBase and ImageFileReader. Now I do not think my factory idea is worthwhile. &lt;br /&gt;
We should to bring the changes into ITK, and convert ITK's Meta and Nifti ImageIO's to use it.&lt;br /&gt;
&lt;br /&gt;
Bill&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the na-mic tcon it was discussed that nrrd and nifti readers also perform the memcpy since the native libraries perform the Information and Read steps in a single API call.  Therefor if the feature existed at the ITK level, then several readers could take advantage of it.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.2/Developers/Build_Instructions/Prerequisites/Qt&amp;diff=29469</id>
		<title>Documentation/4.2/Developers/Build Instructions/Prerequisites/Qt</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.2/Developers/Build_Instructions/Prerequisites/Qt&amp;diff=29469"/>
		<updated>2012-12-04T19:38:41Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Download links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Binary vs build-from-source ? =&lt;br /&gt;
&lt;br /&gt;
If you build Slicer on ...&lt;br /&gt;
&lt;br /&gt;
== Linux  ==&lt;br /&gt;
&lt;br /&gt;
* Using [[#Download_links|binary]] works great for both '''Debug''' and '''Release''' build of Slicer. See [[#Download_links]] and [[#Installation_instruction]]&lt;br /&gt;
&lt;br /&gt;
== Mac  ==&lt;br /&gt;
&lt;br /&gt;
* Using [[#Download_links|binary]] works great for both '''Debug''' and '''Release''' build of Slicer. See [[#Download_links]] and [[#Installation_instruction]]&lt;br /&gt;
&lt;br /&gt;
* To use QtCreator and the Slicer designer plugins, a possible option is to build QtCreator against the installed Qt libraries. See [http://slicer-devel.65872.n3.nabble.com/Using-Qt-Creator-with-Slicer4-On-Mac-OS-X-Multiple-Qt-libs-loaded-tp4026660p4026690.html discussion on the mailing list].&lt;br /&gt;
&lt;br /&gt;
== Windows  ==&lt;br /&gt;
&lt;br /&gt;
=== Debug (32 and 64-bit) or Release (64-bit) ===&lt;br /&gt;
&lt;br /&gt;
* You have to build Qt from source. See [[#Download_links]] and [[#Windows_4|Build instructions]]&lt;br /&gt;
&lt;br /&gt;
{{note}} Using the Qt Designer on Windows requires that the Slicer plugins are [http://doc.trolltech.com/4.6/deployment-plugins.html#debugging-plugins|compiled in the same mode as Qt]. If Qt was compiled in Release mode (default), Slicer would have to be compiled in Release mode as well. However if Qt is compiled in Debug mode only, Slicer has to be compiled in Debug too. When Qt is in &amp;quot;Release and Debug&amp;quot; mode only the Release version of Designer.exe is generated, Slicer would have to be compiled in Release. So for developers, the &amp;lt;b&amp;gt;Debug mode is recommended&amp;lt;/b&amp;gt;, this is why we detail the compilation of Qt below.&lt;br /&gt;
&lt;br /&gt;
=== Release (32-bit) ===&lt;br /&gt;
&lt;br /&gt;
* Using [[#Download_links|binary]] works great for 32-bit Release build of Slicer. See [[#Download_links]] and [[#Installation_instruction]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Download Qt: Source and Binaries =&lt;br /&gt;
&lt;br /&gt;
== Download links ==&lt;br /&gt;
&lt;br /&gt;
The following table list the link allowing to download either the '''recommended''' source code or binary of Qt.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;margin-left: 20px;&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;#FFFFCC&amp;quot;&lt;br /&gt;
!rowspan=&amp;quot;3&amp;quot;|&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot;|Linux&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|Mac&lt;br /&gt;
!colspan=&amp;quot;4&amp;quot;|Windows&lt;br /&gt;
|- bgcolor=&amp;quot;#FFFFCC&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;1&amp;quot;|&amp;lt;del&amp;gt;Tiger&amp;lt;/del&amp;gt;&lt;br /&gt;
!colspan=&amp;quot;1&amp;quot;|Leopard, SnowLeopard&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|VS2008&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|VS2010&lt;br /&gt;
|- bgcolor=&amp;quot;#FFFFCC&amp;quot;&lt;br /&gt;
!|32bits&lt;br /&gt;
!|64bits&lt;br /&gt;
!|&amp;lt;del&amp;gt;32bits&amp;lt;/del&amp;gt;&lt;br /&gt;
!|64bits&lt;br /&gt;
!|32bits&lt;br /&gt;
!|64bits&lt;br /&gt;
!|32bits&lt;br /&gt;
!|64bits&lt;br /&gt;
|-&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFCC&amp;quot; | [http://get.qt.nokia.com/qt/source/ Qt source link]&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot;| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz 4.7.4] &lt;br /&gt;
|style=&amp;quot;background-color:#C0C0C0;&amp;quot; align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| &amp;lt;del&amp;gt;[http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz 4.7.4]&amp;lt;/del&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz 4.7.4]&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot;| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip 4.7.4]&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;2&amp;quot;| [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip 4.7.4]&lt;br /&gt;
|-&lt;br /&gt;
! bgcolor=&amp;quot;#FFFFCC&amp;quot; | [http://get.qt.nokia.com/qt/source/  Qt binary link]&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| [http://sw.nokia.com/id/8ea74da4-fec1-4277-8b26-c58cc82e204b/Qt_SDK_Lin32_offline SDK-1.2]&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| [http://sw.nokia.com/id/14b2039c-0e1f-4774-a4f2-9aa60b6d5313/Qt_SDK_Lin64_offline SDK-1.2]&lt;br /&gt;
|style=&amp;quot;background-color:#C0C0C0;&amp;quot; align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| &amp;lt;del&amp;gt;[http://get.qt.nokia.com/qt/source/qt-mac-carbon-opensource-4.7.0.dmg carbon_4.7.0]&amp;lt;/del&amp;gt;&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| [ftp://ftp.qt.nokia.com/qt/source/qt-mac-opensource-4.7.4.dmg 4.7.4] &amp;lt;br&amp;gt; [ftp://ftp.qt.nokia.com/qt/source/qt-mac-opensource-4.7.4-debug-libs.dmg 4.7.4 (optional: debug libs)] &lt;br /&gt;
&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| [http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.4-vs2008.exe 4.7.4]&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| (src build only)&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| [http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.4-vs2008.exe 4.7.4]&lt;br /&gt;
|align=&amp;quot;center&amp;quot; colspan=&amp;quot;1&amp;quot;| (src build only)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation instruction ==&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt/Instal_QtSDK1.2_Offline_Linux_64|Qt installation guide (4.7.4, Linux, 64-bit, Offline)]]&lt;br /&gt;
&lt;br /&gt;
=== Mac ===&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
== Qt version specific issues ==&lt;br /&gt;
&lt;br /&gt;
=== All ===&lt;br /&gt;
&lt;br /&gt;
* '''Qt 4.6.x''' on windows (and possibly in linux/mac): No image base64 support in QLabel/QTooltips (work around exists though)&lt;br /&gt;
* '''Qt 4.8''' does not work with PythonQt in slicer4 - suggested version is 4.7.4&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
* NA&lt;br /&gt;
&lt;br /&gt;
=== Mac ===&lt;br /&gt;
&lt;br /&gt;
* '''Qt 4.6''': hard to compile - TBD: Be more specific&lt;br /&gt;
* '''Qt 4.7''': click outside of popup (http://na-mic.org/Mantis/view.php?id=1241) - Is it fixed in Qt 4.8 ?&lt;br /&gt;
* '''Qt 4.7.3''': http://na-mic.org/Mantis/view.php?id=1388 - Fixed in Qt 4.7.4&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
* NA&lt;br /&gt;
&lt;br /&gt;
== How to change the minimum required version ? ==&lt;br /&gt;
&lt;br /&gt;
* It's indeed possible to use a different version, just be aware that moving forward in time, things may not work as expected. Even worse Slicer may simply fail to compile.&lt;br /&gt;
&lt;br /&gt;
* By configuring Slicer using &amp;lt;code&amp;gt;-DSlicer_REQUIRED_QT_VERSION:STRING=4.7.0&amp;lt;/code&amp;gt;, you will be able to change the minimum required version.&lt;br /&gt;
&lt;br /&gt;
* See [https://github.com/Slicer/Slicer/commit/898bb14e 898bb14e], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=19698 r19698], [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008130.html Mailing list]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Build instructions =&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| text = Please, make sure that your IDE/compiler is '''properly installed''' and that all associated '''ServicePack''' are also installed. See [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites|Prerequisites]].&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
TODO: Add a section specific to debian based platform.&lt;br /&gt;
*Downloading the binaries of Qt works fine with Linux, you do not have to compile Qt manually. &lt;br /&gt;
** Note: You need to install the libQtWebkit-devel package too.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Consider installing the following optional packages (&amp;lt;code&amp;gt;libxt-dev libxrender-dev libxrandr-dev libxinerama-dev libxcursor-dev libfontconfig-dev libglib2.0-dev&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir qt-everywhere-opensource-build-4.7.4&lt;br /&gt;
tar xvfz qt-everywhere-opensource-src-4.7.4.tar.gz&lt;br /&gt;
cd qt-everywhere-opensource-src-4.7.4&lt;br /&gt;
./configure -prefix ../qt-everywhere-opensource-build-4.7.4 -debug-and-release -opensource -confirm-license -no-qt3support -webkit -nomake examples -nomake demos&lt;br /&gt;
make -j8&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;!-- Note: On a 64 bit system, you may have to add &amp;lt;code&amp;gt;-arch x86_64&amp;lt;/code&amp;gt; to the Qt configure command line (?) --&amp;gt;&lt;br /&gt;
Note: Adapt &amp;lt;code&amp;gt;-j8&amp;lt;/code&amp;gt; with the number of core on your machine, a dual core should probably not do more than &amp;lt;code&amp;gt;-j3&amp;lt;/code&amp;gt;, an 8 core machine can resonably go as much as &amp;lt;code&amp;gt;-j12&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Mac  ==&lt;br /&gt;
&lt;br /&gt;
Similar to Linux configuration. Note that &amp;lt;code&amp;gt;-arch x86_64&amp;lt;/code&amp;gt; has been added.&lt;br /&gt;
&lt;br /&gt;
For earlier versions of Xcode and Mac OS X&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir qt-everywhere-opensource-build-4.7.4&lt;br /&gt;
tar xvfz qt-everywhere-opensource-src-4.7.4.tar.gz&lt;br /&gt;
cd qt-everywhere-opensource-src-4.7.4&lt;br /&gt;
./configure -prefix ../qt-everywhere-opensource-build-4.7.4 -debug-and-release -opensource -confirm-license -no-qt3support -webkit -arch x86_64 -nomake examples -nomake demos -sdk /Developer/SDKs/MacOSX10.5.sdk/&lt;br /&gt;
make -j8&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On the latest Xcode versions (4.3) and Lion (10.7) the Developer directories have moved.  The command is now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure -prefix ../qt-everywhere-opensource-build-4.7.4 -debug-and-release -opensource -confirm-license -no-qt3support -arch x86_64 -nomake examples -nomake demos -webkit -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Consider reading: http://doc.qt.nokia.com/4.7/developing-on-mac.html)&lt;br /&gt;
&lt;br /&gt;
* Note:&lt;br /&gt;
** If building against SDK 10.6 or 10.7, you will probably get link errors similar to what's described in [https://trac.macports.org/ticket/30346] and [http://qt-project.org/forums/viewthread/15933]. The solution is probably to disable the &amp;lt;code&amp;gt;corewlan&amp;lt;/code&amp;gt; module but didn't figure out to do that properly.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
# Use a windows extracter to unzip the [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Download_links|Qt archive]], don't use cygwin unzip it.&lt;br /&gt;
# launch the msvc2008 command prompt (MSVC08-&amp;gt;Tools-&amp;gt;Visual Studio 2008 CommandPrompt) (or: launch cmd.exe and run &amp;lt;code&amp;gt;vcvars32.bat&amp;lt;/code&amp;gt;) Note: Start x64 prompt from Start menu (don't start from inside visual studio or it will be an x86 32 bit shell).  Menu item is &amp;quot;Visual Studio 2008 x64 Win64 Command Prompt&amp;quot;&lt;br /&gt;
# build with &amp;lt;code&amp;gt;configure.exe -platform win32-msvc2008 -opensource -confirm-license -debug -webkit -nomake examples -nomake demos&amp;lt;/code&amp;gt; &lt;br /&gt;
#* When asked, choose open source license type (o), then accept the license (y)&lt;br /&gt;
#* Note: the option &amp;lt;code&amp;gt;-prefix&amp;lt;/code&amp;gt; doesn't work on Windows.&lt;br /&gt;
#* Note: According to [http://qt.nokia.com/doc/4.7/supported-platforms.html] Qt does not support msvc2008 on windows xp.  However, running &amp;lt;code&amp;gt;configure.exe&amp;lt;/code&amp;gt; with no &amp;lt;code&amp;gt;-platform&amp;lt;/code&amp;gt; argument seems to work. If you run configure with the &amp;lt;code&amp;gt;-platform&amp;lt;/code&amp;gt; argument first by mistake, and if &amp;lt;code&amp;gt;configure -clean&amp;lt;/code&amp;gt; doesn't work, then you may need to start from a fresh extraction from the .zip archive before running &amp;lt;code&amp;gt;configure.exe&amp;lt;/code&amp;gt; again with no &amp;lt;code&amp;gt;-platform&amp;lt;/code&amp;gt;, unless you can run &amp;lt;code&amp;gt;nmake&amp;lt;/code&amp;gt; with the config clean target.&lt;br /&gt;
#* Note: for Microsoft Visual Studio 2010 users, Qt 4.6.3 is hard to configure with MSVC2010, use Qt 4.7.x instead. Build with &amp;lt;code&amp;gt;set QMAKESPEC=win32-msvc2010&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;configure -platform win32-msvc2010  -debug&amp;lt;/code&amp;gt;&lt;br /&gt;
# run &amp;lt;code&amp;gt;nmake&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Note: building with webkit support requires that &amp;lt;i&amp;gt;src/3rdparty/webkit/WebCore/tmp/moc/{debug,release}_shared/mocinclude.tmp&amp;lt;/i&amp;gt; be removed. else you will get linker errors like &amp;lt;code&amp;gt;QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol &amp;quot;public: virtual struct QMetaObject const * __thiscall WebCore::FormDataIODevice::metaObject(void)const (?metaObject@FormDataIODevice@WebCore@@UBEPBUQMetaObject@@XZ)&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Note: If you encounter the following error &amp;lt;code&amp;gt;api\qscriptextensionplugin.h(43): Error: Undefined interface,&amp;lt;/code&amp;gt;, delete the files &amp;lt;i&amp;gt;\src\script\tmp\moc\debug_shared\mocinclude.tmp&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;\src\script\tmp\moc\release_shared\mocinclude.tmp&amp;lt;/i&amp;gt; and restart nmake. For more info, please see [http://bugreports.qt.nokia.com/browse/QTBUG-6470 QTBug 6470]].&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29457</id>
		<title>ITKv4 Migration plan</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29457"/>
		<updated>2012-12-01T17:11:48Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Timeline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Slicer4#Plan| Back to Slicer]]&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is designed to identify and track the work that needs to be done during the month of 2012-12-01 to 2012-12-31 in order to transition Slicer to a solid and uniform ITKv4 platform. Originally this document, created following the NAMIC Engineering TCon of July 28th [http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28], discuss the element that should be considered before transitioning Slicer to ITKv4.&lt;br /&gt;
&lt;br /&gt;
Historical and other old pages with possibly outdated information. If the information on these other pages is relevant, they need to be pushed here.&lt;br /&gt;
&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/ITKv4_Migration_plan&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/Developer_Meetings/20121106#ITKv4&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issue To Address ==&lt;br /&gt;
&lt;br /&gt;
== Timeline ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;color:red; background-color:ltgrey;&amp;quot; cellpadding=&amp;quot;5&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Issues for migration to ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! _Due_Date_ &lt;br /&gt;
! Progress Status&lt;br /&gt;
! Team Members &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-31 &lt;br /&gt;
| Started&lt;br /&gt;
| Hans J., Steve P., JC, Bill L., Matt M., Kent W.&lt;br /&gt;
| http://www.na-mic.org/Bug/search.php?project_id=3&amp;amp;amp;sticky_issues=on&amp;amp;amp;sortby=last_updated&amp;amp;amp;dir=DESC&amp;amp;amp;hide_status_id=80&amp;amp;amp;tag_string=ITKv4&lt;br /&gt;
|-&lt;br /&gt;
|  2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Steve P., Bill L., Matt M., Kent W.&lt;br /&gt;
| Test Slicer/ITKv4 on all platforms, especially 64bit VS2008.  ( see comments in table below for checkout information:  2012-12-01 )&lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Matt M., Bill L.&lt;br /&gt;
| Look into reducing the number of ITKv4 Modules enabled when building&lt;br /&gt;
|-&lt;br /&gt;
| N/A to ITKv4&lt;br /&gt;
|&lt;br /&gt;
| Matt M., Steve P., Bill L., Matt M.&lt;br /&gt;
| Slicer modules to reduce load time on Windows&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Timeline ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;color:green; background-color:white;&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Timeline for ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! _Due_Date_ &lt;br /&gt;
! Progress Status &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-01&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| Done&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot; |Hans provides a first pass reference set of patches that build on Mac and demonstrates that nearly all functionality is maintained identically between ITKv3 and ITKv4&lt;br /&gt;
|- &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| I've successfully created a mac dmg package. &amp;amp;quot;CPack: - package: /Users/johnsonhj/src/Slicer-git-itkv4/Slicer-build/Slicer-4.2.0-macosx-amd64.dmg generated.&amp;amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
The package is not yet completely successful though :(.&amp;amp;nbsp; It seems to run just fine on the machine I used to build the package, but when running on my wifes laptop, it can not find a Qt library in /usr/local/lib/&lt;br /&gt;
&lt;br /&gt;
This is probably something best left for discussion next Wednesday.&lt;br /&gt;
&lt;br /&gt;
I am building on 10.8 with a private build of clang 3.1 tagged as stable from svn.&amp;lt;br/&amp;gt;&lt;br /&gt;
I also installed homebrew, and from that installed QT 4.8.3. ( I manually set the required Qt version to 4.8.3)&lt;br /&gt;
&lt;br /&gt;
*FROM THE SAME SOURCE TREE* I also am building Slicer built with ITKv3, and that also seems to be building a reasonable package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;&lt;br /&gt;
git clone git@github.com:BRAINSia/Slicer43.git&lt;br /&gt;
cd  Slicer43&lt;br /&gt;
git checkout origin/AddDWIConvert &amp;amp;ndash;b AddDWIConvert&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv3  &amp;amp;amp;&amp;amp;amp; sl-itkv3  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=3 ../Slicer43&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv4  &amp;amp;amp;&amp;amp;amp; sl-itkv4  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=4 ../Slicer43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-05&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| Matt McCormick coordinates a Google Hang out&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| In preparation for the upcoming Slicer 4.3 and the NA-MIC Winter Project Week, we are planning a hackathon to help with migration to ITKv4 as the default version of ITK in Slicer.&amp;amp;nbsp; For some time, 	community members such as Hans Johnson, Bill Lorensen, and Jean-Christophe Fillion-Robin have made sure ITKv4 works well with Slicer, and we hope to gather and focus on remaining issues that should be addressed.&lt;br /&gt;
&lt;br /&gt;
The hackathon will take place on:&amp;amp;nbsp; &amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;background-color:Yellow;&amp;quot;&amp;gt;&lt;br /&gt;
* Wednesday, December 5th from 10AM Eastern Time until we run out of energy :-). &amp;lt;br\&amp;gt;&lt;br /&gt;
* Primary Connection Information:  &amp;lt;span style=&amp;quot;color:#FFFFFF; background:#FF69B4&amp;quot;&amp;gt; &amp;lt;&amp;lt; Matt Please Fill this in &amp;gt;&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
* Fallback/Auxiliary connection information:  GoTo Meeting for sharing screens with mouse control:   &amp;lt;br\&amp;gt;&lt;br /&gt;
Please join my meeting, Dec 5, 2012 at 9:00 AM CST. &amp;lt;br\&amp;gt;&lt;br /&gt;
https://www1.gotomeeting.com/join/739397184 &amp;lt;br\&amp;gt;&lt;br /&gt;
Meeting ID: 739-397-184&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;The hackathon will take place on a Google+ Hangout.&amp;amp;nbsp; I will follow up with the link to the hangout on this email thread when we starts.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues to address at Google Hangout:&lt;br /&gt;
&lt;br /&gt;
Issues in the Slicer bug tracker with the ITKv4 tag:  ( See table above )&lt;br /&gt;
&lt;br /&gt;
If there are other issues to address, please report them in the Slicer bug tracker and reply to this thread.&lt;br /&gt;
&lt;br /&gt;
Work will occur on the following repository on Github.&amp;amp;nbsp;&amp;amp;nbsp; https://github.com/BRAINSia/Slicer43&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Historical (and probably outdated) information =&lt;br /&gt;
&lt;br /&gt;
== Consensus as of 2011 ==&lt;br /&gt;
&lt;br /&gt;
* Slicer RSNA 2011 will be built against ITKv3&lt;br /&gt;
&lt;br /&gt;
* External module requiring ITKv4 will be linked statically against ITKv4&lt;br /&gt;
** Associated command line module will be built as executable only. Indeed having both ITKv3 and ITKv4 in the same process will most likely result in some weird symbol clash.&lt;br /&gt;
&lt;br /&gt;
=== Questions ===&lt;br /&gt;
&lt;br /&gt;
* Should each extension depending on ITKv4 download and build its own copy of ITKv4 or should Slicer build and expose both ITKv3 and ITKv4 ?&lt;br /&gt;
&lt;br /&gt;
== Custom MetaIO in SlicerITK ==&lt;br /&gt;
&lt;br /&gt;
* To minimize memory usage and increase efficiency of Command line module execution, itkImageFileReader.txx in SlicerITK has been patched. See https://github.com/Slicer/ITK/commit/8c73dc57e4ae67328ff8e44934b72fd4cc5d4dd3 and https://github.com/Slicer/ITK/commit/12349021b152ac6546c2caf09bbbee4266baddad&lt;br /&gt;
&lt;br /&gt;
* Bill mentioned it should be possible to avoid patching SlicerITK by creating a custom Factory / plugins. &lt;br /&gt;
&lt;br /&gt;
* From Bradley Lowekamp - ITK mailing list - Sun, Jul 17, 2011 at 11:33 AM  subject '''Re: [Insight-developers] ITK 3 tag to use with slicer? Fwd: Slicer release schedule'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Stephen,&lt;br /&gt;
&lt;br /&gt;
If I understand this change correctly, this patch allows the usage of a buffer allocated by the ImageIO to be passed &lt;br /&gt;
all the way to the Image class if  all the types match up. The is accomplished by adding the following &lt;br /&gt;
methods: ImageIO::CanUseOwnBuffer, ImageIO::ReadUsingOwnBuffer() and ImageIO::GetOwnBuffer.&lt;br /&gt;
&lt;br /&gt;
I assume that this change is for the MemoryImageFileReader that is used with Slicer. ( can see how this could be &lt;br /&gt;
quite advantageous ( and also the potential for scary alias when combined with InPlace filters ). But as not one &lt;br /&gt;
single ITK ImageIO has support for these methods. I'd like to question if they should be brought into the ITK main repo, &lt;br /&gt;
as they don't appear to currently provide any benefit to ITK and only complicate as already complicated interface to the &lt;br /&gt;
ImageIO. If these changes are desired in ITK, then I would strongly encourage better documentation for the new methods in &lt;br /&gt;
ImageIO, to enable new developers with add this feature to ImageIO classes.&lt;br /&gt;
&lt;br /&gt;
Brad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From Bill - Thu, Jul 28, 2011 at 5:19 PM '''Re: [slicer-devel] Engineering:TCON 2011 - NAMIC'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I checked the patches. Two classes are patched: ImageIOBase and ImageFileReader. Now I do not think my factory idea is worthwhile. &lt;br /&gt;
We should to bring the changes into ITK, and convert ITK's Meta and Nifti ImageIO's to use it.&lt;br /&gt;
&lt;br /&gt;
Bill&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the na-mic tcon it was discussed that nrrd and nifti readers also perform the memcpy since the native libraries perform the Information and Read steps in a single API call.  Therefor if the feature existed at the ITK level, then several readers could take advantage of it.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29456</id>
		<title>ITKv4 Migration plan</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29456"/>
		<updated>2012-12-01T17:10:53Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Timeline */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Slicer4#Plan| Back to Slicer]]&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is designed to identify and track the work that needs to be done during the month of 2012-12-01 to 2012-12-31 in order to transition Slicer to a solid and uniform ITKv4 platform. Originally this document, created following the NAMIC Engineering TCon of July 28th [http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28], discuss the element that should be considered before transitioning Slicer to ITKv4.&lt;br /&gt;
&lt;br /&gt;
Historical and other old pages with possibly outdated information. If the information on these other pages is relevant, they need to be pushed here.&lt;br /&gt;
&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/ITKv4_Migration_plan&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/Developer_Meetings/20121106#ITKv4&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issue To Address ==&lt;br /&gt;
&lt;br /&gt;
== Timeline ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;color:red; background-color:ltgrey;&amp;quot; cellpadding=&amp;quot;5&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Issues for migration to ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! _Due_Date_ &lt;br /&gt;
! Progress Status&lt;br /&gt;
! Team Members &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-31 &lt;br /&gt;
| Started&lt;br /&gt;
| Hans J., Steve P., JC, Bill L., Matt M., Kent W.&lt;br /&gt;
| http://www.na-mic.org/Bug/search.php?project_id=3&amp;amp;amp;sticky_issues=on&amp;amp;amp;sortby=last_updated&amp;amp;amp;dir=DESC&amp;amp;amp;hide_status_id=80&amp;amp;amp;tag_string=ITKv4&lt;br /&gt;
|-&lt;br /&gt;
|  2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Steve P., Bill L., Matt M., Kent W.&lt;br /&gt;
| Test Slicer/ITKv4 on all platforms, especially 64bit VS2008.&lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Matt M., Bill L.&lt;br /&gt;
| Look into reducing the number of ITKv4 Modules enabled when building&lt;br /&gt;
|-&lt;br /&gt;
| N/A to ITKv4&lt;br /&gt;
|&lt;br /&gt;
| Matt M., Steve P., Bill L., Matt M.&lt;br /&gt;
| Slicer modules to reduce load time on Windows&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Timeline ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;color:green; background-color:white;&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Timeline for ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! _Due_Date_ &lt;br /&gt;
! Progress Status &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-01&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| Done&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot; |Hans provides a first pass reference set of patches that build on Mac and demonstrates that nearly all functionality is maintained identically between ITKv3 and ITKv4&lt;br /&gt;
|- &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| I've successfully created a mac dmg package. &amp;amp;quot;CPack: - package: /Users/johnsonhj/src/Slicer-git-itkv4/Slicer-build/Slicer-4.2.0-macosx-amd64.dmg generated.&amp;amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
The package is not yet completely successful though :(.&amp;amp;nbsp; It seems to run just fine on the machine I used to build the package, but when running on my wifes laptop, it can not find a Qt library in /usr/local/lib/&lt;br /&gt;
&lt;br /&gt;
This is probably something best left for discussion next Wednesday.&lt;br /&gt;
&lt;br /&gt;
I am building on 10.8 with a private build of clang 3.1 tagged as stable from svn.&amp;lt;br/&amp;gt;&lt;br /&gt;
I also installed homebrew, and from that installed QT 4.8.3. ( I manually set the required Qt version to 4.8.3)&lt;br /&gt;
&lt;br /&gt;
*FROM THE SAME SOURCE TREE* I also am building Slicer built with ITKv3, and that also seems to be building a reasonable package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;&lt;br /&gt;
git clone git@github.com:BRAINSia/Slicer43.git&lt;br /&gt;
cd  Slicer43&lt;br /&gt;
git checkout origin/AddDWIConvert &amp;amp;ndash;b AddDWIConvert&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv3  &amp;amp;amp;&amp;amp;amp; sl-itkv3  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=3 ../Slicer43&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv4  &amp;amp;amp;&amp;amp;amp; sl-itkv4  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=4 ../Slicer43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-05&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| Matt McCormick coordinates a Google Hang out&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| In preparation for the upcoming Slicer 4.3 and the NA-MIC Winter Project Week, we are planning a hackathon to help with migration to ITKv4 as the default version of ITK in Slicer.&amp;amp;nbsp; For some time, 	community members such as Hans Johnson, Bill Lorensen, and Jean-Christophe Fillion-Robin have made sure ITKv4 works well with Slicer, and we hope to gather and focus on remaining issues that should be addressed.&lt;br /&gt;
&lt;br /&gt;
The hackathon will take place on:&amp;amp;nbsp; &amp;lt;br\&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;background-color:Yellow;&amp;quot;&amp;gt;&lt;br /&gt;
* Wednesday, December 5th from 10AM Eastern Time until we run out of energy :-). &amp;lt;br\&amp;gt;&lt;br /&gt;
* Primary Connection Information:  &amp;lt;span style=&amp;quot;color:#FFFFFF; background:#FF69B4&amp;quot;&amp;gt; &amp;lt;&amp;lt; Matt Please Fill this in &amp;gt;&amp;gt; &amp;lt;/span&amp;gt;&lt;br /&gt;
* Fallback/Auxiliary connection information:  GoTo Meeting for sharing screens with mouse control:   &amp;lt;br\&amp;gt;&lt;br /&gt;
Please join my meeting, Dec 5, 2012 at 9:00 AM CST. &amp;lt;br\&amp;gt;&lt;br /&gt;
https://www1.gotomeeting.com/join/739397184 &amp;lt;br\&amp;gt;&lt;br /&gt;
Meeting ID: 739-397-184&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;The hackathon will take place on a Google+ Hangout.&amp;amp;nbsp; I will follow up with the link to the hangout on this email thread when we starts.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues to address at Google Hangout:&lt;br /&gt;
&lt;br /&gt;
Issues in the Slicer bug tracker with the ITKv4 tag:  ( See table above )&lt;br /&gt;
&lt;br /&gt;
If there are other issues to address, please report them in the Slicer bug tracker and reply to this thread.&lt;br /&gt;
&lt;br /&gt;
Work will occur on the following repository on Github.&amp;amp;nbsp;&amp;amp;nbsp; https://github.com/BRAINSia/Slicer43&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| 2012-12-&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;background-color: orange;&amp;quot;| &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Historical (and probably outdated) information =&lt;br /&gt;
&lt;br /&gt;
== Consensus as of 2011 ==&lt;br /&gt;
&lt;br /&gt;
* Slicer RSNA 2011 will be built against ITKv3&lt;br /&gt;
&lt;br /&gt;
* External module requiring ITKv4 will be linked statically against ITKv4&lt;br /&gt;
** Associated command line module will be built as executable only. Indeed having both ITKv3 and ITKv4 in the same process will most likely result in some weird symbol clash.&lt;br /&gt;
&lt;br /&gt;
=== Questions ===&lt;br /&gt;
&lt;br /&gt;
* Should each extension depending on ITKv4 download and build its own copy of ITKv4 or should Slicer build and expose both ITKv3 and ITKv4 ?&lt;br /&gt;
&lt;br /&gt;
== Custom MetaIO in SlicerITK ==&lt;br /&gt;
&lt;br /&gt;
* To minimize memory usage and increase efficiency of Command line module execution, itkImageFileReader.txx in SlicerITK has been patched. See https://github.com/Slicer/ITK/commit/8c73dc57e4ae67328ff8e44934b72fd4cc5d4dd3 and https://github.com/Slicer/ITK/commit/12349021b152ac6546c2caf09bbbee4266baddad&lt;br /&gt;
&lt;br /&gt;
* Bill mentioned it should be possible to avoid patching SlicerITK by creating a custom Factory / plugins. &lt;br /&gt;
&lt;br /&gt;
* From Bradley Lowekamp - ITK mailing list - Sun, Jul 17, 2011 at 11:33 AM  subject '''Re: [Insight-developers] ITK 3 tag to use with slicer? Fwd: Slicer release schedule'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Stephen,&lt;br /&gt;
&lt;br /&gt;
If I understand this change correctly, this patch allows the usage of a buffer allocated by the ImageIO to be passed &lt;br /&gt;
all the way to the Image class if  all the types match up. The is accomplished by adding the following &lt;br /&gt;
methods: ImageIO::CanUseOwnBuffer, ImageIO::ReadUsingOwnBuffer() and ImageIO::GetOwnBuffer.&lt;br /&gt;
&lt;br /&gt;
I assume that this change is for the MemoryImageFileReader that is used with Slicer. ( can see how this could be &lt;br /&gt;
quite advantageous ( and also the potential for scary alias when combined with InPlace filters ). But as not one &lt;br /&gt;
single ITK ImageIO has support for these methods. I'd like to question if they should be brought into the ITK main repo, &lt;br /&gt;
as they don't appear to currently provide any benefit to ITK and only complicate as already complicated interface to the &lt;br /&gt;
ImageIO. If these changes are desired in ITK, then I would strongly encourage better documentation for the new methods in &lt;br /&gt;
ImageIO, to enable new developers with add this feature to ImageIO classes.&lt;br /&gt;
&lt;br /&gt;
Brad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From Bill - Thu, Jul 28, 2011 at 5:19 PM '''Re: [slicer-devel] Engineering:TCON 2011 - NAMIC'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I checked the patches. Two classes are patched: ImageIOBase and ImageFileReader. Now I do not think my factory idea is worthwhile. &lt;br /&gt;
We should to bring the changes into ITK, and convert ITK's Meta and Nifti ImageIO's to use it.&lt;br /&gt;
&lt;br /&gt;
Bill&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the na-mic tcon it was discussed that nrrd and nifti readers also perform the memcpy since the native libraries perform the Information and Read steps in a single API call.  Therefor if the feature existed at the ITK level, then several readers could take advantage of it.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29455</id>
		<title>ITKv4 Migration plan</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29455"/>
		<updated>2012-12-01T16:38:56Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Slicer4#Plan| Back to Slicer]]&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is designed to identify and track the work that needs to be done during the month of 2012-12-01 to 2012-12-31 in order to transition Slicer to a solid and uniform ITKv4 platform. Originally this document, created following the NAMIC Engineering TCon of July 28th [http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28], discuss the element that should be considered before transitioning Slicer to ITKv4.&lt;br /&gt;
&lt;br /&gt;
Historical and other old pages with possibly outdated information. If the information on these other pages is relevant, they need to be pushed here.&lt;br /&gt;
&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/ITKv4_Migration_plan&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/Developer_Meetings/20121106#ITKv4&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Timeline ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;color:green; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Timeline for ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! Date &lt;br /&gt;
! Status &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-01&lt;br /&gt;
| Done&lt;br /&gt;
| Hans provides a first pass reference set of patches that build on Mac and demonstrates that nearly all functionality is maintained identically between ITKv3 and ITKv4&lt;br /&gt;
|- &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| I've successfully created a mac dmg package. &amp;amp;quot;CPack: - package: /Users/johnsonhj/src/Slicer-git-itkv4/Slicer-build/Slicer-4.2.0-macosx-amd64.dmg generated.&amp;amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
The package is not yet completely successful though :(.&amp;amp;nbsp; It seems to run just fine on the machine I used to build the package, but when running on my wifes laptop, it can not find a Qt library in /usr/local/lib/&lt;br /&gt;
&lt;br /&gt;
This is probably something best left for discussion next Wednesday.&lt;br /&gt;
&lt;br /&gt;
I am building on 10.8 with a private build of clang 3.1 tagged as stable from svn.&amp;lt;br/&amp;gt;&lt;br /&gt;
I also installed homebrew, and from that installed QT 4.8.3. ( I manually set the required Qt version to 4.8.3)&lt;br /&gt;
&lt;br /&gt;
*FROM THE SAME SOURCE TREE* I also am building Slicer built with ITKv3, and that also seems to be building a reasonable package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;&lt;br /&gt;
git clone git@github.com:BRAINSia/Slicer43.git&lt;br /&gt;
cd  Slicer43&lt;br /&gt;
git checkout origin/AddDWIConvert &amp;amp;ndash;b AddDWIConvert&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv3  &amp;amp;amp;&amp;amp;amp; sl-itkv3  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=3 ../Slicer43&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv4  &amp;amp;amp;&amp;amp;amp; sl-itkv4  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=4 ../Slicer43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Matt McCormick coordinates a Google Hang out&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| In preparation for the upcoming Slicer 4.3 and the NA-MIC Winter Project Week, we are planning a hackathon to help with migration to ITKv4 as the default version of ITK in Slicer.&amp;amp;nbsp; For some time, 	community members such as Hans Johnson, Bill Lorensen, and Jean-Christophe Fillion-Robin have made sure ITKv4 works well with Slicer, and we hope to gather and focus on remaining issues that should be addressed.&lt;br /&gt;
&lt;br /&gt;
The hackathon will take place on:&amp;amp;nbsp; &amp;lt;span style=&amp;quot;background-color:Yellow;&amp;quot;&amp;gt;Wednesday, December 5th from 10AM Eastern Time &amp;lt;/span&amp;gt;until we run out of energy :-).&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;The hackathon will take place on a Google+ Hangout.&amp;amp;nbsp; I will follow up with the link to the hangout on this email thread when we starts.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues to address at Google Hangout:&lt;br /&gt;
&lt;br /&gt;
Issues in the Slicer bug tracker with the ITKv4 tag: &amp;lt;br\&amp;gt;&lt;br /&gt;
* http://www.na-mic.org/Bug/search.php?project_id=3&amp;amp;amp;sticky_issues=on&amp;amp;amp;sortby=last_updated&amp;amp;amp;dir=DESC&amp;amp;amp;hide_status_id=80&amp;amp;amp;tag_string=ITKv4&lt;br /&gt;
* Test Slicer/ITKv4 on all platforms, especially 64bit VS2008.&lt;br /&gt;
* Look into reducing the number of ITK Modules enabled when building&lt;br /&gt;
* Slicer modules to reduce load time on Windows&lt;br /&gt;
&lt;br /&gt;
If there are other issues to address, please report them in the Slicer 	bug tracker and reply to this thread.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Work will occur on the following repository on Github.&amp;amp;nbsp;&amp;amp;nbsp; https://github.com/BRAINSia/Slicer43&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Historical (and probably outdated) information =&lt;br /&gt;
&lt;br /&gt;
== Consensus as of 2011 ==&lt;br /&gt;
&lt;br /&gt;
* Slicer RSNA 2011 will be built against ITKv3&lt;br /&gt;
&lt;br /&gt;
* External module requiring ITKv4 will be linked statically against ITKv4&lt;br /&gt;
** Associated command line module will be built as executable only. Indeed having both ITKv3 and ITKv4 in the same process will most likely result in some weird symbol clash.&lt;br /&gt;
&lt;br /&gt;
=== Questions ===&lt;br /&gt;
&lt;br /&gt;
* Should each extension depending on ITKv4 download and build its own copy of ITKv4 or should Slicer build and expose both ITKv3 and ITKv4 ?&lt;br /&gt;
&lt;br /&gt;
== Custom MetaIO in SlicerITK ==&lt;br /&gt;
&lt;br /&gt;
* To minimize memory usage and increase efficiency of Command line module execution, itkImageFileReader.txx in SlicerITK has been patched. See https://github.com/Slicer/ITK/commit/8c73dc57e4ae67328ff8e44934b72fd4cc5d4dd3 and https://github.com/Slicer/ITK/commit/12349021b152ac6546c2caf09bbbee4266baddad&lt;br /&gt;
&lt;br /&gt;
* Bill mentioned it should be possible to avoid patching SlicerITK by creating a custom Factory / plugins. &lt;br /&gt;
&lt;br /&gt;
* From Bradley Lowekamp - ITK mailing list - Sun, Jul 17, 2011 at 11:33 AM  subject '''Re: [Insight-developers] ITK 3 tag to use with slicer? Fwd: Slicer release schedule'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Stephen,&lt;br /&gt;
&lt;br /&gt;
If I understand this change correctly, this patch allows the usage of a buffer allocated by the ImageIO to be passed &lt;br /&gt;
all the way to the Image class if  all the types match up. The is accomplished by adding the following &lt;br /&gt;
methods: ImageIO::CanUseOwnBuffer, ImageIO::ReadUsingOwnBuffer() and ImageIO::GetOwnBuffer.&lt;br /&gt;
&lt;br /&gt;
I assume that this change is for the MemoryImageFileReader that is used with Slicer. ( can see how this could be &lt;br /&gt;
quite advantageous ( and also the potential for scary alias when combined with InPlace filters ). But as not one &lt;br /&gt;
single ITK ImageIO has support for these methods. I'd like to question if they should be brought into the ITK main repo, &lt;br /&gt;
as they don't appear to currently provide any benefit to ITK and only complicate as already complicated interface to the &lt;br /&gt;
ImageIO. If these changes are desired in ITK, then I would strongly encourage better documentation for the new methods in &lt;br /&gt;
ImageIO, to enable new developers with add this feature to ImageIO classes.&lt;br /&gt;
&lt;br /&gt;
Brad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From Bill - Thu, Jul 28, 2011 at 5:19 PM '''Re: [slicer-devel] Engineering:TCON 2011 - NAMIC'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I checked the patches. Two classes are patched: ImageIOBase and ImageFileReader. Now I do not think my factory idea is worthwhile. &lt;br /&gt;
We should to bring the changes into ITK, and convert ITK's Meta and Nifti ImageIO's to use it.&lt;br /&gt;
&lt;br /&gt;
Bill&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the na-mic tcon it was discussed that nrrd and nifti readers also perform the memcpy since the native libraries perform the Information and Read steps in a single API call.  Therefor if the feature existed at the ITK level, then several readers could take advantage of it.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29454</id>
		<title>ITKv4 Migration plan</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29454"/>
		<updated>2012-12-01T16:36:32Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Consensus as of 2011 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Slicer4#Plan| Back to Slicer]]&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is designed to identify and track the work that needs to be done during the month of 2012-12-01 to 2012-12-31 in order to transition Slicer to a solid and uniform ITKv4 platform. Originally this document, created following the NAMIC Engineering TCon of July 28th [http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28], discuss the element that should be considered before transitioning Slicer to ITKv4.&lt;br /&gt;
&lt;br /&gt;
Historical and other old pages with possibly outdated information. If the information on these other pages is relevant, they need to be pushed here.&lt;br /&gt;
&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/ITKv4_Migration_plan&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/Developer_Meetings/20121106#ITKv4&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Timeline for ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! Date &lt;br /&gt;
! Status &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-01&lt;br /&gt;
| Done&lt;br /&gt;
| Hans provides a first pass reference set of patches that build on Mac and demonstrates that nearly all functionality is maintained identically between ITKv3 and ITKv4&lt;br /&gt;
|- &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| I've successfully created a mac dmg package. &amp;amp;quot;CPack: - package: /Users/johnsonhj/src/Slicer-git-itkv4/Slicer-build/Slicer-4.2.0-macosx-amd64.dmg generated.&amp;amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
The package is not yet completely successful though :(.&amp;amp;nbsp; It seems to run just fine on the machine I used to build the package, but when running on my wifes laptop, it can not find a Qt library in /usr/local/lib/&lt;br /&gt;
&lt;br /&gt;
This is probably something best left for discussion next Wednesday.&lt;br /&gt;
&lt;br /&gt;
I am building on 10.8 with a private build of clang 3.1 tagged as stable from svn.&amp;lt;br/&amp;gt;&lt;br /&gt;
I also installed homebrew, and from that installed QT 4.8.3. ( I manually set the required Qt version to 4.8.3)&lt;br /&gt;
&lt;br /&gt;
*FROM THE SAME SOURCE TREE* I also am building Slicer built with ITKv3, and that also seems to be building a reasonable package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;&lt;br /&gt;
git clone git@github.com:BRAINSia/Slicer43.git&lt;br /&gt;
cd  Slicer43&lt;br /&gt;
git checkout origin/AddDWIConvert &amp;amp;ndash;b AddDWIConvert&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv3  &amp;amp;amp;&amp;amp;amp; sl-itkv3  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=3 ../Slicer43&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv4  &amp;amp;amp;&amp;amp;amp; sl-itkv4  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=4 ../Slicer43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Matt McCormick coordinates a Google Hang out&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| In preparation for the upcoming Slicer 4.3 and the NA-MIC Winter Project Week, we are planning a hackathon to help with migration to ITKv4 as the default version of ITK in Slicer.&amp;amp;nbsp; For some time, 	community members such as Hans Johnson, Bill Lorensen, and Jean-Christophe Fillion-Robin have made sure ITKv4 works well with Slicer, and we hope to gather and focus on remaining issues that should be addressed.&lt;br /&gt;
&lt;br /&gt;
The hackathon will take place on:&amp;amp;nbsp; &amp;lt;span style=&amp;quot;background-color:Yellow;&amp;quot;&amp;gt;Wednesday, December 5th from 10AM Eastern Time &amp;lt;/span&amp;gt;until we run out of energy :-).&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;The hackathon will take place on a Google+ Hangout.&amp;amp;nbsp; I will follow up with the link to the hangout on this email thread when we starts.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues to address at Google Hangout:&lt;br /&gt;
&lt;br /&gt;
Issues in the Slicer bug tracker with the ITKv4 tag: &amp;lt;br\&amp;gt;&lt;br /&gt;
* http://www.na-mic.org/Bug/search.php?project_id=3&amp;amp;amp;sticky_issues=on&amp;amp;amp;sortby=last_updated&amp;amp;amp;dir=DESC&amp;amp;amp;hide_status_id=80&amp;amp;amp;tag_string=ITKv4&lt;br /&gt;
* Test Slicer/ITKv4 on all platforms, especially 64bit VS2008.&lt;br /&gt;
* Look into reducing the number of ITK Modules enabled when building&lt;br /&gt;
* Slicer modules to reduce load time on Windows&lt;br /&gt;
&lt;br /&gt;
If there are other issues to address, please report them in the Slicer 	bug tracker and reply to this thread.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Work will occur on the following repository on Github.&amp;amp;nbsp;&amp;amp;nbsp; https://github.com/BRAINSia/Slicer43&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Historical (and probably outdated) information =&lt;br /&gt;
&lt;br /&gt;
== Consensus as of 2011 ==&lt;br /&gt;
&lt;br /&gt;
* Slicer RSNA 2011 will be built against ITKv3&lt;br /&gt;
&lt;br /&gt;
* External module requiring ITKv4 will be linked statically against ITKv4&lt;br /&gt;
** Associated command line module will be built as executable only. Indeed having both ITKv3 and ITKv4 in the same process will most likely result in some weird symbol clash.&lt;br /&gt;
&lt;br /&gt;
=== Questions ===&lt;br /&gt;
&lt;br /&gt;
* Should each extension depending on ITKv4 download and build its own copy of ITKv4 or should Slicer build and expose both ITKv3 and ITKv4 ?&lt;br /&gt;
&lt;br /&gt;
== Custom MetaIO in SlicerITK ==&lt;br /&gt;
&lt;br /&gt;
* To minimize memory usage and increase efficiency of Command line module execution, itkImageFileReader.txx in SlicerITK has been patched. See https://github.com/Slicer/ITK/commit/8c73dc57e4ae67328ff8e44934b72fd4cc5d4dd3 and https://github.com/Slicer/ITK/commit/12349021b152ac6546c2caf09bbbee4266baddad&lt;br /&gt;
&lt;br /&gt;
* Bill mentioned it should be possible to avoid patching SlicerITK by creating a custom Factory / plugins. &lt;br /&gt;
&lt;br /&gt;
* From Bradley Lowekamp - ITK mailing list - Sun, Jul 17, 2011 at 11:33 AM  subject '''Re: [Insight-developers] ITK 3 tag to use with slicer? Fwd: Slicer release schedule'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Stephen,&lt;br /&gt;
&lt;br /&gt;
If I understand this change correctly, this patch allows the usage of a buffer allocated by the ImageIO to be passed &lt;br /&gt;
all the way to the Image class if  all the types match up. The is accomplished by adding the following &lt;br /&gt;
methods: ImageIO::CanUseOwnBuffer, ImageIO::ReadUsingOwnBuffer() and ImageIO::GetOwnBuffer.&lt;br /&gt;
&lt;br /&gt;
I assume that this change is for the MemoryImageFileReader that is used with Slicer. ( can see how this could be &lt;br /&gt;
quite advantageous ( and also the potential for scary alias when combined with InPlace filters ). But as not one &lt;br /&gt;
single ITK ImageIO has support for these methods. I'd like to question if they should be brought into the ITK main repo, &lt;br /&gt;
as they don't appear to currently provide any benefit to ITK and only complicate as already complicated interface to the &lt;br /&gt;
ImageIO. If these changes are desired in ITK, then I would strongly encourage better documentation for the new methods in &lt;br /&gt;
ImageIO, to enable new developers with add this feature to ImageIO classes.&lt;br /&gt;
&lt;br /&gt;
Brad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From Bill - Thu, Jul 28, 2011 at 5:19 PM '''Re: [slicer-devel] Engineering:TCON 2011 - NAMIC'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I checked the patches. Two classes are patched: ImageIOBase and ImageFileReader. Now I do not think my factory idea is worthwhile. &lt;br /&gt;
We should to bring the changes into ITK, and convert ITK's Meta and Nifti ImageIO's to use it.&lt;br /&gt;
&lt;br /&gt;
Bill&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the na-mic tcon it was discussed that nrrd and nifti readers also perform the memcpy since the native libraries perform the Information and Read steps in a single API call.  Therefor if the feature existed at the ITK level, then several readers could take advantage of it.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29453</id>
		<title>ITKv4 Migration plan</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29453"/>
		<updated>2012-12-01T16:35:51Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Current consensus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Slicer4#Plan| Back to Slicer]]&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is designed to identify and track the work that needs to be done during the month of 2012-12-01 to 2012-12-31 in order to transition Slicer to a solid and uniform ITKv4 platform. Originally this document, created following the NAMIC Engineering TCon of July 28th [http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28], discuss the element that should be considered before transitioning Slicer to ITKv4.&lt;br /&gt;
&lt;br /&gt;
Historical and other old pages with possibly outdated information. If the information on these other pages is relevant, they need to be pushed here.&lt;br /&gt;
&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/ITKv4_Migration_plan&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/Developer_Meetings/20121106#ITKv4&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Timeline for ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! Date &lt;br /&gt;
! Status &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-01&lt;br /&gt;
| Done&lt;br /&gt;
| Hans provides a first pass reference set of patches that build on Mac and demonstrates that nearly all functionality is maintained identically between ITKv3 and ITKv4&lt;br /&gt;
|- &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| I've successfully created a mac dmg package. &amp;amp;quot;CPack: - package: /Users/johnsonhj/src/Slicer-git-itkv4/Slicer-build/Slicer-4.2.0-macosx-amd64.dmg generated.&amp;amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
The package is not yet completely successful though :(.&amp;amp;nbsp; It seems to run just fine on the machine I used to build the package, but when running on my wifes laptop, it can not find a Qt library in /usr/local/lib/&lt;br /&gt;
&lt;br /&gt;
This is probably something best left for discussion next Wednesday.&lt;br /&gt;
&lt;br /&gt;
I am building on 10.8 with a private build of clang 3.1 tagged as stable from svn.&amp;lt;br/&amp;gt;&lt;br /&gt;
I also installed homebrew, and from that installed QT 4.8.3. ( I manually set the required Qt version to 4.8.3)&lt;br /&gt;
&lt;br /&gt;
*FROM THE SAME SOURCE TREE* I also am building Slicer built with ITKv3, and that also seems to be building a reasonable package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;&lt;br /&gt;
git clone git@github.com:BRAINSia/Slicer43.git&lt;br /&gt;
cd  Slicer43&lt;br /&gt;
git checkout origin/AddDWIConvert &amp;amp;ndash;b AddDWIConvert&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv3  &amp;amp;amp;&amp;amp;amp; sl-itkv3  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=3 ../Slicer43&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv4  &amp;amp;amp;&amp;amp;amp; sl-itkv4  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=4 ../Slicer43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Matt McCormick coordinates a Google Hang out&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| In preparation for the upcoming Slicer 4.3 and the NA-MIC Winter Project Week, we are planning a hackathon to help with migration to ITKv4 as the default version of ITK in Slicer.&amp;amp;nbsp; For some time, 	community members such as Hans Johnson, Bill Lorensen, and Jean-Christophe Fillion-Robin have made sure ITKv4 works well with Slicer, and we hope to gather and focus on remaining issues that should be addressed.&lt;br /&gt;
&lt;br /&gt;
The hackathon will take place on:&amp;amp;nbsp; &amp;lt;span style=&amp;quot;background-color:Yellow;&amp;quot;&amp;gt;Wednesday, December 5th from 10AM Eastern Time &amp;lt;/span&amp;gt;until we run out of energy :-).&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;The hackathon will take place on a Google+ Hangout.&amp;amp;nbsp; I will follow up with the link to the hangout on this email thread when we starts.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues to address at Google Hangout:&lt;br /&gt;
&lt;br /&gt;
Issues in the Slicer bug tracker with the ITKv4 tag: &amp;lt;br\&amp;gt;&lt;br /&gt;
* http://www.na-mic.org/Bug/search.php?project_id=3&amp;amp;amp;sticky_issues=on&amp;amp;amp;sortby=last_updated&amp;amp;amp;dir=DESC&amp;amp;amp;hide_status_id=80&amp;amp;amp;tag_string=ITKv4&lt;br /&gt;
* Test Slicer/ITKv4 on all platforms, especially 64bit VS2008.&lt;br /&gt;
* Look into reducing the number of ITK Modules enabled when building&lt;br /&gt;
* Slicer modules to reduce load time on Windows&lt;br /&gt;
&lt;br /&gt;
If there are other issues to address, please report them in the Slicer 	bug tracker and reply to this thread.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Work will occur on the following repository on Github.&amp;amp;nbsp;&amp;amp;nbsp; https://github.com/BRAINSia/Slicer43&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Consensus as of 2011 ==&lt;br /&gt;
&lt;br /&gt;
* Slicer RSNA 2011 will be built against ITKv3&lt;br /&gt;
&lt;br /&gt;
* External module requiring ITKv4 will be linked statically against ITKv4&lt;br /&gt;
** Associated command line module will be built as executable only. Indeed having both ITKv3 and ITKv4 in the same process will most likely result in some weird symbol clash.&lt;br /&gt;
&lt;br /&gt;
=== Questions ===&lt;br /&gt;
&lt;br /&gt;
* Should each extension depending on ITKv4 download and build its own copy of ITKv4 or should Slicer build and expose both ITKv3 and ITKv4 ?&lt;br /&gt;
&lt;br /&gt;
== Custom MetaIO in SlicerITK ==&lt;br /&gt;
&lt;br /&gt;
* To minimize memory usage and increase efficiency of Command line module execution, itkImageFileReader.txx in SlicerITK has been patched. See https://github.com/Slicer/ITK/commit/8c73dc57e4ae67328ff8e44934b72fd4cc5d4dd3 and https://github.com/Slicer/ITK/commit/12349021b152ac6546c2caf09bbbee4266baddad&lt;br /&gt;
&lt;br /&gt;
* Bill mentioned it should be possible to avoid patching SlicerITK by creating a custom Factory / plugins. &lt;br /&gt;
&lt;br /&gt;
* From Bradley Lowekamp - ITK mailing list - Sun, Jul 17, 2011 at 11:33 AM  subject '''Re: [Insight-developers] ITK 3 tag to use with slicer? Fwd: Slicer release schedule'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Stephen,&lt;br /&gt;
&lt;br /&gt;
If I understand this change correctly, this patch allows the usage of a buffer allocated by the ImageIO to be passed &lt;br /&gt;
all the way to the Image class if  all the types match up. The is accomplished by adding the following &lt;br /&gt;
methods: ImageIO::CanUseOwnBuffer, ImageIO::ReadUsingOwnBuffer() and ImageIO::GetOwnBuffer.&lt;br /&gt;
&lt;br /&gt;
I assume that this change is for the MemoryImageFileReader that is used with Slicer. ( can see how this could be &lt;br /&gt;
quite advantageous ( and also the potential for scary alias when combined with InPlace filters ). But as not one &lt;br /&gt;
single ITK ImageIO has support for these methods. I'd like to question if they should be brought into the ITK main repo, &lt;br /&gt;
as they don't appear to currently provide any benefit to ITK and only complicate as already complicated interface to the &lt;br /&gt;
ImageIO. If these changes are desired in ITK, then I would strongly encourage better documentation for the new methods in &lt;br /&gt;
ImageIO, to enable new developers with add this feature to ImageIO classes.&lt;br /&gt;
&lt;br /&gt;
Brad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From Bill - Thu, Jul 28, 2011 at 5:19 PM '''Re: [slicer-devel] Engineering:TCON 2011 - NAMIC'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I checked the patches. Two classes are patched: ImageIOBase and ImageFileReader. Now I do not think my factory idea is worthwhile. &lt;br /&gt;
We should to bring the changes into ITK, and convert ITK's Meta and Nifti ImageIO's to use it.&lt;br /&gt;
&lt;br /&gt;
Bill&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the na-mic tcon it was discussed that nrrd and nifti readers also perform the memcpy since the native libraries perform the Information and Read steps in a single API call.  Therefor if the feature existed at the ITK level, then several readers could take advantage of it.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29452</id>
		<title>ITKv4 Migration plan</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=ITKv4_Migration_plan&amp;diff=29452"/>
		<updated>2012-12-01T16:34:49Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Slicer4#Plan| Back to Slicer]]&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is designed to identify and track the work that needs to be done during the month of 2012-12-01 to 2012-12-31 in order to transition Slicer to a solid and uniform ITKv4 platform. Originally this document, created following the NAMIC Engineering TCon of July 28th [http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28], discuss the element that should be considered before transitioning Slicer to ITKv4.&lt;br /&gt;
&lt;br /&gt;
Historical and other old pages with possibly outdated information. If the information on these other pages is relevant, they need to be pushed here.&lt;br /&gt;
&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/ITKv4_Migration_plan&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/Developer_Meetings/20121106#ITKv4&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
* http://wiki.na-mic.org/Wiki/index.php/Engineering:TCON_2011#2011-07-28&amp;amp;nbsp;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Timeline for ITKv4&lt;br /&gt;
|-&lt;br /&gt;
! Date &lt;br /&gt;
! Status &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-01&lt;br /&gt;
| Done&lt;br /&gt;
| Hans provides a first pass reference set of patches that build on Mac and demonstrates that nearly all functionality is maintained identically between ITKv3 and ITKv4&lt;br /&gt;
|- &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| I've successfully created a mac dmg package. &amp;amp;quot;CPack: - package: /Users/johnsonhj/src/Slicer-git-itkv4/Slicer-build/Slicer-4.2.0-macosx-amd64.dmg generated.&amp;amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
The package is not yet completely successful though :(.&amp;amp;nbsp; It seems to run just fine on the machine I used to build the package, but when running on my wifes laptop, it can not find a Qt library in /usr/local/lib/&lt;br /&gt;
&lt;br /&gt;
This is probably something best left for discussion next Wednesday.&lt;br /&gt;
&lt;br /&gt;
I am building on 10.8 with a private build of clang 3.1 tagged as stable from svn.&amp;lt;br/&amp;gt;&lt;br /&gt;
I also installed homebrew, and from that installed QT 4.8.3. ( I manually set the required Qt version to 4.8.3)&lt;br /&gt;
&lt;br /&gt;
*FROM THE SAME SOURCE TREE* I also am building Slicer built with ITKv3, and that also seems to be building a reasonable package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;&lt;br /&gt;
git clone git@github.com:BRAINSia/Slicer43.git&lt;br /&gt;
cd  Slicer43&lt;br /&gt;
git checkout origin/AddDWIConvert &amp;amp;ndash;b AddDWIConvert&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv3  &amp;amp;amp;&amp;amp;amp; sl-itkv3  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=3 ../Slicer43&lt;br /&gt;
cd ../ &amp;amp;amp;&amp;amp;amp; mkdir sl-itkv4  &amp;amp;amp;&amp;amp;amp; sl-itkv4  &amp;amp;amp;&amp;amp;amp; CC=/opt/clang31/bin/clang CXX=/opt/clang31/bin/clang++ ccmake &amp;amp;ndash;DITK_VERSION_MAJOR:STRING=4 ../Slicer43&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2012-12-05&lt;br /&gt;
|&lt;br /&gt;
| Matt McCormick coordinates a Google Hang out&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| In preparation for the upcoming Slicer 4.3 and the NA-MIC Winter Project Week, we are planning a hackathon to help with migration to ITKv4 as the default version of ITK in Slicer.&amp;amp;nbsp; For some time, 	community members such as Hans Johnson, Bill Lorensen, and Jean-Christophe Fillion-Robin have made sure ITKv4 works well with Slicer, and we hope to gather and focus on remaining issues that should be addressed.&lt;br /&gt;
&lt;br /&gt;
The hackathon will take place on:&amp;amp;nbsp; &amp;lt;span style=&amp;quot;background-color:Yellow;&amp;quot;&amp;gt;Wednesday, December 5th from 10AM Eastern Time &amp;lt;/span&amp;gt;until we run out of energy :-).&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 13px;&amp;quot;&amp;gt;The hackathon will take place on a Google+ Hangout.&amp;amp;nbsp; I will follow up with the link to the hangout on this email thread when we starts.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Issues to address at Google Hangout:&lt;br /&gt;
&lt;br /&gt;
Issues in the Slicer bug tracker with the ITKv4 tag: &amp;lt;br\&amp;gt;&lt;br /&gt;
* http://www.na-mic.org/Bug/search.php?project_id=3&amp;amp;amp;sticky_issues=on&amp;amp;amp;sortby=last_updated&amp;amp;amp;dir=DESC&amp;amp;amp;hide_status_id=80&amp;amp;amp;tag_string=ITKv4&lt;br /&gt;
* Test Slicer/ITKv4 on all platforms, especially 64bit VS2008.&lt;br /&gt;
* Look into reducing the number of ITK Modules enabled when building&lt;br /&gt;
* Slicer modules to reduce load time on Windows&lt;br /&gt;
&lt;br /&gt;
If there are other issues to address, please report them in the Slicer 	bug tracker and reply to this thread.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Work will occur on the following repository on Github.&amp;amp;nbsp;&amp;amp;nbsp; https://github.com/BRAINSia/Slicer43&amp;lt;/div&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Current consensus ==&lt;br /&gt;
&lt;br /&gt;
* Slicer RSNA will be built against ITKv3&lt;br /&gt;
&lt;br /&gt;
* External module requiring ITKv4 will be linker statically against ITKv4&lt;br /&gt;
** Associated command line module will be built as executable only. Indeed having both ITKv3 and ITKv4 in the same process will most likely result in some weird symbol clash.&lt;br /&gt;
&lt;br /&gt;
=== Questions ===&lt;br /&gt;
&lt;br /&gt;
* Should each extension depending on ITKv4 download and build its own copy of ITKv4 or should Slicer build and expose both ITKv3 and ITKv4 ?&lt;br /&gt;
&lt;br /&gt;
== Custom MetaIO in SlicerITK ==&lt;br /&gt;
&lt;br /&gt;
* To minimize memory usage and increase efficiency of Command line module execution, itkImageFileReader.txx in SlicerITK has been patched. See https://github.com/Slicer/ITK/commit/8c73dc57e4ae67328ff8e44934b72fd4cc5d4dd3 and https://github.com/Slicer/ITK/commit/12349021b152ac6546c2caf09bbbee4266baddad&lt;br /&gt;
&lt;br /&gt;
* Bill mentioned it should be possible to avoid patching SlicerITK by creating a custom Factory / plugins. &lt;br /&gt;
&lt;br /&gt;
* From Bradley Lowekamp - ITK mailing list - Sun, Jul 17, 2011 at 11:33 AM  subject '''Re: [Insight-developers] ITK 3 tag to use with slicer? Fwd: Slicer release schedule'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Stephen,&lt;br /&gt;
&lt;br /&gt;
If I understand this change correctly, this patch allows the usage of a buffer allocated by the ImageIO to be passed &lt;br /&gt;
all the way to the Image class if  all the types match up. The is accomplished by adding the following &lt;br /&gt;
methods: ImageIO::CanUseOwnBuffer, ImageIO::ReadUsingOwnBuffer() and ImageIO::GetOwnBuffer.&lt;br /&gt;
&lt;br /&gt;
I assume that this change is for the MemoryImageFileReader that is used with Slicer. ( can see how this could be &lt;br /&gt;
quite advantageous ( and also the potential for scary alias when combined with InPlace filters ). But as not one &lt;br /&gt;
single ITK ImageIO has support for these methods. I'd like to question if they should be brought into the ITK main repo, &lt;br /&gt;
as they don't appear to currently provide any benefit to ITK and only complicate as already complicated interface to the &lt;br /&gt;
ImageIO. If these changes are desired in ITK, then I would strongly encourage better documentation for the new methods in &lt;br /&gt;
ImageIO, to enable new developers with add this feature to ImageIO classes.&lt;br /&gt;
&lt;br /&gt;
Brad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* From Bill - Thu, Jul 28, 2011 at 5:19 PM '''Re: [slicer-devel] Engineering:TCON 2011 - NAMIC'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I checked the patches. Two classes are patched: ImageIOBase and ImageFileReader. Now I do not think my factory idea is worthwhile. &lt;br /&gt;
We should to bring the changes into ITK, and convert ITK's Meta and Nifti ImageIO's to use it.&lt;br /&gt;
&lt;br /&gt;
Bill&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In the na-mic tcon it was discussed that nrrd and nifti readers also perform the memcpy since the native libraries perform the Information and Read steps in a single API call.  Therefor if the feature existed at the ITK level, then several readers could take advantage of it.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.0/HowTo&amp;diff=22676</id>
		<title>Documentation/4.0/HowTo</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.0/HowTo&amp;diff=22676"/>
		<updated>2011-11-11T16:25:52Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Infobox&lt;br /&gt;
|name         = 3D Slicer {{documentation/version}}&lt;br /&gt;
|above        = 3D Slicer&lt;br /&gt;
|abovestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = [[File:Logo-3DSlicer.png|200px|alt=3D Slicer {{documentation/version}}]]&lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|headerstyle  = background:#E7DCC3;&lt;br /&gt;
|labelstyle   = &lt;br /&gt;
|datastyle    = &lt;br /&gt;
&lt;br /&gt;
|header1 = Description&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   =&lt;br /&gt;
|header2 =&lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = Research platform for the analysis and visualization of medical images, including image guided therapy.&lt;br /&gt;
|header3 =&lt;br /&gt;
|label3  = &lt;br /&gt;
|data3   = Free and extensible open source package.&lt;br /&gt;
|header4 =&lt;br /&gt;
|label4  = Multi-platform&lt;br /&gt;
|data4   = Linux, MacOSX, Windows&lt;br /&gt;
|header5 =&lt;br /&gt;
|label5  = Version&lt;br /&gt;
|data5   = {{documentation/version}}&lt;br /&gt;
|header6 =&lt;br /&gt;
|label6  = License&lt;br /&gt;
|data6   = [http://www.slicer.org/pages/LicenseText Contribution and Software License Agreement]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
This document aims at describing the steps required to write Slicer user documentation.&lt;br /&gt;
&lt;br /&gt;
The user documentation could be grouped under two main sections:&lt;br /&gt;
* Slicer Application&lt;br /&gt;
* Modules&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Work in progress - Jc - Nov 10 2011 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The basic approach is to have most of the documentation in the source code and to populate the wiki pages using scripts. &lt;br /&gt;
*For the end user documentation use this [[Documentation/{{documentation/version}}/Modules/YOURMODULENAME|Template]]&lt;br /&gt;
&lt;br /&gt;
*All module documentation page should be named according to the following pattern: '''Documentation/4.0/Modules/MODULENAME'''&lt;br /&gt;
** There is a python helper script for SEM compliant tools that can save a significant amount of transcription time:  Slicer/Scripts/SEMToMediaWiki.py&lt;br /&gt;
*High resolution logos are in the [[Logo_Gallery|Logo Gallery]]&lt;br /&gt;
*Collaborators' name, logo, URL have been centralized into a convenient set of [http://wiki.slicer.org/slicerWiki/index.php/Template:Collaborator templates]&lt;br /&gt;
*The following [http://wiki.slicer.org/slicerWiki/index.php?title=Category:Documentation/4.0/Modules  link] will list all modules belonging to the Documentation/4.0/Modules category.&lt;br /&gt;
*For CLI modules, the '''SVNREVISION''' revision number is reported on this [http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Applications/CLI page]. The module description and the information for developers would be automatically extracted from the corresponding XML description. '''Note:''' for the moment it's required to update that number at multiple location within the wiki source of a given module documentation page. Soon this will be centralized.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.0/Acknowledgment_Team&amp;diff=22419</id>
		<title>Documentation/4.0/Acknowledgment Team</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.0/Acknowledgment_Team&amp;diff=22419"/>
		<updated>2011-11-01T21:30:42Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Funding Sources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a place holder&lt;br /&gt;
=Introduction=&lt;br /&gt;
Sincere thanks go to members of the Slicer Community for their contributions to the design, functionality and usability of 3D Slicer.&lt;br /&gt;
&lt;br /&gt;
Major funding for the 3D Slicer software package was provided by the NIH through a number of grants. Additional contributions came from a number of sources, nationally and internationally.&lt;br /&gt;
&lt;br /&gt;
=List of Contributors=&lt;br /&gt;
==People And Their Roles==&lt;br /&gt;
*[http://www.spl.harvard.edu/pages/People/kikinis Ron Kikinis]: Principal Investigator&lt;br /&gt;
*Steve Pieper&lt;br /&gt;
*[http://www.kitware.com/company/team/finet.html Julien Finet]&lt;br /&gt;
*[http://www.kitware.com/company/team/fillion.html Jean-Christophe Fillion-Robin]&lt;br /&gt;
*[http://www.kitware.com/company/team/aylward.html Stephen Aylward]&lt;br /&gt;
*Nicole Aucoin&lt;br /&gt;
*Alex Yarmarkovich&lt;br /&gt;
*Hans Johnson&lt;br /&gt;
*Daniel Haehn&lt;br /&gt;
*Kilian Pohl&lt;br /&gt;
*[http://www.kitware.com/company/team/schroeder.html Will Schroeder]&lt;br /&gt;
*Jim Miller&lt;br /&gt;
*Junichi Tokuda&lt;br /&gt;
*Noby Hata&lt;br /&gt;
*Andrey Fedorov&lt;br /&gt;
*[http://www.spl.harvard.edu/pages/People/spujol Sonia Pujol]&lt;br /&gt;
*[http://www.kitware.com/company/team/pace.html Danielle Pace]&lt;br /&gt;
&lt;br /&gt;
==Groups==&lt;br /&gt;
*[http://www.spl.harvard.edu/ SPL]: Ron Kikinis, Nicole Aucoin, Wendy Plesniak, Demian Wassermann, Isaiah Norton, Sonia Pujol&lt;br /&gt;
*Isomics: Steve Pieper, Alex Yarmarkovich&lt;br /&gt;
*[http://www.kitware.com Kitware]: [mailto:julien.finet@kitware.com Julien Finet], [mailto:jchris.fillionr@kitware.com Jean-Christophe Fillion-Robin], Danielle Pace, Will Schroeder, [mailto:stephen.aylward@kitware.com Stephen Aylward]&lt;br /&gt;
*U Iowa&lt;br /&gt;
*U Penn&lt;br /&gt;
*GE: Jim Miller&lt;br /&gt;
&lt;br /&gt;
==Funding Sources==&lt;br /&gt;
*ARRA supplement to NAC: [http://wiki.na-mic.org/Wiki/index.php/Projects:ARRA:SlicerUI Qt port], [http://wiki.na-mic.org/Wiki/index.php/Projects:ARRA:SlicerEM EM Segmenter], [http://wiki.na-mic.org/Wiki/index.php/Projects:ARRA:miAnnotation Annotations]&lt;br /&gt;
*[http://nac.spl.harvard.edu/ NAC]&lt;br /&gt;
*[http://na-mic.org NA-MIC]&lt;br /&gt;
*[http://ncigt.org NCIGT]&lt;br /&gt;
* 1U01CA151261-01 (PI Fennessy)&lt;br /&gt;
* [http://public.kitware.com/Wiki/NeuralNav  1R01CA138419-01 (PI: Wells and Aylward), NCI academia-industry partnership]&lt;br /&gt;
* “Cognitive and Functional Brain Changes in Preclinical Huntington’s Disease (HD)” (HD-fMRI); NS054893)&lt;br /&gt;
* “Neurobiological Predictors of Huntington's Disease” (PREDICT-HD; NS40068)&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=18899</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=18899"/>
		<updated>2011-01-14T18:07:14Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Module Name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Experimental results from the registration library ===&lt;br /&gt;
&lt;br /&gt;
http://www.na-mic.org/Wiki/index.php/Projects:RegistrationLibrary:RegLib_C02&lt;br /&gt;
&lt;br /&gt;
http://www.na-mic.org/Wiki/index.php/Projects:RegistrationLibrary:RegLib_C14&lt;br /&gt;
&lt;br /&gt;
-- And several more from: &lt;br /&gt;
&lt;br /&gt;
http://www.na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseInventory#BRAIN&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
|-&lt;br /&gt;
|Program description || Uses the Mattes Mutual Registration algorithm to register a three-dimensional volume to a reference volume. Described in 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&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 1: Same Subject: Longitudinal'''''&lt;br /&gt;
&lt;br /&gt;
For this use 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 again available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory as testT1.nii.gz and testT1Longitudinal.nii.gz&lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT1Longitudinal.nii.gz \&lt;br /&gt;
--outputVolume testT1LongRegFixed.nii.gz \&lt;br /&gt;
--outputTransform longToBase.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since these are the same subject and very little has likely changed in the last year we'll use a Rigid registration.  If the registration is poor or there are reasons to expect anatomical changes then additional transforms may be needed, in which case they can be added in a comma separated list, such as &amp;quot;Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
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, as it will make it harder to detect differences between the images.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The registration generally performs better if we include some background in the mask that way the tissue boundary is 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 so a good starting value is 3.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last 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 of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT1Longitudinal.nii.gz \&lt;br /&gt;
--outputVolume testT1LongRegFixed.nii.gz \&lt;br /&gt;
--outputTransform longToBase.xform \&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:LongitudinalCheckerboardPreReg.png|thumb|180px|Longitudinal Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:LogitudinalCheckerboardPostReg.png|thumb|180px|Longitudinal Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 2: Same Subject: MultiModal'''''&lt;br /&gt;
&lt;br /&gt;
For this use case we're registering a T1 scan with a T2 scan collected in the same sesson.  The two images are again available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory as testT1.nii.gz and testT2.nii.gz&lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT2.nii.gz \&lt;br /&gt;
--outputVolume testT2RegT1.nii.gz \&lt;br /&gt;
--outputTransform T2ToT1.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since these are the same subject, same session we'll use a Rigid registration.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are different modalities so we absolutely DO NOT want to use --histogramMatch to match the intensity profiles as this would try to map the T2 intensities into T1 intensities, resulting in an image that was neither, and hence useless.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The registration generally performs better if we include some background in the mask that way the tissue boundary is 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 so a good starting value is 3.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last 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 of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume testT1.nii.gz \&lt;br /&gt;
--movingVolume testT2.nii.gz \&lt;br /&gt;
--outputVolume testT2RegT1.nii.gz \&lt;br /&gt;
--outputTransform T2ToT1.xform \&lt;br /&gt;
--transformType Rigid \&lt;br /&gt;
--initializeTransformMode useCenterOfHeadAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoDilateSize 3 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:T1T2PreRegCheckerboard.png|thumb|180px|Multimodal Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:T1T2RegCheckerboard.png|thumb|180px|Multimodal Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* '''''Use Case 3: Mouse Registration'''''&lt;br /&gt;
&lt;br /&gt;
Here we'll register brains from two different mice together.  The fixed and moving mouse brains used in this example are available in the Slicer3/Applications/CLI/BRAINSTools/BRAINSCommonLib/TestData directory. &lt;br /&gt;
&lt;br /&gt;
First we set the fixed and moving volumes as well as the output transform and output volume names.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--fixedVolume mouseFixed.nii.gz \&lt;br /&gt;
--movingVolume mouseMoving.nii.gz \&lt;br /&gt;
--outputVolume movingRegFixed.nii.gz \&lt;br /&gt;
--outputTransform movingToFixed.xform \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Since the subjects are different we are going to use transforms all the way through BSpline. Again, 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.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The scans are the same modality so we'll use --histogramMatch.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
To start with the best possible initial alignment we use --initializeTransformMode but we are't working with human heads so we can't pick useCenterOfHeadAlign. Instead we pick useMomentsAlign which does a reasonable job of selecting the centers of mass.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--initializeTransformMode useMomentsAlign \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
ROI masks normally improve registration but we haven't generated any so we turn on --maskProcessingMode ROIAUTO.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
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 so a good starting value for mice is 0.9.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--ROIAutoClosingSize 0.9 \&lt;br /&gt;
--ROIAutoDilateSize 0.9 \&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Last 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 of linear.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full command is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BRAINSFit --fixedVolume mouseFixed.nii.gz \&lt;br /&gt;
--movingVolume mouseMoving.nii.gz \&lt;br /&gt;
--outputVolume movingRegFixed.nii.gz \&lt;br /&gt;
--outputTransform movingToFixed.xform \&lt;br /&gt;
--transformType Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline \&lt;br /&gt;
--histogramMatch \&lt;br /&gt;
--initializeTransformMode useMomentsAlign \&lt;br /&gt;
--maskProcessingMode ROIAUTO \&lt;br /&gt;
--ROIAutoClosingSize 0.9 \&lt;br /&gt;
--ROIAutoDilateSize 0.9 \&lt;br /&gt;
--interpolationMode Linear&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:MouseCheckerboardPreRegistration.png|thumb|180px|Mouse Checkerboard Before registration]]&lt;br /&gt;
|  [[Image:MouseCheckerboardPostRegistration.png|thumb|180px|Mouse Checkerboard After registration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [http://svn.slicer.org/Slicer4/trunk/Scripts/SEMToMediaWiki.py python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use'''''&amp;lt;/span&amp;gt;: Parameters that define which registration steps to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Intitialze Transform Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeTransformMode&amp;lt;/span&amp;gt;] : Determine how to initialize the transform center.  GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsAlign assumes that the center of mass of the images represent similar structures.  useCenterOfHeadAlign attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag. ''Default value: Off''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleSkewVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform an Affine registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a BSpline registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume. ''Default value: float''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence ''Default value: 1500''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. ''Default value: 100000''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepLength&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete. ''Default value: 0.005''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern. ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed.  ''Default value: 14,10,12''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer. ''Default value: 0.0''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters,  ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or RigidInPlace.  The RigidInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation. ''Default value: Linear''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform. ''Default value: NOMASK''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions. ''Default value: 0,0,0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile. Do NOT use if registering images from different modailties. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : The number of histogram levels ''Default value: 50''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points ''Default value: 10''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline. ''Default value: ON''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job. ''Default value: AUTO''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Closing Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoClosingSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the hole closing size in mm.  It is rounded up to the nearest whole pixel size in each direction. The default is to use a closing size of 9mm.  For mouse data this value may need to be reset to 0.9 or smaller. ''Default value: 9.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.5''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepLength&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.2''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 ) ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging. ''Default value: 0''&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters'''''&amp;lt;/span&amp;gt;: &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_01&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''DO NOT USE'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02&amp;lt;/span&amp;gt;] : DO NOT USE THIS FLAG ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.=&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Cost Metric'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--costMetric&amp;lt;/span&amp;gt;] : The cost metric to be used during fitting. Defaults to MMI. Options are MMI (Mattes Mutual Information), MSE (Mean Square Error), NC (Normalized Correlation), MC (Match Cardinality for binary images) ''Default value: MMI''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [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.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Slicer3:3.6_Final_Issues&amp;diff=17321</id>
		<title>Slicer3:3.6 Final Issues</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Slicer3:3.6_Final_Issues&amp;diff=17321"/>
		<updated>2010-07-30T02:51:07Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Issues to include in 3.6.1 patch release==&lt;br /&gt;
&lt;br /&gt;
* Fixes for EMSegment command line working with BRAINS (Kilian)&lt;br /&gt;
* VTK GPU Ray Cast flashing (Julien)&lt;br /&gt;
* Import scene does not update 3D viewer (Nicole, Wendy) http://na-mic.org/Mantis/view.php?id=840&lt;br /&gt;
* brackets in filenames (Steve - fixed in trunk, migrate to branch if tests well) http://www.na-mic.org/Bug/view.php?id=851&lt;br /&gt;
* changes to avoid error messages when using single-slice volumes (Steve) - in trunk, need to move to branch&lt;br /&gt;
* Editor rounding issue [http://www.na-mic.org/Bug/view.php?id=932] (Steve) - in trunk, need to move to branch&lt;br /&gt;
* Snapshot issue [http://na-mic.org/Mantis/view.php?id=933] (Alex)&lt;br /&gt;
* CompareView issues [http://na-mic.org/Mantis/view.php?id=927 927], [http://na-mic.org/Mantis/view.php?id=929 929], [http://na-mic.org/Mantis/view.php?id=936 936]&lt;br /&gt;
* CompareView + Crosshairs issue [http://na-mic.org/Mantis/view.php?id=928 928]&lt;br /&gt;
* KWWidgets issue with &amp;quot;%&amp;quot; in file names produced by DICOM browser -- fixed in trunk, need to make sure propagated to 3.6 [http://na-mic.org/Mantis/view.php?id=886 bug 886] (Steve)&lt;br /&gt;
* Diffusion Tensor Glyphs not showing (Demian)&lt;br /&gt;
* Diffusion Tensor Tractography having a strange no-tracking through high FA areas case  (Demian)&lt;br /&gt;
* Cannot change the window/level on color-by-orientation dti volumes (Alexy - may not be included in 3.6.1).&lt;br /&gt;
&lt;br /&gt;
Done (in branches/Slicer-3-6 after June 10):&lt;br /&gt;
* make sure all BRAINS and Registration fixes are in the 3.6 branch (Hans and Jim with help from Dominik)&lt;br /&gt;
* check for duplicate filepaths when saving data (Alex) http://www.na-mic.org/Bug/view.php?id=925&lt;br /&gt;
* tractography seeding issue (Alexy) http://www.na-mic.org/Bug/view.php?id=885: Changed Tracttography/LabelMapSeeding module: 1. added UseIndexSpace option for seeding placement. 2. Also found that IJK indexes used for traversing the label volume were floats. Changed them to doubles that may crate slightly different tracts, but it is less prone to error accumulation (Alex). &lt;br /&gt;
* Added multi-label selection to Tractography/ROISelect module (PNL request for Slicer2 compatibility, Alex)&lt;br /&gt;
* Added more scalar options to Diffusion Tensor Scalar Measurement module (PNL request for Slicer2 compatibility, Alex)&lt;br /&gt;
* [http://www.na-mic.org/Bug/view.php?id=871 fix] for Python programming tutorial (Steve, Luca)&lt;br /&gt;
* Fixes for color table preview icons showing up in node selectors (Wendy and Nicole)&lt;br /&gt;
** [http://viewvc.slicer.org/viewcvs.cgi?rev=13771&amp;amp;view=rev svn 1377]&lt;br /&gt;
* DicomToNrrd issues reported by AlexZ and Sylvain (Xiaodong)&lt;br /&gt;
* Crosshair traking modes (Jim); also see [http://na-mic.org/Mantis/view.php?id=861 bug #861]&lt;br /&gt;
* Wizard page transition error in ProstateNav. The issue was fixed by Haiying.&lt;br /&gt;
* OpenIGTLink reslice performance (Junichi) (fixed by Steve)&lt;br /&gt;
* Updated meshing module (Curt) - checked in trunk for [http://www.na-mic.org/Wiki/index.php/Slicer3:IAFEMesh_TutorialContestSummer2010|tutorial contest]; needs merge to branch if all is well.&lt;br /&gt;
* &amp;quot;Change island&amp;quot; effect of Editor is not functioning when the Scope is set to &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==3.6 Release issues==&lt;br /&gt;
Final punch list for [[Slicer3:3.6Release|slicer 3.6 release]]:&lt;br /&gt;
&lt;br /&gt;
'''Finalized June 10 for 3.6 binaries and [[Announcements:Slicer3.6]]''' &lt;br /&gt;
&lt;br /&gt;
*VTK GPU ray-cast clipping issue&lt;br /&gt;
**bug fix:[[http://na-mic.org/Mantis/view.php?id=800 Non axis aligned volumes]]&lt;br /&gt;
**bug fix:[[http://na-mic.org/Mantis/view.php?id=798#c1780 ROI on Non axis aligned volumes]]&lt;br /&gt;
**90% of the flickering when the camera is inside the volume is removed&lt;br /&gt;
*compare view + crosshair issue when loading a scene, the crosshair does not appear in all viewers until the slice location is changed, (Jim)&lt;br /&gt;
&lt;br /&gt;
*Picking NCI GPU Raycasting on machine that doesn't support it causes lockup. Not able to reproduce the problem (Yanling).&lt;br /&gt;
&lt;br /&gt;
Done:&lt;br /&gt;
* Remove unused color and glyph options from fiber bundle display (Alex)&lt;br /&gt;
* fiducial behavior&lt;br /&gt;
* fiducial behavior/3D viewer behavior: (Steve, Nicole, Wendy met Jun 7)&lt;br /&gt;
** saw one example of persistent place mode being stolen by pick mode. I think this has to do with inappropriate initialization of modes. It is possible for pick mode to take over until transient-pick mode is explicitly chosen. (FIXED)&lt;br /&gt;
** tractography updates not happening during drag - fixes checked into SlicerVTK and Slicer3 branch&lt;br /&gt;
** tractography updates slow when drag stops (Steve confirmed this was due to update only happening when mouse was moved after button released - made it seem extra slow)&lt;br /&gt;
**widget issues (Nicole putting fixes in [http://github.com/pieper/CTK SlicerVTK])&lt;br /&gt;
*making sure mouse-modes work same in 3D/2D (Wendy and Nicole) Let's call it DONE!&lt;br /&gt;
** done for 2d, Andras has tested it and says it's fine&lt;br /&gt;
*editor volume merge feature clarification (Steve meeting Sonia June 2, fixes committed June 3)&lt;br /&gt;
*getting BRAINS tests to pass (Hans is working on it)&lt;br /&gt;
*tracking down what is making that crash on Mac OsX when several PET volumes are loaded into Slicer (Wendy).&lt;br /&gt;
* are there extra pick operations going on?  There seems to be a delay after clicking mouse before camera begins to rotate when large models are present in scene. ''could not replicate - tried 2.5 million triangle model on slicer and paraview and performance is the same''&lt;br /&gt;
* should picking of fiducials in 3D be disabled unless user explicitly chooses 'pick mode'? ''Not a good idea to change behavior at this point''&lt;br /&gt;
** should parallel behavior be implemented in 2D for consistency? Stevie votes no, Wendy votes yes. ''Not a good idea to change behavior at this point''&lt;br /&gt;
* roundtrip to xnat desktop --OK: confirmed that Ron was using dirty files in cache; checking 'always re-download' in the Cache and DataI/O Manager GUI caused fresh download and successful load into slicer. Sometimes, even when you delete cached files thru the GUI, some applicaiton is holding on to files still there and they don't get cleared out. I'm adding a little code to check for remaining files after a ClearCache() is called; if so, we'll warn user that not all files were removed, and to select 'always re-download' to ensure proper data loading.(Wendy)&lt;br /&gt;
* view control gui: (Wendy) this guy isn't always updating anymore. He may be a casualty of multiple view nodes in the scene. He was a casualty but is fixed now! &lt;br /&gt;
*The diffusion tensor estimation module is using defaults that are not good and partially incorrect. Can the defaults be as follows:&lt;br /&gt;
**for Output DTI volume: DTI Volume&lt;br /&gt;
**for Output Baseline Volume: Baseline DTI Volume&lt;br /&gt;
**for Otsu Threshold Mask: Otsu Threshold Label Volume&lt;br /&gt;
*new default color table (Nicole and Mike)&lt;br /&gt;
** Mike working on creating a LUT from &amp;lt;strike&amp;gt;[[CCA:Atlases:Florins_2010_Hierarchy|this hierarchy]]&amp;lt;/strike&amp;gt; [[CCA:Atlases:Florins_2010_Hierarchy_Short|this subset]], by Jun 7&lt;br /&gt;
** Steve and Nicole to meet June 9 to integrate default editor color table&lt;br /&gt;
** Jun 10: checked in new color files, one from [[Slicer3:2010_GenericAnatomyColors|GenericAnatomyColors]], and one based on that but with names set to integer values and the color for 255 changed to blue. Wendy making new drop down menu icons.&lt;br /&gt;
*finishing up the DICOM file copy on remote upload, also close (Wendy) (DONE)&lt;br /&gt;
&lt;br /&gt;
Issues that cannot be fixed (or aren't crucial to fix) should be listed in [[Release-notes-3.6| the slicer 3.6 release notes]].&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=17064</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=17064"/>
		<updated>2010-06-22T19:29:21Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* GTRACT Programs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
 % DicomToNrrd &amp;lt;DICOM-Directory&amp;gt; &amp;lt;OutputDirectory&amp;gt; &amp;lt;OutputFilename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
This documentation is mostly generated using a script from http://svn.slicer.org/Slicer3/trunk/Scripts/SEMToMediaWiki.py&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python SEMToMediaWiki.py ${progname}.xml &amp;gt; ${progname}.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[compareTractInclusion|compareTractInclusion Documentation]]&lt;br /&gt;
* [[extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomyBspline|gtractCoRegAnatomyBspline Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomyPrimary|gtractCoRegAnatomyPrimary Documentation]]&lt;br /&gt;
* [[gtractCoRegAnatomyRigid|gtractCoRegAnatomyRigid Documentation]]&lt;br /&gt;
* [[gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[gtractCoregBvaluesPrimary|gtractCoregBvaluesPrimary Documentation]]&lt;br /&gt;
* [[gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
* [[gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[gtractFreeTracking|gtractFreeTracking Documentation]]&lt;br /&gt;
* [[gtractGraphSearchTracking|gtractGraphSearchTracking Documentation]]&lt;br /&gt;
* [[gtractGuidedTracking|gtractGuidedTracking Documentation]]&lt;br /&gt;
* [[gtractImageConformity|gtractImageConformity Documentation]]&lt;br /&gt;
* [[gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[gtractInvertDeformationField|gtractInvertDeformationField Documentation]]&lt;br /&gt;
* [[gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[gtractResampleFibers|gtractResampleFibers Documentation]]&lt;br /&gt;
* [[gtractStreamlineTracking|gtractStreamlineTracking Documentation]]&lt;br /&gt;
* [[gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[gtractTransformToDeformationField|gtractTransformToDeformationField Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0&lt;br /&gt;
&lt;br /&gt;
A complete listing of parameters can be found here, [[gtractCoregBvalues]], or can be obtained on the command line using &lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --help&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap Version 3]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation Version 3]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomyRigid Version 3]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomyRigid --inputVolume 0226770_DWI_coreg.nhdr \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputRigidTransform ACPC_rigid.xfm --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomyBspline Version 3]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomyBspline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform Version 3]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBspline Version 3]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage Version 3]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0 Version 3]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy Version 3]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Free_Tracking Free Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Streamlines_Tracking Streamlines Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Graph_Search_Tracking Graph Search Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Guided_Tracking Guided Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Fast_Marching_Tracking Fast Marching Tracking]&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low ansiotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFreeTracking Version 3]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguements for [[gtractStreamlineTracking Version 3]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambigous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambigous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the seconadary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline alogrithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguements for [[gtractGraphSearchTracking Version 3]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber Version 3]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractGuidedTracking Version 3]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractGuidedTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching version 3]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking Version 3]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=17063</id>
		<title>GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=GTRACT_V4&amp;diff=17063"/>
		<updated>2010-06-22T18:59:54Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: Created page with '== GTRACT Overview ==  This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
 % DicomToNrrd &amp;lt;DICOM-Directory&amp;gt; &amp;lt;OutputDirectory&amp;gt; &amp;lt;OutputFilename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
This documentation is mostly generated using a script from http://svn.slicer.org/Slicer3/trunk/Scripts/SEMToMediaWiki.py&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python SEMToMediaWiki.py ${progname}.xml &amp;gt; ${progname}.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[vmagnotta:compareTractInclusion|compareTractInclusion Documentation]]&lt;br /&gt;
* [[vmagnotta:extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCoRegAnatomyBspline|gtractCoRegAnatomyBspline Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCoRegAnatomyPrimary|gtractCoRegAnatomyPrimary Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCoRegAnatomyRigid|gtractCoRegAnatomyRigid Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCoregBvaluesPrimary|gtractCoregBvaluesPrimary Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractFreeTracking|gtractFreeTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractGraphSearchTracking|gtractGraphSearchTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractGuidedTracking|gtractGuidedTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractImageConformity|gtractImageConformity Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractInvertDeformationField|gtractInvertDeformationField Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractResampleFibers|gtractResampleFibers Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractStreamlineTracking|gtractStreamlineTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractTransformToDeformationField|gtractTransformToDeformationField Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0&lt;br /&gt;
&lt;br /&gt;
A complete listing of parameters can be found here, [[gtractCoregBvalues]], or can be obtained on the command line using &lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --help&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap Version 3]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation Version 3]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomyRigid Version 3]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomyRigid --inputVolume 0226770_DWI_coreg.nhdr \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputRigidTransform ACPC_rigid.xfm --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomyBspline Version 3]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomyBspline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform Version 3]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBspline Version 3]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage Version 3]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0 Version 3]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy Version 3]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Free_Tracking Free Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Streamlines_Tracking Streamlines Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Graph_Search_Tracking Graph Search Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Guided_Tracking Guided Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Fast_Marching_Tracking Fast Marching Tracking]&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low ansiotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFreeTracking Version 3]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguements for [[gtractStreamlineTracking Version 3]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambigous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambigous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the seconadary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline alogrithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguements for [[gtractGraphSearchTracking Version 3]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber Version 3]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractGuidedTracking Version 3]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractGuidedTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching version 3]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking Version 3]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:GTRACT&amp;diff=17062</id>
		<title>Modules:GTRACT</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:GTRACT&amp;diff=17062"/>
		<updated>2010-06-22T18:59:45Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* GTRACT v4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT v4 ==&lt;br /&gt;
&lt;br /&gt;
[[GTRACT_V4|Documentation for GTRACT version 4]]&lt;br /&gt;
&lt;br /&gt;
== GTRACT v3.0.0 ==&lt;br /&gt;
Previous documentation for GTRACT Version 3 can be found at the following Website:&lt;br /&gt;
https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Vmagnotta:GTRACT_V4&amp;diff=17061</id>
		<title>Vmagnotta:GTRACT V4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Vmagnotta:GTRACT_V4&amp;diff=17061"/>
		<updated>2010-06-22T18:58:50Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: Created page with '== GTRACT Overview ==  This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT Overview ==&lt;br /&gt;
&lt;br /&gt;
This is a manual for the GTRACT program.  This program suite now incorporates a full DTI data processing pipeline. In this version of the tools, all of the functional units exist as command line programs that integrate with Slicer3 using the Execution model framework. The standard format for the DTI data in this version is the NRRD format. Anatomical images and label maps can be in any format supported by ITK.  The program support several version of fiber tracking including:&lt;br /&gt;
&lt;br /&gt;
# Free tracking - Basic streamlines with only a starting region&lt;br /&gt;
# Streamlines - Streamlines tracking between two regions of interest&lt;br /&gt;
# Graph Search - Modified streamlines that tries multiple solutions in low anisotropy regions&lt;br /&gt;
# Guided Tracking - Uses an initial guess to the fiber track to guide the tracking&lt;br /&gt;
# Fast Marching - Method based on the method proposed by Geoffrey Parker&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1. The software is hosted by the Neuroimaging Informatics Tools and Resources Clearinghouse [http://www.nitrc.org/projects/vmagnotta/ (NITRC)].&lt;br /&gt;
&lt;br /&gt;
== Installing GTRACT ==&lt;br /&gt;
The easiest way to install GTRACT is to obtain pre-compiled binaries from the NITRC website. You should be able to download and install these on most platforms. Currently this is just an archive file for the various platforms that can be unpacked wherever the user has write access. &lt;br /&gt;
&lt;br /&gt;
===Installing Into Slicer3===&lt;br /&gt;
The command line modules do support the Slicer3 execution model and could be placed within the Slicer3 build and will be become active when the user starts Slicer3. The modules are installed under the '''BRAINS-&amp;gt;GTRACT''' menu in the Slicer3 Module tree. More details will be forthcoming on this. Copyright information for GTRACT can be obtained [https://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt here].&lt;br /&gt;
&lt;br /&gt;
===Building GTRACT===&lt;br /&gt;
GTRACT depends on only ITK and VTK. It also requires CMake for building. Most recent versions of VTK and ITK should work. Presently GTRACT requires using CMake version 2.8 or higher for the builds.&lt;br /&gt;
&lt;br /&gt;
== Conversion from DICOM to NRRD Format ==&lt;br /&gt;
The program for the conversion of DICOM images into Gordan Kindlmann's [http://teem.sourceforge.net/nrrd/ NRRD format] is supported by the Slicer3 DicomToNrrd. This is included within the GTRACT package for convenience. This program should handle most images from GE and Siemens scanners including Mosaic format images. For Siemens scanners, software version above VB13 should be supported. We would like to thank Xiaodong Tao for his great work on this tool. This program should read the diffusion directions from the DICOM header.&lt;br /&gt;
&lt;br /&gt;
 % DicomToNrrd &amp;lt;DICOM-Directory&amp;gt; &amp;lt;OutputDirectory&amp;gt; &amp;lt;OutputFilename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will contain the Diffusion weighted images in a vector format. The tools within the GTRACT analysis pipeline now expect the images in NRRD format.&lt;br /&gt;
&lt;br /&gt;
== GTRACT Programs ==&lt;br /&gt;
This documentation is mostly generated using a script from http://svn.slicer.org/Slicer3/trunk/Scripts/SEMToMediaWiki.py&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python SEMToMediaWiki.py ${progname}.xml &amp;gt; ${progname}.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[vmagnotta:compareTractInclusion|compareTractInclusion Documentation]]&lt;br /&gt;
* [[vmagnotta:extractNrrdVectorIndex|extractNrrdVectorIndex Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractAnisotropyMap|gtractAnisotropyMap Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractAverageBvalues|gtractAverageBvalues Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractClipAnisotropy|gtractClipAnisotropy Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCoRegAnatomyBspline|gtractCoRegAnatomyBspline Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCoRegAnatomyPrimary|gtractCoRegAnatomyPrimary Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCoRegAnatomyRigid|gtractCoRegAnatomyRigid Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractConcatDwi|gtractConcatDwi Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCopyImageOrientation|gtractCopyImageOrientation Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCoregBvaluesPrimary|gtractCoregBvaluesPrimary Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCostFastMarching|gtractCostFastMarching Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractCreateGuideFiber|gtractCreateGuideFiber Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractFastMarchingTracking|gtractFastMarchingTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractFiberTracking|gtractFiberTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractFreeTracking|gtractFreeTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractGraphSearchTracking|gtractGraphSearchTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractGuidedTracking|gtractGuidedTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractImageConformity|gtractImageConformity Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractInvertBSplineTransform|gtractInvertBSplineTransform Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractInvertDeformationField|gtractInvertDeformationField Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractInvertRigidTransform|gtractInvertRigidTransform Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractResampleAnisotropy|gtractResampleAnisotropy Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractResampleB0|gtractResampleB0 Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractResampleCodeImage|gtractResampleCodeImage Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractResampleFibers|gtractResampleFibers Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractStreamlineTracking|gtractStreamlineTracking Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractTensor|gtractTensor Documentation]]&lt;br /&gt;
* [[vmagnotta:gtractTransformToDeformationField|gtractTransformToDeformationField Documentation]]&lt;br /&gt;
&lt;br /&gt;
== DTI Image Co-Registration ==&lt;br /&gt;
Once the images are in NRRD format the next step in the analysis pipeline is the elimination of motion and eddy current artifacts between the diffusion weighted images. The program for this step of the analysis is '''gtractCoregBvalues'''. This program will support registration between two diffusion series in the case where you would like to average this data across runs. It also would allow for co-regsitration with a T2 weighted image or field map in the same plane as the DTI data.&lt;br /&gt;
&lt;br /&gt;
A mutual information metric cost function is used for the registration because of the differences in the signal intensity as a result of the diffusion gradients. The fixed image for the registration should be a b0 image. The user has the option to perform a rigid or a full affine registration. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. This is specified with the '''eddyCurrentCorrection''' option. In general the standard parameters work fairly well for a rigid registration, and you probably just need to specify the images for registration. When the eddyCurrent Correction is specified, then we have had to adjusrt the '''relaxationFactor''' and '''maximumStepSize''' parameters. We typically use values of around 0.25 for the relaxation factor and 0.1 for the maximum step size when this option is turned on.&lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --fixedImageVolume baseImage.nhdr --movingImageVolume baseImage.nhdr --fixedImageIndex 0&lt;br /&gt;
&lt;br /&gt;
A complete listing of parameters can be found here, [[gtractCoregBvalues]], or can be obtained on the command line using &lt;br /&gt;
&lt;br /&gt;
 % gtractCoregBvalues --help&lt;br /&gt;
&lt;br /&gt;
== Tensor Image Calculation ==&lt;br /&gt;
This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied and the diffusion directions. The apparent diffusion (ADC) for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (i.e. voxel intensities) to the Stejskal-Tanner equation:&lt;br /&gt;
&lt;br /&gt;
   S&amp;lt;SUB&amp;gt;b&amp;lt;/SUB&amp;gt; = S&amp;lt;SUB&amp;gt;0&amp;lt;/SUB&amp;gt; exp&amp;lt;SUP&amp;gt;-b ADC&amp;lt;/SUP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If at least six orientations are used, then the diffusion tensor can be computed. The measured ADC values is related to the diffusion tensor elements via the following equation:&lt;br /&gt;
&lt;br /&gt;
 ADC = M D&lt;br /&gt;
&lt;br /&gt;
where ADC is a vector of the measured apparent diffusion coefficients, M is the matrix describing the diffusion directions applied, and D is a vector of the diffusion tensor elements. This can be solved using standard matrix operations&lt;br /&gt;
&lt;br /&gt;
 D = M&amp;lt;SUP&amp;gt;-1&amp;lt;/SUP&amp;gt; ADC&lt;br /&gt;
&lt;br /&gt;
In this step we are solving for the diffusion tensor which contains size elements (D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;). These can then be used to define the diffusion tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;xx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;| = D&lt;br /&gt;
 |D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt; D&amp;lt;SUB&amp;gt;zz&amp;lt;/SUB&amp;gt;|&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This is a symmetric matrix therefore D&amp;lt;SUB&amp;gt;xy&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;yx&amp;lt;/SUB&amp;gt;, D&amp;lt;SUB&amp;gt;xz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zx&amp;lt;/SUB&amp;gt;, and D&amp;lt;SUB&amp;gt;yz&amp;lt;/SUB&amp;gt;=D&amp;lt;SUB&amp;gt;zy&amp;lt;/SUB&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program [[gtractTensor]] is responsible for the estimation of the Tensor. The program uses itk::DiffusionTensor3DReconstructionImageFilter for this step. There are several options for the analysis that can be tuned by the user.&lt;br /&gt;
&lt;br /&gt;
* '''Background threshold''' - This sets a threshold used on the b=0 image to remove background voxels from the processing. Typically a value around 100 works well for Siemens DTI images. We have found that 500 works better for GE datasets. Check your data particularly in the globus pallidus to make sure that brain tissue is not being eliminated with this threshold.&lt;br /&gt;
&lt;br /&gt;
* '''Median filter''' - If the filter is enabled, a median filter will be applied to the data. The x, y, and z values specify the size of the median filter in voxels. &lt;br /&gt;
&lt;br /&gt;
* '''Isotropic Resampling''' - If this option is enabled,  the data will be resample to isotropic resolution specified. This is recommended if fiber tracking is to be performed.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractTensor --inputVolume Series0003_coreg.nhdr --outputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
  --useMedianFilter --medianFilterSize 1,1,1 --backgroundSuppressingThreshold&lt;br /&gt;
&lt;br /&gt;
--[[User:Admin|Admin]] 10:44, 2 July 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' We have recently made changes to this program top make it more flexible. There is now a ''--ignoreIndex'' option that allows the user to remove specific gradient directions if artifacts exist in a particular gradient direction. A DTI volume can now have multiple B0 and gradient direction images. These are now handled properly without requiring averaging of the diffusion weighted images. Averaging of the B0 image is done internally in this program.&lt;br /&gt;
&lt;br /&gt;
== Compute Anisotropy Images ==&lt;br /&gt;
Anistropy mapping can be used to generate the following diffusion tensor indices:&lt;br /&gt;
* Fractional Anistroy (FA)&lt;br /&gt;
* Relative Anistroy (RA)&lt;br /&gt;
* Volume Ratio (VR)&lt;br /&gt;
* Lattice Index (LI)&lt;br /&gt;
* Coherence Index (CI)&lt;br /&gt;
* Mean Diffusivity (ADC)&lt;br /&gt;
* Axial Diffusivity (AD)&lt;br /&gt;
* Radial Diffusivity (RD)&lt;br /&gt;
&lt;br /&gt;
Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead the Tensor representation is included as point data allowing all of these metric to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The command line parameters are defined here [[gtractAnisotropyMap Version 3]].&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractAnisotropyMap --inputVolume Series0003_Tensor.nhdr \&lt;br /&gt;
   --anisotropyType FA --outputVolume Series0003_FA.nhdr&lt;br /&gt;
&lt;br /&gt;
== Alignment with Anatomical Image ==&lt;br /&gt;
The two registration methods supported for alignment with Anatomical images, Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. It is recommended that for image co-registration with the B-Spline Transform that the skull stripped (i.e. image containing only brain with skull removed) image be used. &lt;br /&gt;
&lt;br /&gt;
===Copy Reference Image Orientation===&lt;br /&gt;
Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs. The program '''gtractCopyImageOrientation''' is used for this step. The complete command line arguements for [[gtractCopyImageOrientation Version 3]] can be generated using the '--help' flag.&lt;br /&gt;
 &lt;br /&gt;
 % gtractCopyImageOrientation --inputVolume T1_ACPC_clip.nii.gz \&lt;br /&gt;
      --inputReferenceVolume  DWI_coreg.nhdr --outputVolume T1_ACPC_Axial.nhdr&lt;br /&gt;
&lt;br /&gt;
===Anatomical Rigid===&lt;br /&gt;
The rigid registration uses a mutual information metric to align the b0 image with the anatomical image. A reasonable set of parameters is specified as the default set of parameters. These were initially tested on a data from both a Siemens 1.5T and 3.0T scanners. Here are the complete set of parameters for [[gtractCoRegAnatomyRigid Version 3]]&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractCoRegAnatomyRigid --inputVolume 0226770_DWI_coreg.nhdr \&lt;br /&gt;
      --vectorIndex 0 --inputAnatomicalVolume 30670508_T1_ACPC_Axial.nhdr \&lt;br /&gt;
      --outputRigidTransform ACPC_rigid.xfm --numberOfIterations 1000&lt;br /&gt;
&lt;br /&gt;
It is recommended that the rigid registration be run before the B-Spline nonlinear registration is run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:T1-Scan.gif|T1 Weighted Volume|300px|thumb|T1 Volume]] &lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted with B0 image overlay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Anatomical B-Spline===&lt;br /&gt;
The B-SPline registration places a low dimensional grid in the image which is deformed. The B-Spline registratiuon works best if the anatomical image has been skull stripped and a rigid registration is used as the staring point for the registration. The user can specify the number of control points to be used in the registration and the maximum distance that each control point should move. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. A bulk transform can be applied to the B-Spline transform to initialize the transform. This should be the rigid transform generated from the previous step for the optimal results. The program '''gtractCoRegAnatomyBspline''' performs this registration step and a detailed list of parameters can nbe found here, [[gtractCoRegAnatomyBspline Version 3]]&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 % gtractCoRegAnatomyBspline&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Rigid.gif|300px|thumb|T1 Weighted Volume with B0 image (Rigid Registration) overlay]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:DTI-Bspline.gif|300px|thumb|T1 Weighted Volume with B0 image (B-Spline Registration) overlay.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Improved registration especially at the anterior portion of the corpus callosum&lt;br /&gt;
&lt;br /&gt;
===Invert Rigid Transform===&lt;br /&gt;
The program '''gtractInvertRigidTransform''' is used to invert rigid transforms. Typically this is used to map images in anatomical space to the diffusion weighted image space. This is useful for transforming labels defined on the anatomical image into the space of the diffusion weighted images to be used for fiber tracking. Complete parameters for [[gtractInvertRigidTransform Version 3]] are available using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractInvertRigidTransform --inputTransform ACPC_rigid.xfm \&lt;br /&gt;
                               --outputTransform ACPC_Inverse_Rigid.xfm&lt;br /&gt;
&lt;br /&gt;
===Invert B-Spline===&lt;br /&gt;
Since the B-Spline transform cannot be directly inverted, we have implemented a thin plate spline approximation to its inverse. This can be created yusing the gtractInvertBspline. The X, Y and Z grid specifiy the grid utilized to sample the B-Spline transform. The parameters for [[gtractInvertBspline Version 3]] can be obtained using the '-help' option. The inverse needs to be computed to map fiber tracts from the DTI space to the anatomical image and to map regions of interest from the anatomical image onto the diffusion weighted images using this non-linear transform that accounts in part for susecptility artifcats.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
 % gtractInvertBSplineTransform&lt;br /&gt;
&lt;br /&gt;
===Resampling Images===&lt;br /&gt;
Three programs have been written to resample the various types of images that may be encountered in diffusion tensor analysis. All of the programs accept only ITK transforms and in particular '''Versor Rigid'' or '''B-Spline''' transforms that are described above. &lt;br /&gt;
&lt;br /&gt;
* [[gtractResampleCodeImage Version 3]] - Resamples a mask or label - Image pixel type is signed short and neareast neigbor interpolation is used&lt;br /&gt;
* [[gtractResampleB0 Version 3]] - Resamples the B0 image - Image pixel type is signed short and linear interpolation is used&lt;br /&gt;
* [[gtractResampleAnisotropy Version 3]] - Resamples an anisotropy map - Image pixel type is float and linear interpolation is used&lt;br /&gt;
&lt;br /&gt;
When running these programs the user must also specify a template image that will be used to define the origin, orientation, spacing and size of the resampled image.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractResampleCodeImage --inputTransform ACPC_Inverse_Rigid.xfm -\&lt;br /&gt;
    -transformType Rigid --inputCodeVolume Thal_axial.nhdr \&lt;br /&gt;
    --inputReferenceVolume DWI_coreg.nhdr --outputVolume Thal_DWI.nhdr&lt;br /&gt;
&lt;br /&gt;
You may want to save the aligned B0 image after each of the co-registration steps with the anatomical image to check the registration quality with another tool such as [http://www.nitrc.org/projects/brains/ BRAINS] or [http://www.slicer.org Slicer].&lt;br /&gt;
&lt;br /&gt;
== Fiber Tracking ==&lt;br /&gt;
&lt;br /&gt;
Once an isotropy image, a tensor image, and a spatial object have either been created and loaded fiber tracking can take place. Selecting the '''Tracking''' tab will allow the user to specify the type of tracking to be performed. Currently the GTRACT tool supports a number of fiber tracking methods. These include:&lt;br /&gt;
&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Free_Tracking Free Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Streamlines_Tracking Streamlines Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Graph_Search_Tracking Graph Search Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Guided_Tracking Guided Tracking]&lt;br /&gt;
# [https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3#Fast_Marching_Tracking Fast Marching Tracking]&lt;br /&gt;
&lt;br /&gt;
The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). Currently, Slicer3 only accepts the old .vtk file format. The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images.&lt;br /&gt;
&lt;br /&gt;
===Free Tracking===&lt;br /&gt;
The Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low ansiotropy, or large curvature. This is a great way to explore your data, but the tools to appropriately edit these down to a fiber tract of interest do not yet exist. The user should explore using the other approaches described below once they have performed an initial review of their data. &lt;br /&gt;
A complete set of parameters for [[gtractFreeTracking Version 3]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFreeTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
    --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
    --inputStartingSeedsLabelMapVolume Thal_DWI.nhdr \&lt;br /&gt;
    --startingSeedsLabel 1 --seedThreshold 0.25 \&lt;br /&gt;
    --curvatureThreshold 60 --outputTract freeTracking.vtk&lt;br /&gt;
&lt;br /&gt;
===Streamline Tracking===&lt;br /&gt;
The streamlines algorithm is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters:&lt;br /&gt;
&lt;br /&gt;
* '''Tracking Threshold''': Anistropy values of the next point along the path&lt;br /&gt;
* '''Curvature''': Angle of the  next tracking direction relative to the current path direction&lt;br /&gt;
* '''Max Length''': Length of the track in voxels&lt;br /&gt;
&lt;br /&gt;
Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. ([http://www3.interscience.wiley.com/cgi-bin/abstract/103525670/ABSTRACT?CRETRY=1&amp;amp;SRETRY=0 Human Brain Mapping 18:306-321, 2003]) has been instrumented. This can be enabled using the  '''--useTend''' option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the '''--tendF''' and '''--tendG''' options.&lt;br /&gt;
&lt;br /&gt;
v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; = fe&amp;lt;SUB&amp;gt;1&amp;lt;/SUB&amp;gt; + (1-f) * ((1-g)v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;+gD &amp;amp;#183; v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;out&amp;lt;/SUB&amp;gt; is the outgoing vector direction&lt;br /&gt;
*v&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the incoming vector direction defined in the previous step&lt;br /&gt;
*e&amp;lt;SUB&amp;gt;in&amp;lt;/SUB&amp;gt; is the primary eigenvector direction&lt;br /&gt;
*D is the diffusion Tensor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete set of command line arguements for [[gtractStreamlineTracking Version 3]] are available with the '--help' option at the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractStreamlineTracking&lt;br /&gt;
&lt;br /&gt;
===Graph Search Tracking===&lt;br /&gt;
The Graph Serach tracking is the first step in the full GTRACT algorithm developed by Cheng et al. ([http://www.sciencedirect.com/science?_ob=ArticleURL&amp;amp;_udi=B6WNP-4JVTCDN-1&amp;amp;_user=440026&amp;amp;_rdoc=1&amp;amp;_fmt=&amp;amp;_orig=search&amp;amp;_sort=d&amp;amp;view=c&amp;amp;_acct=C000020939&amp;amp;_version=1&amp;amp;_urlVersion=0&amp;amp;_userid=440026&amp;amp;md5=a58d1d1ffaf9741f2d95aa294e017b17 NeuroImage 31(3): 1075-1085, 2006]). for finding the tracks in a tensor image. This method was developed to&lt;br /&gt;
generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambigous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambigous tracking regions are defined based on two criteria: &lt;br /&gt;
&lt;br /&gt;
*'''Branching AI Threshold''': Anistropy values below this value and above the tracking threshold&lt;br /&gt;
* '''Curvature Major Eigen''': Angles of the primary eigenvector direction and the current tracking direction &lt;br /&gt;
&lt;br /&gt;
In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the seconadary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the '''Random Walk''' option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the '''Branch/Guide Angle''' parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. &lt;br /&gt;
&lt;br /&gt;
The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline alogrithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. A complete set of command line arguements for [[gtractGraphSearchTracking Version 3]] can be obtained using the '--help' option from the command line.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractGraphSearchTracking&lt;br /&gt;
&lt;br /&gt;
===Guided Tracking===&lt;br /&gt;
The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program '''gtractCreateGuideFiber''' can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). The complete set of parameters for [[gtractCreateGuideFiber Version 3]] can be obtained using the '--help' option.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractCreateGuideFiber --inputFiber graph.vtk --outputFiber guide.vtk --numberOfPoints 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The program [[gtractGuidedTracking Version 3]] implements this algorithm. The user must specify the guide fiber when running this program. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 %  gtractGuidedTracking&lt;br /&gt;
&lt;br /&gt;
===Fast Marching Tracking===&lt;br /&gt;
&lt;br /&gt;
This algorithm implements a fast marching fiber tracking algorithm to identify fiber tracts  from a tensor image. This&lt;br /&gt;
algorithm is based on the work by G. Parker et al. ([http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?isnumber=21763&amp;amp;arnumber=1009386&amp;amp;count=12&amp;amp;index=8 IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002]) An additional&lt;br /&gt;
feature of this version is the inclusion of anisotropy in the cost function calculation. The user has the ability to weight the contribution of the anisotropy weight. &lt;br /&gt;
&lt;br /&gt;
This algorithm is broken into two parts. The first phase of the algorithm generates a cost image. This starts with a seed region specified by the user. The cost of the path tracking from the seed region to every voxel in the brain is computed. The cost is based on the direction of the front, the primary eigenvector direction, and the anisotropy value. The user can adjust the weight of the anisotropy value using the '--anisotropyWeight' flag. The program [[gtractCostFastMarching version 3]] is responsible for the generation of the cost image. This may take several minutes to generate and increases with the size of the seed region. Currently, both a cost and spped image are generated. The speed image is not used in the fiber tracking phase and will become an optional parameter in future releases. Currently, it is a required parameter. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractCostFastMarching --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seeds.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --outputCostVolume cost.nhdr \&lt;br /&gt;
     --outputSpeedVolume speed.nhdr --anisotropyWeight 0.5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the cost image is generated, the user can then generate tracts between the any region of the brain and the seed region specified in the previous step. Fiber tracking is fairly quick and uses a gradient descent solution from the defined regions  back to the seed points specified in '''gtractCostFastMarching'''. The parameters for [[gtractFastMarchingTracking Version 3]] can be obtained using the '-help' option from the command line. The resulting paths can be constrained using the anisotropy threshold and the number of iterations. This will help to eliminate unrealistic fiber tracts. &lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
 % gtractFastMarchingTracking --inputTensorVolume Tensor.nhdr \&lt;br /&gt;
     --inputAnisotropyVolume FA.nhdr \&lt;br /&gt;
     --inputStartingSeedsLabelMapVolume seedsEnd.nhdr \&lt;br /&gt;
     --startingSeedsLabel 1 --inputCostVolume cost.nhdr \&lt;br /&gt;
     --seedThreshold 0.3 --trackingThreshold 0.2 \&lt;br /&gt;
     --outputTract fastMarching.vtk&lt;br /&gt;
&lt;br /&gt;
==Visualizing Fiber Tracts==&lt;br /&gt;
The resulting fiber tracts can be loaded into [http://www.Slicer.org Slicer3] or [http://www.paraview.org Paraview]. After starting Slicer3, the loading of fiber tracts can be found under the '''Tractography-&amp;gt;DisplayLoadSave''' module. Selecting this module will bring up the interface to load the fiber tracts. Select the '''Load Tractography''' Button and select the fiber tract of interest. The user can also select the type of glyph to be use for display, including, lines, tubes, or ellipsoids. The fiber tracts will be visible in the 3D view and can be overlaid on the image data as well.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; | [[Image:Slicer3-Display-Tracks.jpg|thumb|300px|Slicer3 DisplayLoadSave Tab]]&lt;br /&gt;
| style=&amp;quot;width:50%&amp;quot; |&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mapping Fiber Tracts ==&lt;br /&gt;
&lt;br /&gt;
== Data Analysis ==&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:GTRACT&amp;diff=17060</id>
		<title>Modules:GTRACT</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:GTRACT&amp;diff=17060"/>
		<updated>2010-06-22T18:58:03Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: GTRACT&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== GTRACT v4 ==&lt;br /&gt;
&lt;br /&gt;
[[vmagnotta:GTRACT_V4|Documentation for GTRACT version 4]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GTRACT v3.0.0 ==&lt;br /&gt;
Previous documentation for GTRACT Version 3 can be found at the following Website:&lt;br /&gt;
https://mri.radiology.uiowa.edu/mediawiki/index.php/GTRACT_Software_-_Version_3&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSResample.png&amp;diff=16842</id>
		<title>File:BRAINSResample.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSResample.png&amp;diff=16842"/>
		<updated>2010-06-10T20:20:53Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Announcements:Slicer3.6&amp;diff=16836</id>
		<title>Announcements:Slicer3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Announcements:Slicer3.6&amp;diff=16836"/>
		<updated>2010-06-10T19:46:05Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Slicer Highlights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; [[Documentation-3.6|Back to Documentation 3.6]]&lt;br /&gt;
[[image:Slicer3-6Announcement-v2.png|3.6 Icon large]]&lt;br /&gt;
&lt;br /&gt;
=Introduction= &lt;br /&gt;
&lt;br /&gt;
The [[Announcments-3.6-Team|community]] of Slicer developers is proud to announce the release of '''Slicer 3.6'''.&lt;br /&gt;
&lt;br /&gt;
*Click here to [http://www.slicer.org/pages/Downloads download] different versions of Slicer3 and find pointers to the source code, mailing lists and bug tracker. *Please note that Slicer continues to be a research package and is not intended for clinical use. Testing of functionality is an ongoing activity with high priority, however, some features of Slicer3 are not fully tested.&lt;br /&gt;
*The [[Training|Slicer Training page]] provides a series of courses for learning how to use Slicer3. The portfolio contains self-guided presentation and sample data sets &lt;br /&gt;
&lt;br /&gt;
The main [http://www.slicer.org slicer.org] pages provide a guided tour to the application, training materials, and the development community.  New users should start there because we try to keep the pages organized and up to date.&lt;br /&gt;
&lt;br /&gt;
=Slicer Highlights=&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Slicer v3.6 - New and Improved Modules&amp;quot; widths=&amp;quot;250px&amp;quot; heights=&amp;quot;150px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Slicer3.6-Editor-2010-05-06.png|The [[Modules:Editor-Documentation-3.6|Interactive Editor]] can be used to create and edit label maps for quantitative analysis and surface model generation (Steve Pieper)&lt;br /&gt;
Image:VolumeRenderingICPE.png| [[Modules:VolumeRendering-Documentation-3.6|Volume Rendering]] (Yanling Liu, Julien Finet, Lisa Avila)&lt;br /&gt;
Image:Slicer-ColorGUI-3.6.jpg| [[Modules:Colors-Documentation-3.6|Colors]] (Nicole Aucoin)&lt;br /&gt;
Image:Slicer3.6MeasurementsRulersModel.jpg| [[Modules:Measurements-Documentation-3.6 |Measurements (rulers and angles)]] (Nicole Aucoin)&lt;br /&gt;
Image:SlicerFiducialsGlyphs-3.4.jpg| [[Modules:Fiducials-Documentation-3.6|Fiducials]] (Nicole Aucoin)&lt;br /&gt;
Image:EMSegment-Simple.png|[[Modules:EMSegment-Simple3.6|EM Segmenter, simple version]] (Kilian Pohl)&lt;br /&gt;
Image:Fastmarching-result-adjusted.jpg| [[Modules:FastMarchingSegmentation-Documentation-3.6|Fast Marching segmentation]] (Andriy Fedorov)&lt;br /&gt;
Image:RSSkidneyL.png| [[Modules:RobustStatisticsSeg-Documentation-3.6|Robust Statistical Segmentation]] (Yi Gao)&lt;br /&gt;
Image:Fiducial registration before.jpg|NEW: [[Modules:RegisterImagesMultiRes-Documentation-3.6|Multiresolution Affine registration]] (Casey Goodlett)&lt;br /&gt;
Image:B-spline-reg-detail.png|Improved: [[Modules:RegisterImages-Documentation-3.6|Expert Automated Registration]] (Casey Goodlett)&lt;br /&gt;
Image:Fiducial_registration_before.jpg|NEW: [[Modules:TransformFromFiducials-Documentation-3.6|Fiducial Registration]] (Casey Goodlett)&lt;br /&gt;
Image:Registration_BRAINSfit.png|NEW: [[Modules:BRAINSFit |BRAINSFit Registration]] (Hans Johnson)&lt;br /&gt;
Image:Registration_BRAINSdemonwarp.png|NEW: [[Modules:BRAINSDemonWarp|BRAINSDemonWarp]] (Hans Johnson)&lt;br /&gt;
Image:BRAINSResample.png|NEW: [[Modules:BRAINSResample|BRAINSResample]] (Hans J. Johnson)&lt;br /&gt;
Image:BRAINSROIAuto.png|NEW: [[Modules:BRAINSROIAuto|BRAINSROIAuto]] (Hans J. Johnson)&lt;br /&gt;
Image:Plastimatch_icon.png|NEW: [[Modules:Plastimatch |Plastimatch non-rigid registration]] (Greg Sharp)&lt;br /&gt;
Image:PETCTFusion.png| [[Modules:PETCTFusion-Documentation-3.6 |PETCTFusion]] (Wendy Plesniak)&lt;br /&gt;
Image:| [[Modules:CollectFiducials-Documentation-3.6 |Collect Patient Fiducials]] (Andrew Wiles)&lt;br /&gt;
Image:| [[Modules:IGTToolSelector-Documentation-3.6 |IGT Tool Selector]] (Andrew Wiles)&lt;br /&gt;
Image:FourDImage Screenshot1.png| [[Modules:FourDImage-Documentation-3.6|4D Image Viewer]] (Junichi Tokuda)&lt;br /&gt;
Image:MRI_Bias_Field_Correction_Slicer3_close_up.png|[[Modules:MRIBiasFieldCorrection-Documentation-3.6|MRIBiasFieldCorrection]] correction of MRI intensity inhomogeneity i.e. bias field (Sylvain Jaume)&lt;br /&gt;
Image:N4 prostate bias ax.png| [[Modules:N4ITKBiasFieldCorrection-Documentation-3.6|N4 Bias Field Correction]] (Andriy Fedorov)&lt;br /&gt;
Image:Surface H c.png| [[Modules:MeshContourSegmentation-Documentation-3.6|Mesh Contour Segmentation]] (Peter Karasev)&lt;br /&gt;
Image:ModelTransform.PNG| [[Modules:ModelTransform-Documentation-3.6|Model Transform]] (Alex Yarmarkovich)&lt;br /&gt;
Image:BrainWebImageTransformed.jpg| [[Modules:ResampleScalarVectorDWIVolume-Documentation-3.6|Resample Scalar/Vector/DWI Volume]] (Francois Budin)&lt;br /&gt;
Image:ExtractSubvolume3.png| [[Modules:CropVolume-Documentation-3.6|Crop Volume]] (Andriy Fedorov)&lt;br /&gt;
Image:Endoscopy-slicer3.6.png| [[Modules:Endoscopy-Documentation-3.6|Virtual Endoscopy]] (Steve Pieper)&lt;br /&gt;
Image:ChangeTracker_Analysis-3.4.png| [[Modules:ChangeTracker-Documentation-3.6|ChangeTracker]] (Andriy Fedorov)&lt;br /&gt;
Image:Slicer3_OpenIGTLinkIF__VolumeReslice2.png| [[Modules:OpenIGTLinkIF-Documentation-3.6|OpenIGTLinkIF]] (Junichi Tokuda)&lt;br /&gt;
Image:ProstateNav-3.6_Transrectal.png| [[Modules:ProstateNav-Documentation-3.6|ProstateNav]] (Andras Lasso, Junichi Tokuda)&lt;br /&gt;
Image:slicer3.6_neuronav_OR.jpeg| [[Modules:NeuroNav-Documentation-3.6|NeuroNav]] (Haiying Liu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Slicer Extensions=&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Slicer v3.6 - Extensions&amp;quot; widths=&amp;quot;250px&amp;quot; heights=&amp;quot;150px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Plastimatch_dicomrt_dose.png|The [[Modules:PlastimatchDICOMRT| Plastimatch DICOM RT reader]] allows import and conversion of data in that format. (Greg Sharp)&lt;br /&gt;
Image:ABC out3d.png|The [[Modules:ABC-Documentation-3.5|ABC Segmenter]] is based on ITK EM technology.&lt;br /&gt;
Image:FCMResultLabels-3-6.png|[[Modules:FuzzySegmentationModule|Fuzzy segmentation]]&lt;br /&gt;
Image:HammerAverage-3-6.png|[[Modules:HammerRegistration|Hammer Registration]] can be used to build statistical brain atlases&lt;br /&gt;
Image:Plastimatch image 2.png|[[Modules:Plastimatch|Plastimatch non-rigid registration]] (Greg Sharp)&lt;br /&gt;
Image:Corticalthickness.png|[[Modules:ARCTIC-Documentation-3.6|Arctic wizard]] (Automatic Regional Cortical ThICkness)&lt;br /&gt;
Image:LesionsWithVentricles.png|[[Modules:LesionSegmentationApplications-Documentation-3.6| Lupus white matter lesions segmentation]] (Jeremy Bockholt, Mark Scully)&lt;br /&gt;
Image:Shot2.png|[[Modules:EMDTIClustering-Documentation-3.6|EM DTI clustering]] (Mahnaz Maddah)&lt;br /&gt;
Image:RicianTensorCorrectionImage.png|[[Modules:RicianNoiseFilter|Rician Noise Filter]] for noise removal in DWI data&lt;br /&gt;
Image:FourDAnalysisModuleScreenShot-3.5.png|The [[Modules:FourDAnalysis-Documentation-3.6|FourD Analysis module]] was designed for time series analysis (Junichi Takuda)&lt;br /&gt;
Image:Avf 3d voronoi big.png|[[Modules:VMTKCenterlines|Centerline extraction using Voronoi diagrams]] (Luca Antiga, Daniel Haehn) &lt;br /&gt;
Image:Labeldiameterestimation1.png|[[Modules:LabelDiameterEstimation-Documentation-3.6|Label diameter estimation]] (Andriy Fedorov) &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Checklist for the [[Checklist-3.6-Release|3.6 release]]&lt;br /&gt;
&lt;br /&gt;
= Other Improvements,  Additions &amp;amp; Documentation =&lt;br /&gt;
[[Image:RegPortal_Icon.png|100px|Registration Portal|link=Slicer3:Registration]] [[Slicer3:Registration|Registration Portal Page: overview of avail. tools &amp;amp; modules]] (Dominik Meier) &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Registration DecisionMatrix.png| 100px | link=Registration:Categories]] [[Registration:Categories|Registration Tool Feature Matrix]] (Dominik Meier)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Resampling_DecisionMatrix.png| 100px | link=Registration:Resampling]] [[Registration:Resampling|Resampling Tool Feature Matrix]] (Dominik Meier)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:RegLib_Banner.png| 100px |link=http://na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseInventory]] [http://na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseInventory| Slicer Registration Case Library] (Dominik Meier)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:SlicerRegistrationLibrary_Ad.png| 100px | link=http://na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseAdvertisement]] [http://na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseAdvertisement|Slicer Registration Case Library: Call for Example Datasets] (Dominik Meier)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* Registration Welcome Module&lt;br /&gt;
* Segmentation Welcome Module&lt;br /&gt;
* Diffusion Welcome Module&lt;br /&gt;
* Performance Improvements in all registration modules due to bug fixes and performance enhancements in new ITK release&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:Registration_BRAINSfit.png&amp;diff=16835</id>
		<title>File:Registration BRAINSfit.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:Registration_BRAINSfit.png&amp;diff=16835"/>
		<updated>2010-06-10T19:45:20Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: uploaded a new version of &amp;quot;File:Registration BRAINSfit.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSROIAuto.png&amp;diff=16834</id>
		<title>File:BRAINSROIAuto.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSROIAuto.png&amp;diff=16834"/>
		<updated>2010-06-10T19:43:50Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSRROIAutoUI.png&amp;diff=16833</id>
		<title>File:BRAINSRROIAutoUI.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSRROIAutoUI.png&amp;diff=16833"/>
		<updated>2010-06-10T19:40:16Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: uploaded a new version of &amp;quot;File:BRAINSRROIAutoUI.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSRROIAutoUI.png&amp;diff=16832</id>
		<title>File:BRAINSRROIAutoUI.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSRROIAutoUI.png&amp;diff=16832"/>
		<updated>2010-06-10T19:39:15Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSROIAuto&amp;diff=16831</id>
		<title>Modules:BRAINSROIAuto</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSROIAuto&amp;diff=16831"/>
		<updated>2010-06-10T19:38:37Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: Created page with 'Return to Slicer 3.6 Documentation  Gallery of New Features  __NOTOC__ ===Module Name=== BRAINSROIAuto  {| |[[Image:B…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSROIAuto&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:BRAINSRROIAutoUI.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Segmentation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4);  (1=University of Iowa Department of Psychiatry,  3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering)  &lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|Program title || BRAINSROIAuto - Foreground masking tool&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 2.4.1&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
BRAINSROIAuto finds the foreground tissue region in an image.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''IO''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--inputVolume&amp;lt;/span&amp;gt;] : The input image for finding the largest region filled mask.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Mask'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputROIMaskVolume&amp;lt;/span&amp;gt;] : The ROI automatically found from the input image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Clipped by ROI'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputClippedVolumeROI&amp;lt;/span&amp;gt;] : The inputVolume clipped to the region of the brain mask.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Configuration Parameters''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Otsu Percentile Threshold'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--otsuPercentileThreshold&amp;lt;/span&amp;gt;] : Parameter to the Otsu threshold algorithm. ''Default value: 0.01''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Otsu Correction Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--thresholdCorrectionFactor&amp;lt;/span&amp;gt;] : A factor to scale the Otsu algorithm's result threshold, in case clipping mangles the image. ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Closing Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--closingSize&amp;lt;/span&amp;gt;] : The Closing Size (in millimeters) for largest connected filled mask.  This value is divided by image spacing and rounded to the next largest voxel number. ''Default value: 9.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume. ''Default value: short''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSROIAuto depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSROIAuto depends on BRAINSCommonLib&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
http://testing.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Announcements:Slicer3.6&amp;diff=16829</id>
		<title>Announcements:Slicer3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Announcements:Slicer3.6&amp;diff=16829"/>
		<updated>2010-06-10T19:26:08Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Slicer Highlights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; [[Documentation-3.6|Back to Documentation 3.6]]&lt;br /&gt;
[[image:Slicer3-6Announcement-v2.png|3.6 Icon large]]&lt;br /&gt;
&lt;br /&gt;
=Introduction= &lt;br /&gt;
&lt;br /&gt;
The [[Announcments-3.6-Team|community]] of Slicer developers is proud to announce the release of '''Slicer 3.6'''.&lt;br /&gt;
&lt;br /&gt;
*Click here to [http://www.slicer.org/pages/Downloads download] different versions of Slicer3 and find pointers to the source code, mailing lists and bug tracker. *Please note that Slicer continues to be a research package and is not intended for clinical use. Testing of functionality is an ongoing activity with high priority, however, some features of Slicer3 are not fully tested.&lt;br /&gt;
*The [[Training|Slicer Training page]] provides a series of courses for learning how to use Slicer3. The portfolio contains self-guided presentation and sample data sets &lt;br /&gt;
&lt;br /&gt;
The main [http://www.slicer.org slicer.org] pages provide a guided tour to the application, training materials, and the development community.  New users should start there because we try to keep the pages organized and up to date.&lt;br /&gt;
&lt;br /&gt;
=Slicer Highlights=&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Slicer v3.6 - New and Improved Modules&amp;quot; widths=&amp;quot;250px&amp;quot; heights=&amp;quot;150px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Slicer3.6-Editor-2010-05-06.png|The [[Modules:Editor-Documentation-3.6|Interactive Editor]] can be used to create and edit label maps for quantitative analysis and surface model generation (Steve Pieper)&lt;br /&gt;
Image:VolumeRenderingICPE.png| [[Modules:VolumeRendering-Documentation-3.6|Volume Rendering]] (Yanling Liu, Julien Finet, Lisa Avila)&lt;br /&gt;
Image:Slicer-ColorGUI-3.6.jpg| [[Modules:Colors-Documentation-3.6|Colors]] (Nicole Aucoin)&lt;br /&gt;
Image:Slicer3.6MeasurementsRulersModel.jpg| [[Modules:Measurements-Documentation-3.6 |Measurements (rulers and angles)]] (Nicole Aucoin)&lt;br /&gt;
Image:SlicerFiducialsGlyphs-3.4.jpg| [[Modules:Fiducials-Documentation-3.6|Fiducials]] (Nicole Aucoin)&lt;br /&gt;
Image:EMSegment-Simple.png|[[Modules:EMSegment-Simple3.6|EM Segmenter, simple version]] (Kilian Pohl)&lt;br /&gt;
Image:Fastmarching-result-adjusted.jpg| [[Modules:FastMarchingSegmentation-Documentation-3.6|Fast Marching segmentation]] (Andriy Fedorov)&lt;br /&gt;
Image:RSSkidneyL.png| [[Modules:RobustStatisticsSeg-Documentation-3.6|Robust Statistical Segmentation]] (Yi Gao)&lt;br /&gt;
Image:Fiducial registration before.jpg|NEW: [[Modules:RegisterImagesMultiRes-Documentation-3.6|Multiresolution Affine registration]] (Casey Goodlett)&lt;br /&gt;
Image:B-spline-reg-detail.png|Improved: [[Modules:RegisterImages-Documentation-3.6|Expert Automated Registration]] (Casey Goodlett)&lt;br /&gt;
Image:Fiducial_registration_before.jpg|NEW: [[Modules:TransformFromFiducials-Documentation-3.6|Fiducial Registration]] (Casey Goodlett)&lt;br /&gt;
Image:Registration_BRAINSfit.png|NEW: [[Modules:BRAINSFit |BRAINSFit Registration]] (Hans Johnson)&lt;br /&gt;
Image:Registration_BRAINSdemonwarp.png|NEW: [[Modules:BRAINSDemonWarp|BRAINSDemonWarp]] (Hans Johnson)&lt;br /&gt;
Image:BRAINSResample.png| [[Modules:BRAINSResample|BRAINSResample]] (Hans J. Johnson)&lt;br /&gt;
Image:BRAINSROIAuto.png| [[Modules:BRAINSROIAuto|BRAINSROIAuto]] (Hans J. Johnson)&lt;br /&gt;
Image:Plastimatch_icon.png|NEW: [[Modules:Plastimatch |Plastimatch non-rigid registration]] (Greg Sharp)&lt;br /&gt;
Image:PETCTFusion.png| [[Modules:PETCTFusion-Documentation-3.6 |PETCTFusion]] (Wendy Plesniak)&lt;br /&gt;
Image:| [[Modules:CollectFiducials-Documentation-3.6 |Collect Patient Fiducials]] (Andrew Wiles)&lt;br /&gt;
Image:| [[Modules:IGTToolSelector-Documentation-3.6 |IGT Tool Selector]] (Andrew Wiles)&lt;br /&gt;
Image:FourDImage Screenshot1.png| [[Modules:FourDImage-Documentation-3.6|4D Image Viewer]] (Junichi Tokuda)&lt;br /&gt;
Image:MRI_Bias_Field_Correction_Slicer3_close_up.png|[[Modules:MRIBiasFieldCorrection-Documentation-3.6|MRIBiasFieldCorrection]] correction of MRI intensity inhomogeneity i.e. bias field (Sylvain Jaume)&lt;br /&gt;
Image:N4 prostate bias ax.png| [[Modules:N4ITKBiasFieldCorrection-Documentation-3.6|N4 Bias Field Correction]] (Andriy Fedorov)&lt;br /&gt;
Image:Surface H c.png| [[Modules:MeshContourSegmentation-Documentation-3.6|Mesh Contour Segmentation]] (Peter Karasev)&lt;br /&gt;
Image:ModelTransform.PNG| [[Modules:ModelTransform-Documentation-3.6|Model Transform]] (Alex Yarmarkovich)&lt;br /&gt;
Image:BrainWebImageTransformed.jpg| [[Modules:ResampleScalarVectorDWIVolume-Documentation-3.6|Resample Scalar/Vector/DWI Volume]] (Francois Budin)&lt;br /&gt;
Image:ExtractSubvolume3.png| [[Modules:CropVolume-Documentation-3.6|Crop Volume]] (Andriy Fedorov)&lt;br /&gt;
Image:Endoscopy-slicer3.6.png| [[Modules:Endoscopy-Documentation-3.6|Virtual Endoscopy]] (Steve Pieper)&lt;br /&gt;
Image:ChangeTracker_Analysis-3.4.png| [[Modules:ChangeTracker-Documentation-3.6|ChangeTracker]] (Andriy Fedorov)&lt;br /&gt;
Image:Slicer3_OpenIGTLinkIF__VolumeReslice2.png| [[Modules:OpenIGTLinkIF-Documentation-3.6|OpenIGTLinkIF]] (Junichi Tokuda)&lt;br /&gt;
Image:ProstateNav-3.6_Transrectal.png| [[Modules:ProstateNav-Documentation-3.6|ProstateNav]] (Andras Lasso, Junichi Tokuda)&lt;br /&gt;
Image:slicer3.6_neuronav_OR.jpeg| [[Modules:NeuroNav-Documentation-3.6|NeuroNav]] (Haiying Liu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Slicer Extensions=&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Slicer v3.6 - Extensions&amp;quot; widths=&amp;quot;250px&amp;quot; heights=&amp;quot;150px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Plastimatch_dicomrt_dose.png|The [[Modules:PlastimatchDICOMRT| Plastimatch DICOM RT reader]] allows import and conversion of data in that format. (Greg Sharp)&lt;br /&gt;
Image:ABC out3d.png|The [[Modules:ABC-Documentation-3.5|ABC Segmenter]] is based on ITK EM technology.&lt;br /&gt;
Image:FCMResultLabels-3-6.png|[[Modules:FuzzySegmentationModule|Fuzzy segmentation]]&lt;br /&gt;
Image:HammerAverage-3-6.png|[[Modules:HammerRegistration|Hammer Registration]] can be used to build statistical brain atlases&lt;br /&gt;
Image:Plastimatch image 2.png|[[Modules:Plastimatch|Plastimatch non-rigid registration]] (Greg Sharp)&lt;br /&gt;
Image:Corticalthickness.png|[[Modules:ARCTIC-Documentation-3.6|Arctic wizard]] (Automatic Regional Cortical ThICkness)&lt;br /&gt;
Image:LesionsWithVentricles.png|[[Modules:LesionSegmentationApplications-Documentation-3.6| Lupus white matter lesions segmentation]] (Jeremy Bockholt, Mark Scully)&lt;br /&gt;
Image:Shot2.png|[[Modules:EMDTIClustering-Documentation-3.6|EM DTI clustering]] (Mahnaz Maddah)&lt;br /&gt;
Image:RicianTensorCorrectionImage.png|[[Modules:RicianNoiseFilter|Rician Noise Filter]] for noise removal in DWI data&lt;br /&gt;
Image:FourDAnalysisModuleScreenShot-3.5.png|The [[Modules:FourDAnalysis-Documentation-3.6|FourD Analysis module]] was designed for time series analysis (Junichi Takuda)&lt;br /&gt;
Image:Avf 3d voronoi big.png|[[Modules:VMTKCenterlines|Centerline extraction using Voronoi diagrams]] (Luca Antiga, Daniel Haehn) &lt;br /&gt;
Image:Labeldiameterestimation1.png|[[Modules:LabelDiameterEstimation-Documentation-3.6|Label diameter estimation]] (Andriy Fedorov) &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Checklist for the [[Checklist-3.6-Release|3.6 release]]&lt;br /&gt;
&lt;br /&gt;
= Other Improvements,  Additions &amp;amp; Documentation =&lt;br /&gt;
[[Image:RegPortal_Icon.png|100px|Registration Portal|link=Slicer3:Registration]] [[Slicer3:Registration|Registration Portal Page: overview of avail. tools &amp;amp; modules]] (Dominik Meier) &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Registration DecisionMatrix.png| 100px | link=Registration:Categories]] [[Registration:Categories|Registration Tool Feature Matrix]] (Dominik Meier)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Resampling_DecisionMatrix.png| 100px | link=Registration:Resampling]] [[Registration:Resampling|Resampling Tool Feature Matrix]] (Dominik Meier)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:RegLib_Banner.png| 100px |link=http://na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseInventory]] [http://na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseInventory| Slicer Registration Case Library] (Dominik Meier)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:SlicerRegistrationLibrary_Ad.png| 100px | link=http://na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseAdvertisement]] [http://na-mic.org/Wiki/index.php/Projects:RegistrationDocumentation:UseCaseAdvertisement|Slicer Registration Case Library: Call for Example Datasets] (Dominik Meier)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* Registration Welcome Module&lt;br /&gt;
* Segmentation Welcome Module&lt;br /&gt;
* Diffusion Welcome Module&lt;br /&gt;
* Performance Improvements in all registration modules due to bug fixes and performance enhancements in new ITK release&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Slicer_Wiki:Users&amp;diff=16828</id>
		<title>Slicer Wiki:Users</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Slicer_Wiki:Users&amp;diff=16828"/>
		<updated>2010-06-10T19:21:42Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: Created page with 'Need to add.'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Need to add.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Announcements:Slicer3.6&amp;diff=16783</id>
		<title>Announcements:Slicer3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Announcements:Slicer3.6&amp;diff=16783"/>
		<updated>2010-06-10T14:31:35Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Highlights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; [[Documentation-3.6|Back to Documentation 3.6]]&lt;br /&gt;
[[image:Slicer3-6Announcement-v2.png|3.6 Icon large]]&lt;br /&gt;
&lt;br /&gt;
=Introduction= &lt;br /&gt;
&lt;br /&gt;
The [[Announcments-3.6-Team|community]] of Slicer developers is proud to announce the release of '''Slicer 3.6'''.&lt;br /&gt;
&lt;br /&gt;
*Click here to [http://www.slicer.org/pages/Downloads download] different versions of Slicer3 and find pointers to the source code, mailing lists and bug tracker. *Please note that Slicer continues to be a research package and is not intended for clinical use. Testing of functionality is an ongoing activity with high priority, however, some features of Slicer3 are not fully tested.&lt;br /&gt;
*The [[Training|Slicer Training page]] provides a series of courses for learning how to use Slicer3. The portfolio contains self-guided presentation and sample data sets &lt;br /&gt;
&lt;br /&gt;
The main [http://www.slicer.org slicer.org] pages provide a guided tour to the application, training materials, and the development community.  New users should start there because we try to keep the pages organized and up to date.&lt;br /&gt;
&lt;br /&gt;
==Highlights==&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Slicer v3.6 - New and Improved Modules&amp;quot; widths=&amp;quot;250px&amp;quot; heights=&amp;quot;150px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Slicer3.6-Editor-2010-05-06.png|The [[Modules:Editor-Documentation-3.6|Interactive Editor]] can be used to create and edit label maps for quantitative analysis and surface model generation (Steve Pieper)&lt;br /&gt;
Image:VolumeRenderingICPE.png| [[Modules:VolumeRendering-Documentation-3.6|Volume Rendering]] (Yanling Liu, Julien Finet, Lisa Avila)&lt;br /&gt;
Image:Slicer-ColorGUI-3.6.jpg| [[Modules:Colors-Documentation-3.6|Colors]] (Nicole Aucoin)&lt;br /&gt;
Image:Slicer3.6MeasurementsRulersModel.jpg| [[Modules:Measurements-Documentation-3.6 |Measurements (rulers and angles)]] (Nicole Aucoin)&lt;br /&gt;
Image:SlicerFiducialsGlyphs-3.4.jpg| [[Modules:Fiducials-Documentation-3.6|Fiducials]] (Nicole Aucoin)&lt;br /&gt;
Image:EMSegment-Simple.png|[[Modules:EMSegment-Simple3.6|EM Segmenter, simple version]] (Kilian Pohl)&lt;br /&gt;
Image:Fastmarching-result-adjusted.jpg| [[Modules:FastMarchingSegmentation-Documentation-3.6|Fast Marching segmentation]] (Andriy Fedorov)&lt;br /&gt;
Image:RSSkidneyL.png| [[Modules:RobustStatisticsSeg-Documentation-3.6|Robust Statistical Segmentation]] (Yi Gao)&lt;br /&gt;
Image:Fiducial registration before.jpg|NEW: [[Modules:RegisterImagesMultiRes-Documentation-3.6|Multiresolution Affine registration]] (Casey Goodlett)&lt;br /&gt;
Image:B-spline-reg-detail.png|Improved: [[Modules:RegisterImages-Documentation-3.6|Expert Automated Registration]] (Casey Goodlett)&lt;br /&gt;
Image:Fiducial_registration_before.jpg|NEW: [[Modules:TransformFromFiducials-Documentation-3.6|Fiducial Registration]] (Casey Goodlett)&lt;br /&gt;
Image:Registration_BRAINSfit.png|NEW: [[Modules:BRAINSFit |BRAINSFit Registration]] (Hans Johnson)&lt;br /&gt;
Image:Registration_BRAINSdemonwarp.png|NEW: [[Modules:BRAINSDemonWarp|BRAINSDemonWarp]] (Hans Johnson)&lt;br /&gt;
Image:Plastimatch_icon.png|NEW: [[Modules:Plastimatch |Plastimatch non-rigid registration]] (Greg Sharp)&lt;br /&gt;
Image:PETCTFusion.png| [[Modules:PETCTFusion-Documentation-3.6 |PETCTFusion]] (Wendy Plesniak)&lt;br /&gt;
Image:| [[Modules:CollectFiducials-Documentation-3.6 |Collect Patient Fiducials]] (Andrew Wiles)&lt;br /&gt;
Image:| [[Modules:IGTToolSelector-Documentation-3.6 |IGT Tool Selector]] (Andrew Wiles)&lt;br /&gt;
Image:FourDImage Screenshot1.png| [[Modules:FourDImage-Documentation-3.6|4D Image Viewer]] (Junichi Tokuda)&lt;br /&gt;
Image:MRI_Bias_Field_Correction_Slicer3_close_up.png|[[Modules:MRIBiasFieldCorrection-Documentation-3.6|MRIBiasFieldCorrection]] correction of MRI intensity inhomogeneity i.e. bias field (Sylvain Jaume)&lt;br /&gt;
Image:N4 prostate bias ax.png| [[Modules:N4ITKBiasFieldCorrection-Documentation-3.6|N4 Bias Field Correction]] (Andriy Fedorov)&lt;br /&gt;
Image:Surface H c.png| [[Modules:MeshContourSegmentation-Documentation-3.6|Mesh Contour Segmentation]] (Peter Karasev)&lt;br /&gt;
Image:ModelTransform.PNG| [[Modules:ModelTransform-Documentation-3.6|Model Transform]] (Alex Yarmarkovich)&lt;br /&gt;
Image:BrainWebImageTransformed.jpg| [[Modules:ResampleScalarVectorDWIVolume-Documentation-3.6|Resample Scalar/Vector/DWI Volume]] (Francois Budin)&lt;br /&gt;
Image:ExtractSubvolume3.png| [[Modules:CropVolume-Documentation-3.6|Crop Volume]] (Andriy Fedorov)&lt;br /&gt;
Image:Endoscopy-slicer3.6.png| [[Modules:Endoscopy-Documentation-3.6|Virtual Endoscopy]] (Steve Pieper)&lt;br /&gt;
Image:ChangeTracker_Analysis-3.4.png| [[Modules:ChangeTracker-Documentation-3.6|ChangeTracker]] (Andriy Fedorov)&lt;br /&gt;
Image:BRAINSFit.png| [[Modules:BRAINSFit|BRAINSFit]] (Hans J. Johnson)&lt;br /&gt;
Image:BRAINSDemonWarp.png| [[Modules:BRAINSDemonWarp|BRAINSDemonWarp]] (Hans J. Johnson)&lt;br /&gt;
Image:BRAINSResample.png| [[Modules:BRAINSResample|BRAINSResample]] (Hans J. Johnson)&lt;br /&gt;
Image:BRAINSROIAuto.png| [[Modules:BRAINSROIAuto|BRAINSROIAuto]] (Hans J. Johnson)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Slicer Extensions==&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Slicer v3.6 - Extensions&amp;quot; widths=&amp;quot;250px&amp;quot; heights=&amp;quot;150px&amp;quot; perrow=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
Image:Plastimatch_dicomrt_dose.png|The [[Modules:PlastimatchDICOMRT| Plastimatch DICOM RT reader]] allows import and conversion of data in that format. (Greg Sharp)&lt;br /&gt;
Image:ABC out3d.png|The [[Modules:ABC-Documentation-3.5|ABC Segmenter]] is based on ITK EM technology.&lt;br /&gt;
Image:FCMResultLabels-3-6.png|[[Modules:FuzzySegmentationModule|Fuzzy segmentation]]&lt;br /&gt;
Image:HammerAverage-3-6.png|[[Modules:HammerRegistration|Hammer Registration]] can be used to build statistical brain atlases&lt;br /&gt;
Image:Plastimatch image 2.png|[[Modules:Plastimatch|Plastimatch non-rigid registration]] (Greg Sharp)&lt;br /&gt;
Image:Corticalthickness.png|[[Modules:ARCTIC-Documentation-3.6|Arctic wizard]] (Automatic Regional Cortical ThICkness)&lt;br /&gt;
Image:LesionsWithVentricles.png|[[Modules:LesionSegmentationApplications-Documentation-3.6| Lupus white matter lesions segmentation]] (Jeremy Bockholt, Mark Scully)&lt;br /&gt;
Image:Shot2.png|[[Modules:EMDTIClustering-Documentation-3.6|EM DTI clustering]] (Mahnaz Maddah)&lt;br /&gt;
Image:RicianTensorCorrectionImage.png|[[Modules:RicianNoiseFilter|Rician Noise Filter]] for noise removal in DWI data&lt;br /&gt;
Image:FourDAnalysisModuleScreenShot-3.5.png|The [[Modules:FourDAnalysis-Documentation-3.6|FourD Analysis module]] was designed for time series analysis (Junichi Takuda)&lt;br /&gt;
Image:Avf 3d voronoi big.png|[[Modules:VMTKCenterlines|Centerline extraction using Voronoi diagrams]] (Luca Antiga, Daniel Haehn) &lt;br /&gt;
Image:Labeldiameterestimation1.png|[[Modules:LabelDiameterEstimation-Documentation-3.6|Label diameter estimation]] (Andriy Fedorov) &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 Checklist for the [[Checklist-3.6-Release|3.6 release]]&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16694</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16694"/>
		<updated>2010-06-09T01:23:56Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Quick Tour of Features and Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [[SEMToMediaWiki.py| python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with MomentsAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useMomentsAlign&amp;lt;/span&amp;gt;] : MomentsAlign assumes that the center of mass of the images represent similar structures.  Perform a MomentsAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with GeometryCenterAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useGeometryAlign&amp;lt;/span&amp;gt;] : GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with CenterOfHeadAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCenterOfHeadAlign&amp;lt;/span&amp;gt;] : CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate.  Perform a CenterOfHeadAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set. ''Default value: false''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume. ''Default value: float''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence ''Default value: 1500''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. ''Default value: 100000''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete. ''Default value: 0.005''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern. ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0 ''Default value: 1.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed.  ''Default value: 14,10,12''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer. ''Default value: 0.0''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters,  ''Default value: 1000.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc ''Default value: Linear''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform. ''Default value: NOMASK''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional. ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions. ''Default value: 0,0,0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile. ''Default value: false''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : the number of histogram levels ''Default value: 50''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points ''Default value: 10''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline. ''Default value: ON''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job. ''Default value: AUTO''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better. ''Default value: 0.0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.5''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future. ''Default value: 0.2''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 ) ''Default value: 0''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use. ''Default value: -1''&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging. ''Default value: 0''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt; &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16575</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16575"/>
		<updated>2010-06-07T14:39:09Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Quick Tour of Features and Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [[SEMToMediaWiki.py| python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt; The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use''''' &amp;lt;/span&amp;gt; Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with MomentsAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useMomentsAlign&amp;lt;/span&amp;gt;] : MomentsAlign assumes that the center of mass of the images represent similar structures.  Perform a MomentsAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with GeometryCenterAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useGeometryAlign&amp;lt;/span&amp;gt;] : GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with CenterOfHeadAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCenterOfHeadAlign&amp;lt;/span&amp;gt;] : CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate.  Perform a CenterOfHeadAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt; (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt; File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt; What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt; The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt; This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt; A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=SEMToMediaWiki.py&amp;diff=16572</id>
		<title>SEMToMediaWiki.py</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=SEMToMediaWiki.py&amp;diff=16572"/>
		<updated>2010-06-07T14:12:19Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: Created page with '&amp;lt;pre&amp;gt;  #!python # \author Hans J. Johnson # # \description This python script is to help convert from # SEM xml documentation to a form suitable for posting on # a MediaWiki form…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#!python&lt;br /&gt;
# \author Hans J. Johnson&lt;br /&gt;
#&lt;br /&gt;
# \description This python script is to help convert from&lt;br /&gt;
# SEM xml documentation to a form suitable for posting on&lt;br /&gt;
# a MediaWiki format&lt;br /&gt;
#&lt;br /&gt;
# \usage python SEMToMediaWiki.py myProgramSEM.xml &amp;gt; MediaWikiFormattedText.txt&lt;br /&gt;
#&lt;br /&gt;
import sys&lt;br /&gt;
import pprint&lt;br /&gt;
&lt;br /&gt;
import xml.dom.minidom&lt;br /&gt;
from xml.dom.minidom import Node&lt;br /&gt;
&lt;br /&gt;
# Get this nodes text information.&lt;br /&gt;
def getTextValuesFromNode(nodelist):&lt;br /&gt;
    rc = []&lt;br /&gt;
    for node in nodelist:&lt;br /&gt;
        if node.nodeType == node.TEXT_NODE:&lt;br /&gt;
            rc.append(node.data)&lt;br /&gt;
    return ''.join(rc)&lt;br /&gt;
&lt;br /&gt;
# Create a formatted text string suitable for inclusion in a MediaWiki table&lt;br /&gt;
def getThisNodesInfoAsTextTableLine(executableNode,label):&lt;br /&gt;
    labelNodeList=executableNode.getElementsByTagName(label)&lt;br /&gt;
    if labelNodeList.length &amp;gt; 0 :&lt;br /&gt;
        labelNode=labelNodeList[0]  ## Only get the first one&lt;br /&gt;
        print &amp;quot;|Program %s || %s\n&amp;quot; % (label,getTextValuesFromNode(labelNode.childNodes) )&lt;br /&gt;
        print &amp;quot;|-&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Only get the text info for the matching label at this level of the tree&lt;br /&gt;
def getThisNodesInfoAsText(executableNode,label):&lt;br /&gt;
    labelNodeList=executableNode.getElementsByTagName(label)&lt;br /&gt;
    if labelNodeList.length &amp;gt; 0 :&lt;br /&gt;
        labelNode=labelNodeList[0]  ## Only get the first one&lt;br /&gt;
        return getTextValuesFromNode(labelNode.childNodes);&lt;br /&gt;
    return &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Extract the long flag, and color the text string&lt;br /&gt;
def getLongFlagDefinition(executableNode):&lt;br /&gt;
    labelNodeList=executableNode.getElementsByTagName(&amp;quot;longflag&amp;quot;)&lt;br /&gt;
    if labelNodeList.length &amp;gt; 0 :&lt;br /&gt;
        labelNode=labelNodeList[0]  ## Only get the first one&lt;br /&gt;
        return &amp;quot;[&amp;lt;span style=\&amp;quot;color:orange\&amp;quot;&amp;gt;--&amp;quot;+getTextValuesFromNode(labelNode.childNodes)+&amp;quot;&amp;lt;/span&amp;gt;]&amp;quot;;&lt;br /&gt;
    return &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# Extract the (short) flag, and color the text string&lt;br /&gt;
def getFlagDefinition(executableNode):&lt;br /&gt;
    labelNodeList=executableNode.getElementsByTagName(&amp;quot;flag&amp;quot;)&lt;br /&gt;
    if labelNodeList.length &amp;gt; 0 :&lt;br /&gt;
        labelNode=labelNodeList[0]  ## Only get the first one&lt;br /&gt;
        return &amp;quot;[&amp;lt;span style=\&amp;quot;color:pink\&amp;quot;&amp;gt;-&amp;quot;+getTextValuesFromNode(labelNode.childNodes)+&amp;quot;&amp;lt;/span&amp;gt;]&amp;quot;;&lt;br /&gt;
    return &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
# Extract the nodes label, and color the text string&lt;br /&gt;
def getLabelDefinition(executableNode):&lt;br /&gt;
    labelNodeList=executableNode.getElementsByTagName(&amp;quot;label&amp;quot;)&lt;br /&gt;
    if labelNodeList.length &amp;gt; 0 :&lt;br /&gt;
        labelNode=labelNodeList[0]  ## Only get the first one&lt;br /&gt;
        return &amp;quot;** &amp;lt;span style=\&amp;quot;color:green\&amp;quot;&amp;gt;'''&amp;quot;+getTextValuesFromNode(labelNode.childNodes)+&amp;quot;'''&amp;lt;/span&amp;gt;&amp;quot;;&lt;br /&gt;
    return &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
## Read the xml file from the first argument of command line&lt;br /&gt;
doc = xml.dom.minidom.parse(sys.argv[1]);&lt;br /&gt;
&lt;br /&gt;
# Get the primary heirarchial tree node.&lt;br /&gt;
executableNode=doc.getElementsByTagName(&amp;quot;executable&amp;quot;)[0]&lt;br /&gt;
&lt;br /&gt;
# Print information about the program in general&lt;br /&gt;
print &amp;quot;===Module Type &amp;amp; Category===\n&amp;quot;&lt;br /&gt;
print &amp;quot;Type: CLI\n&amp;quot;&lt;br /&gt;
print &amp;quot;Category: %s\n&amp;quot; % getThisNodesInfoAsText(executableNode,&amp;quot;category&amp;quot;)&lt;br /&gt;
print &amp;quot;\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;===Authors, Collaborators &amp;amp; Contact===\n&amp;quot;&lt;br /&gt;
print &amp;quot;Author: %s\n&amp;quot; % getThisNodesInfoAsText(executableNode,&amp;quot;contributor&amp;quot;)&lt;br /&gt;
print &amp;quot;Contributors: %s\n&amp;quot; % getThisNodesInfoAsText(executableNode,&amp;quot;acknowledgements&amp;quot;)&lt;br /&gt;
print &amp;quot;\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;===Module Description===\n&amp;quot;&lt;br /&gt;
print &amp;quot;{| style=\&amp;quot;color:green\&amp;quot; border=\&amp;quot;1\&amp;quot;\n&amp;quot;&lt;br /&gt;
getThisNodesInfoAsTextTableLine(executableNode,&amp;quot;title&amp;quot;)&lt;br /&gt;
getThisNodesInfoAsTextTableLine(executableNode,&amp;quot;descripition&amp;quot;)&lt;br /&gt;
getThisNodesInfoAsTextTableLine(executableNode,&amp;quot;version&amp;quot;)&lt;br /&gt;
getThisNodesInfoAsTextTableLine(executableNode,&amp;quot;documentation-url&amp;quot;)&lt;br /&gt;
getThisNodesInfoAsTextTableLine(executableNode,&amp;quot;doesnotexiststest&amp;quot;)&lt;br /&gt;
print &amp;quot;|}\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Now print all the command line arguments and the labels that showup in the GUI interface&lt;br /&gt;
for parameterNode in executableNode.getElementsByTagName(&amp;quot;parameters&amp;quot;):&lt;br /&gt;
  print &amp;quot;* &amp;lt;span style=\&amp;quot;color:blue\&amp;quot;&amp;gt;'''''%s''''' &amp;lt;/span&amp;gt; %s&amp;quot; % (getThisNodesInfoAsText(parameterNode,&amp;quot;label&amp;quot;),getThisNodesInfoAsText(parameterNode,&amp;quot;description&amp;quot;))&lt;br /&gt;
  currentNode = parameterNode.firstChild&lt;br /&gt;
  while currentNode is not None :&lt;br /&gt;
      if currentNode.nodeType == currentNode.ELEMENT_NODE:&lt;br /&gt;
        if getThisNodesInfoAsText(currentNode,&amp;quot;label&amp;quot;) != &amp;quot;&amp;quot;: #If this node doe not have a &amp;quot;label&amp;quot; element, then just skip it.&lt;br /&gt;
          print &amp;quot;%s %s %s: %s&amp;quot; % (getLabelDefinition(currentNode), getLongFlagDefinition(currentNode),getFlagDefinition(currentNode),getThisNodesInfoAsText(currentNode,&amp;quot;description&amp;quot;))&lt;br /&gt;
      currentNode=currentNode.nextSibling&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16570</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16570"/>
		<updated>2010-06-07T14:11:31Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Quick Tour of Features and Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [[SEMToMediaWiki.py| python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt; The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use''''' &amp;lt;/span&amp;gt; Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with MomentsAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useMomentsAlign&amp;lt;/span&amp;gt;] : MomentsAlign assumes that the center of mass of the images represent similar structures.  Perform a MomentsAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with GeometryCenterAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useGeometryAlign&amp;lt;/span&amp;gt;] : GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with CenterOfHeadAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCenterOfHeadAlign&amp;lt;/span&amp;gt;] : CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate.  Perform a CenterOfHeadAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt; (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt; File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt; What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt; The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt; This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt; A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16569</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16569"/>
		<updated>2010-06-07T14:10:50Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Quick Tour of Features and Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [[Media:SEMToMediaWiki.py| python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt; The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use''''' &amp;lt;/span&amp;gt; Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with MomentsAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useMomentsAlign&amp;lt;/span&amp;gt;] : MomentsAlign assumes that the center of mass of the images represent similar structures.  Perform a MomentsAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with GeometryCenterAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useGeometryAlign&amp;lt;/span&amp;gt;] : GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with CenterOfHeadAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCenterOfHeadAlign&amp;lt;/span&amp;gt;] : CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate.  Perform a CenterOfHeadAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt; (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt; File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt; What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt; The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt; This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt; A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16567</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16567"/>
		<updated>2010-06-07T14:10:20Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Quick Tour of Features and Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [[File:SEMToMediaWiki.py| python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt; The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use''''' &amp;lt;/span&amp;gt; Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with MomentsAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useMomentsAlign&amp;lt;/span&amp;gt;] : MomentsAlign assumes that the center of mass of the images represent similar structures.  Perform a MomentsAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with GeometryCenterAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useGeometryAlign&amp;lt;/span&amp;gt;] : GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with CenterOfHeadAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCenterOfHeadAlign&amp;lt;/span&amp;gt;] : CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate.  Perform a CenterOfHeadAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt; (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt; File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt; What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt; The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt; This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt; A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16566</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16566"/>
		<updated>2010-06-07T14:08:17Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Quick Tour of Features and Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
This section was partially generated with a [[SEMToMediaWiki.py| python script to convert Slicer Execution Model xml files into MediaWiki compatible documentation]]&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt; The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use''''' &amp;lt;/span&amp;gt; Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with MomentsAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useMomentsAlign&amp;lt;/span&amp;gt;] : MomentsAlign assumes that the center of mass of the images represent similar structures.  Perform a MomentsAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with GeometryCenterAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useGeometryAlign&amp;lt;/span&amp;gt;] : GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with CenterOfHeadAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCenterOfHeadAlign&amp;lt;/span&amp;gt;] : CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate.  Perform a CenterOfHeadAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt; (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt; File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt; What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt; The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt; This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt; A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16563</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16563"/>
		<updated>2010-06-07T13:30:36Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Notes from the Developer(s) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
A list panels in the interface, their features, what they mean, and how to use them. For instance:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt; The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use''''' &amp;lt;/span&amp;gt; Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with MomentsAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useMomentsAlign&amp;lt;/span&amp;gt;] : MomentsAlign assumes that the center of mass of the images represent similar structures.  Perform a MomentsAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with GeometryCenterAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useGeometryAlign&amp;lt;/span&amp;gt;] : GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with CenterOfHeadAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCenterOfHeadAlign&amp;lt;/span&amp;gt;] : CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate.  Perform a CenterOfHeadAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt; (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt; File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt; What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt; The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt; This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt; A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set */&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16557</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16557"/>
		<updated>2010-06-06T19:19:04Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Quick Tour of Features and Use */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
A list panels in the interface, their features, what they mean, and how to use them. For instance:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt; The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;] : The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;] : The moving image for registration by mutual information optimization.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration phases to use''''' &amp;lt;/span&amp;gt; Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with previously generated transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;] : Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with MomentsAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useMomentsAlign&amp;lt;/span&amp;gt;] : MomentsAlign assumes that the center of mass of the images represent similar structures.  Perform a MomentsAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with GeometryCenterAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useGeometryAlign&amp;lt;/span&amp;gt;] : GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initialize with CenterOfHeadAlign registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCenterOfHeadAlign&amp;lt;/span&amp;gt;] : CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate.  Perform a CenterOfHeadAlign registration as part of the sequential registration steps.   This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Rigid registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useRigid&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleVersor3D&amp;lt;/span&amp;gt;] : Perform a ScaleVersor3D registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include ScaleSkewVersor3D registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useScaleSkewVersor3D&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include Affine registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useAffine&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Include BSpline registration phase'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useBSpline&amp;lt;/span&amp;gt;] : Perform a rigid registration as part of the sequential registration steps.  This family of options superceeds the use of transformType if any of them are set.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt; (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;] : (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;] : (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;] : The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;] : Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;] : The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;] : The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;] : Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;] : How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;] : ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;] : ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;] : The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;] :  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt; File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;] : File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;] : Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;] : For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;] : If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;] : Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt; What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;] : What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;] : The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;] : Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;] : Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt; The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;] : The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;] : The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;] [&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;] : the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;] : the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt; This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;] : This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;] : Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;] : This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;] : Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;] : If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;] : Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;] : Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;] : Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt; A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;] : A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;] : The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:After.png&amp;diff=16556</id>
		<title>File:After.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:After.png&amp;diff=16556"/>
		<updated>2010-06-06T19:08:54Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:Before.png&amp;diff=16555</id>
		<title>File:Before.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:Before.png&amp;diff=16555"/>
		<updated>2010-06-06T19:08:28Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16554</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16554"/>
		<updated>2010-06-06T19:08:13Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Module Name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Image:Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|-&lt;br /&gt;
|  [[Image:After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
A list panels in the interface, their features, what they mean, and how to use them. For instance:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;]: The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;]: The moving image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Class of Registration'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--registrationClass&amp;lt;/span&amp;gt;]: Specifies one of the five supported transform types.  The valid types are, (R)Rigid, (R+S)ScaleVersor3D, (R+S+S)ScaleSkewVersor3D, (A)Affine, (BS)BSpline, (O)ther.  Note that registration proceeds from the lowest parameter dimension upto the parameter type choosen.  Selecting BS for registrationClass has the same effect as setting transformType to &amp;quot;Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline&amp;quot;.  Set to (O)ther when using the more flexible Transform Type flag under Registration Parameters settings.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;]: (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;]: The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Transform Initialization Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Intitialze Transform Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeTransformMode&amp;lt;/span&amp;gt;]: Determine how to initialize the transform center.  GeometryOn on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsOn assumes that the center of mass of the images represent similar structures.  CenterOfHead attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initial Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;]: Filename of transform used to initialize the registration.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;]: Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;]: The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;]: The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;]: Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;]: How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;]: ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;]: ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;]: The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;]:  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;]: File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;]: Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;]: For use with --initializeTransformMode CenterOfHead (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;]: If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;]: Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;]: What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;]: The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;]: The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;]: Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;]: Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;]: The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;]: The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;]: The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;]: the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;]: the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;]: This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;]: Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;]: This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;]: Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;]: Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;]: If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;]: Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;]: Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;]: Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;]: A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;]: The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;]: The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16553</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16553"/>
		<updated>2010-06-06T19:07:12Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|  [[Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|  [[After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
A list panels in the interface, their features, what they mean, and how to use them. For instance:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;]: The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;]: The moving image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Class of Registration'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--registrationClass&amp;lt;/span&amp;gt;]: Specifies one of the five supported transform types.  The valid types are, (R)Rigid, (R+S)ScaleVersor3D, (R+S+S)ScaleSkewVersor3D, (A)Affine, (BS)BSpline, (O)ther.  Note that registration proceeds from the lowest parameter dimension upto the parameter type choosen.  Selecting BS for registrationClass has the same effect as setting transformType to &amp;quot;Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline&amp;quot;.  Set to (O)ther when using the more flexible Transform Type flag under Registration Parameters settings.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;]: (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;]: The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Transform Initialization Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Intitialze Transform Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeTransformMode&amp;lt;/span&amp;gt;]: Determine how to initialize the transform center.  GeometryOn on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsOn assumes that the center of mass of the images represent similar structures.  CenterOfHead attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initial Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;]: Filename of transform used to initialize the registration.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;]: Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;]: The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;]: The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;]: Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;]: How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;]: ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;]: ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;]: The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;]:  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;]: File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;]: Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;]: For use with --initializeTransformMode CenterOfHead (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;]: If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;]: Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;]: What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;]: The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;]: The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;]: Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;]: Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;]: The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;]: The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;]: The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;]: the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;]: the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;]: This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;]: Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;]: This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;]: Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;]: Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;]: If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;]: Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;]: Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;]: Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;]: A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;]: The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;]: The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSFitUI_part2.png&amp;diff=16552</id>
		<title>File:BRAINSFitUI part2.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSFitUI_part2.png&amp;diff=16552"/>
		<updated>2010-06-06T19:01:39Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSFitUI_part1.png&amp;diff=16551</id>
		<title>File:BRAINSFitUI part1.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSFitUI_part1.png&amp;diff=16551"/>
		<updated>2010-06-06T19:01:10Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16550</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16550"/>
		<updated>2010-06-06T19:00:43Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| || [[Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|  || [[After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
A list panels in the interface, their features, what they mean, and how to use them. For instance:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;]: The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;]: The moving image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Class of Registration'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--registrationClass&amp;lt;/span&amp;gt;]: Specifies one of the five supported transform types.  The valid types are, (R)Rigid, (R+S)ScaleVersor3D, (R+S+S)ScaleSkewVersor3D, (A)Affine, (BS)BSpline, (O)ther.  Note that registration proceeds from the lowest parameter dimension upto the parameter type choosen.  Selecting BS for registrationClass has the same effect as setting transformType to &amp;quot;Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline&amp;quot;.  Set to (O)ther when using the more flexible Transform Type flag under Registration Parameters settings.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;]: (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;]: The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Transform Initialization Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Intitialze Transform Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeTransformMode&amp;lt;/span&amp;gt;]: Determine how to initialize the transform center.  GeometryOn on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsOn assumes that the center of mass of the images represent similar structures.  CenterOfHead attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initial Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;]: Filename of transform used to initialize the registration.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;]: Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;]: The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;]: The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;]: Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;]: How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;]: ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;]: ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;]: The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;]:  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;]: File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;]: Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;]: For use with --initializeTransformMode CenterOfHead (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;]: If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;]: Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;]: What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;]: The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;]: The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;]: Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;]: Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;]: The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;]: The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;]: The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;]: the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;]: the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;]: This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;]: Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;]: This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;]: Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;]: Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;]: If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;]: Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;]: Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;]: Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;]: A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;]: The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;]: The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI_part1.png|thumb|280px|User Interface]] [[Image:BRAINSFitUI_part2.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSFitUI.png&amp;diff=16549</id>
		<title>File:BRAINSFitUI.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSFitUI.png&amp;diff=16549"/>
		<updated>2010-06-06T18:58:18Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: uploaded a new version of &amp;quot;File:BRAINSFitUI.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSFitUI.png&amp;diff=16548</id>
		<title>File:BRAINSFitUI.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSFitUI.png&amp;diff=16548"/>
		<updated>2010-06-06T18:57:01Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: uploaded a new version of &amp;quot;File:BRAINSFitUI.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16524</id>
		<title>Modules:BRAINSFit</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSFit&amp;diff=16524"/>
		<updated>2010-06-05T03:12:25Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: /* Module Name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
BRAINSFit&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:BRAINSFitUI.png|thumb|280px|User Interface]] || [[Before.png|thumb|280px|Before registration]]&lt;br /&gt;
|  || [[After.png|thumb|280px|AfterRegistration]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu&lt;br /&gt;
&lt;br /&gt;
Contributors: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3);  Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard)  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Program title || BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Insight/Examples/Registration/ImageRegistration8.cxx&lt;br /&gt;
This program is the most functional example of multi-modal 3D rigid image registration provided with ITK. ImageRegistration8 is in the Examples directory, and also sec. 8.5.3 in the ITK manual. We have modified and extended this example in several ways:&lt;br /&gt;
&lt;br /&gt;
*defined a new ITK Transform class, based on itkScaleSkewVersor3DTransform which has 3 dimensions of scale but no skew aspect.&lt;br /&gt;
*implemented a set of functions to convert between Versor Transforms and the general itk::AffineTransform and deferred converting from specific to more general representations to preserve transform information specificity as long as possible. Our Rigid transform is the narrowest, a Versor rotation plus separate translation.&lt;br /&gt;
*Added a template class itkMultiModal3DMutualRegistrationHelper which is templated over the type of ITK transform generated, and the optimizer used.&lt;br /&gt;
*Added image masks as an optional input to the Registration algorithm, limiting the volume considered during registration to voxels within the brain.&lt;br /&gt;
*Added image mask generation as an optional input to the Registration algorithm when meaningful masks such as for whole brain are not available, allowing the fit to at least be focused on whole head tissue.&lt;br /&gt;
*Added the ability to use one transform result, such as the Rigid transform, to initialize a more adaptive transform&lt;br /&gt;
*Defined the command line parameters using tools from the Slicer [ 3] program, in order to conform to the Slicer3 Execution model.&lt;br /&gt;
Added the ability to write output images in any ITK-supported scalar image format.&lt;br /&gt;
*Extensive testing as part of the BRAINS2 application suite, determined reasonable defaults for registration algorithm parameters. http://testing.psychiatry.uiowa.edu/CDash/&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The BRAINSFit distribution contains a directory named TestData, which contains two example images. The first, test.nii.gz is a NIfTI format image volume, which is used the input for the CTest-managed regression test program. The program makexfrmedImage.cxx, included in the BRAINSFit distribution was used to generate test2.nii.gz, by scaling, rotating and translating test.nii.gz. You can see representative Sagittal slices of test.nii.gz (in this case, the fixed image, test2.nii.gz (the moving image), and the two images ’checkerboarded’ together to the right. To register test2.nii.gz to test.nii.gz, you can use the following command:&lt;br /&gt;
&lt;br /&gt;
 BRAINSFit --fixedVolume test.nii.gz \&lt;br /&gt;
 --movingVolume test2.nii.gz \&lt;br /&gt;
 --outputVolume registered.nii.gz \&lt;br /&gt;
 --transformType Affine&lt;br /&gt;
A representative slice of the registered results image registered.nii.gz is to the right. You can see from the Checkerboard of the Fixed and Registered images that the fit is quite good with Affine transform-based registration. The blurring of the registered images is a consequence of the initial scaling used in generating the moving image from the fixed image, compounded by the interpolation necessitated by the transform operation.&lt;br /&gt;
&lt;br /&gt;
You can see the differences in results if you re-run BRAINSFit using Rigid, ScaleVersor3D, or ScaleSkewVersor3D as the ----transformType parameter. In this case, the authors judged Affine the best method for registering these particular two images; in the BRAINS2 automated processing pipeline, Rigid usually works well for registering research scans.&lt;br /&gt;
&amp;lt;!-- ===Use Cases, Examples===&lt;br /&gt;
&lt;br /&gt;
This module is especially appropriate for these use cases:&lt;br /&gt;
&lt;br /&gt;
* Use Case 1:&lt;br /&gt;
* Use Case 2:&lt;br /&gt;
&lt;br /&gt;
Examples of the module in use:&lt;br /&gt;
&lt;br /&gt;
* Example 1&lt;br /&gt;
* Example 2&lt;br /&gt;
&lt;br /&gt;
===Tutorials===&lt;br /&gt;
&lt;br /&gt;
Links to tutorials explaining how to use this module:&lt;br /&gt;
&lt;br /&gt;
* Tutorial 1&lt;br /&gt;
** Data Set 1&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
A list panels in the interface, their features, what they mean, and how to use them. For instance:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Input Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;]: The fixed image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;]: The moving image for registration by mutual information optimization.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Class of Registration'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--registrationClass&amp;lt;/span&amp;gt;]: Specifies one of the five supported transform types.  The valid types are, (R)Rigid, (R+S)ScaleVersor3D, (R+S+S)ScaleSkewVersor3D, (A)Affine, (BS)BSpline, (O)ther.  Note that registration proceeds from the lowest parameter dimension upto the parameter type choosen.  Selecting BS for registrationClass has the same effect as setting transformType to &amp;quot;Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline&amp;quot;.  Set to (O)ther when using the more flexible Transform Type flag under Registration Parameters settings.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Output Settings (At least one output must be specified.)''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer BSpline Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--bsplineTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Slicer Linear Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--linearTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the estimated transform. NOTE: You must set at least one output object (either a deformed image or a transform.  NOTE: USE THIS ONLY IF THE FINAL TRANSFORM IS ---NOT--- BSpline&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputTransform&amp;lt;/span&amp;gt;]: (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;]: (optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Pixel Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolumePixelType&amp;lt;/span&amp;gt;]: The output image Pixel Type is the scalar datatype for representation of the Output Volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Transform Initialization Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Intitialze Transform Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeTransformMode&amp;lt;/span&amp;gt;]: Determine how to initialize the transform center.  GeometryOn on assumes that the center of the voxel lattice of the images represent similar structures.  MomentsOn assumes that the center of mass of the images represent similar structures.  CenterOfHead attempts to use the top of head and shape of neck to drive a center of mass estimate.  Off assumes that the physical space of the images are close, and that centering in terms of the image Origins is a good starting point.  This flag is mutually exclusive with the initialTransform flag.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initial Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initialTransform&amp;lt;/span&amp;gt;]: Filename of transform used to initialize the registration.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--transformType&amp;lt;/span&amp;gt;]: Specifies a list of registration types to be used.  The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline.  Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Iterations'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfIterations&amp;lt;/span&amp;gt;]: The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Samples'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfSamples&amp;lt;/span&amp;gt;]: The number of voxels sampled for mutual information computation.  Increase this for a slower, more careful fit.  You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Minimum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumStepSize&amp;lt;/span&amp;gt;]: Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Transform Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--translationScale&amp;lt;/span&amp;gt;]: How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the search pattern.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Reproportion Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--reproportionScale&amp;lt;/span&amp;gt;]: ScaleVersor3D 'Scale' compensation factor.  Increase this to put more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Skew Scale'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--skewScale&amp;lt;/span&amp;gt;]: ScaleSkewVersor3D Skew compensation factor.  Increase this to put more skew in a ScaleSkewVersor3D search pattern.  1.0 works well with a translationScale of 1000.0&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number Of Grid Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--splineGridSize&amp;lt;/span&amp;gt;]: The number of subdivisions of the BSpline Grid to be centered on the image space.  Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum B-Spline Displacement'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maxBSplineDisplacement&amp;lt;/span&amp;gt;]:  Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis.  A value of 0.0 indicates that the problem should be unbounded.  NOTE:  This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform.  This can lead to a substantial reduction in computation time in the BSpline optimizer.&lt;br /&gt;
      &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Advanced Output Settings''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Stripped Output Transform'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--strippedOutputTransform&amp;lt;/span&amp;gt;]: File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE:  This value is overwritten if either bsplineTransform or linearTransform is set.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Background Fill Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;]: Background fill value for output image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Inferior Cut Off From Center'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskInferiorCutOffFromCenter&amp;lt;/span&amp;gt;]: For use with --initializeTransformMode CenterOfHead (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Scale Output Values'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--scaleOutputValues&amp;lt;/span&amp;gt;]: If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;]: Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Control of Mask Processing''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;]: What mode to use for using the masks.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. The Region Of Interest mode (choose ROI) uses the masks to define what parts of the image should be used for computing the transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Fixed Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputFixedVolumeROI&amp;lt;/span&amp;gt;]: The ROI automatically found in fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Moving Mask (ROIAUTO only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputMovingVolumeROI&amp;lt;/span&amp;gt;]: The ROI automatically found in moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;]: Fixed Image binary mask volume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask (ROI only)'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;]: Moving Image binary mask volume.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Special Input Image Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeTimeIndex&amp;lt;/span&amp;gt;]: The index in the time series for the 3D fixed image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Time Index'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeTimeIndex&amp;lt;/span&amp;gt;]: The index in the time series for the 3D moving image to fit, if 4-dimensional.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;]: The radius for the optional MedianImageFilter preprocessing in all 3 directions.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Histogram Bins'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;]: the number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;]: the number of match points&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Debugging Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Caching BSpline Weights Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useCachingOfBSplineWeightsMode&amp;lt;/span&amp;gt;]: This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Explicit PDF Derivatives Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--useExplicitPDFDerivativesMode&amp;lt;/span&amp;gt;]: Using mode AUTO means OFF for BSplineDeformableTransforms and ON for the linear transforms.  The ON alternative uses more memory to sometimes do a better job.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;''' ROIAuto Dilate Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--ROIAutoDilateSize&amp;lt;/span&amp;gt;]: This flag is only relavent when using ROIAUTO mode for initializing masks.  It defines the final dilation size to capture a bit of background outside the tissue region.  At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Relaxation Factor'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--relaxationFactor&amp;lt;/span&amp;gt;]: Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Maximum Step Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maximumStepSize&amp;lt;/span&amp;gt;]: Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Failure Exit Code'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--failureExitCode&amp;lt;/span&amp;gt;]: If the fit fails, exit with this status code.  (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Transform On Failure'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--writeTransformOnFailure&amp;lt;/span&amp;gt;]: Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''debugNumberOfThreads'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugNumberOfThreads&amp;lt;/span&amp;gt;]: Explicitly specify the maximum number of threads to use.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Debug option'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--debugLevel&amp;lt;/span&amp;gt;]: Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Risky Expert-only Parameters''''' &amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Selective Permission for Transform Parameters to Vary'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--permitParameterVariation&amp;lt;/span&amp;gt;]: A bit vector to permit linear transform parameters to vary under optimization.  The vector order corresponds with transform parameters, and beyond the end ones fill in as a default.  For instance, you can choose to rotate only in x (pitch) with 1,0,0;  this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolumeOrigin&amp;lt;/span&amp;gt;]: The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Origin'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolumeOrigin&amp;lt;/span&amp;gt;]: The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.&lt;br /&gt;
&lt;br /&gt;
||[[Image:BRAINSFitUI.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
This is a thin wrapper program around the BRAINSFitHelper class in BRAINSCommonLib.  The BRAINSFitHelper class&lt;br /&gt;
is intended to allow all the functionality of BRAINSFit to be easily incorporated into another program by including a single header file, linking against the BRAINSCommonLib library, and adding code similar to the following to your application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
    typedef itk::BRAINSFitHelper HelperType;&lt;br /&gt;
    HelperType::Pointer myHelper=HelperType::New();&lt;br /&gt;
    myHelper-&amp;gt;SetTransformType(localTransformType);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedVolume(extractFixedVolume);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingVolume(extractMovingVolume);&lt;br /&gt;
    myHelper-&amp;gt;StartRegistration();&lt;br /&gt;
    currentGenericTransform=myHelper-&amp;gt;GetCurrentGenericTransform();&lt;br /&gt;
    MovingVolumeType::ConstPointer preprocessedMovingVolume = myHelper-&amp;gt;GetPreprocessedMovingVolume();&lt;br /&gt;
&lt;br /&gt;
/*  Optional member functions that can also be set&lt;br /&gt;
    myHelper-&amp;gt;SetHistogramMatch(histogramMatch);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfMatchPoints(numberOfMatchPoints);&lt;br /&gt;
    myHelper-&amp;gt;SetFixedBinaryVolume(fixedMask);&lt;br /&gt;
    myHelper-&amp;gt;SetMovingBinaryVolume(movingMask);&lt;br /&gt;
    myHelper-&amp;gt;SetPermitParameterVariation(permitParameterVariation);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfSamples(numberOfSamples);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfHistogramBins(numberOfHistogramBins);&lt;br /&gt;
    myHelper-&amp;gt;SetNumberOfIterations(numberOfIterations);&lt;br /&gt;
    myHelper-&amp;gt;SetMaximumStepLength(maximumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetMinimumStepLength(minimumStepSize);&lt;br /&gt;
    myHelper-&amp;gt;SetRelaxationFactor(relaxationFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetTranslationScale(translationScale);&lt;br /&gt;
    myHelper-&amp;gt;SetReproportionScale(reproportionScale);&lt;br /&gt;
    myHelper-&amp;gt;SetSkewScale(skewScale);&lt;br /&gt;
    myHelper-&amp;gt;SetUseExplicitPDFDerivativesMode(useExplicitPDFDerivativesMode);&lt;br /&gt;
    myHelper-&amp;gt;SetUseCachingOfBSplineWeightsMode(useCachingOfBSplineWeightsMode);&lt;br /&gt;
    myHelper-&amp;gt;SetBackgroundFillValue(backgroundFillValue);&lt;br /&gt;
    myHelper-&amp;gt;SetInitializeTransformMode(localInitializeTransformMode);&lt;br /&gt;
    myHelper-&amp;gt;SetMaskInferiorCutOffFromCenter(maskInferiorCutOffFromCenter);&lt;br /&gt;
    myHelper-&amp;gt;SetCurrentGenericTransform(currentGenericTransform);&lt;br /&gt;
    myHelper-&amp;gt;SetSplineGridSize(splineGridSize);&lt;br /&gt;
    myHelper-&amp;gt;SetCostFunctionConvergenceFactor(costFunctionConvergenceFactor);&lt;br /&gt;
    myHelper-&amp;gt;SetProjectedGradientTolerance(projectedGradientTolerance);&lt;br /&gt;
    myHelper-&amp;gt;SetMaxBSplineDisplacement(maxBSplineDisplacement);&lt;br /&gt;
    myHelper-&amp;gt;SetDisplayDeformedImage(UseDebugImageViewer);&lt;br /&gt;
    myHelper-&amp;gt;SetPromptUserAfterDisplay(PromptAfterImageSend);&lt;br /&gt;
    myHelper-&amp;gt;SetDebugLevel(debugLevel);&lt;br /&gt;
    if(debugLevel &amp;gt; 7 )&lt;br /&gt;
      {&lt;br /&gt;
      myHelper-&amp;gt;PrintCommandLine(true,&amp;quot;BF&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
BRAINSFit depends on Slicer3 (for the SlicerExecutionModel support) and ITK.&lt;br /&gt;
BRAINSFit depends on the BRAINSCommonLib library&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
&lt;br /&gt;
Nightly testing of the development head can be found at: http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
Links to known bugs and feature requests are listed at:&lt;br /&gt;
* http://www.nitrc.org/projects/multimodereg/&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Links to the module's source code:&lt;br /&gt;
&lt;br /&gt;
Source code:&lt;br /&gt;
*[http://www.nitrc.org/projects/multimodereg/|Hosted by NITRC ]&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
&lt;br /&gt;
This research was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:BRAINSResampleUI.png&amp;diff=16523</id>
		<title>File:BRAINSResampleUI.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:BRAINSResampleUI.png&amp;diff=16523"/>
		<updated>2010-06-05T02:59:09Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: uploaded a new version of &amp;quot;File:BRAINSResampleUI.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:BRAINSDemonWarp&amp;diff=16522</id>
		<title>Modules:BRAINSDemonWarp</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:BRAINSDemonWarp&amp;diff=16522"/>
		<updated>2010-06-05T02:57:19Z</updated>

		<summary type="html">&lt;p&gt;Hjmjohnson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Announcements:Slicer3.6#Highlights|Gallery of New Features]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Module Name===&lt;br /&gt;
MyModule&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:BRAINSDemonWarpForm.png|thumb|280px|User Interface]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Registration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
&lt;br /&gt;
Author: This tool was developed by Hans J. Johnson and Greg Harris.&lt;br /&gt;
&lt;br /&gt;
Contributors: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|Program title || BRAINSDemonWarp&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program version || 3.0.0&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Program documentation-url || http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSDemonWarp&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
The module registers the template (moving) image onto the physical space of the target (fixed) image. The resultant deformation fields and metric values can be written to a file. The program uses the Insight Toolkit (www.ITK.org) for all the computations, and can operate on any of the image file types supported by that library.&lt;br /&gt;
&lt;br /&gt;
===Use Cases, Examples===&lt;br /&gt;
The inputs to the BrainDemonsWarp program are the target image, the template image and the optional parameters. These parameters define the arguments for histogram matching and multi resolution registration. The outputs are the deformation field, output image, checkerboard image of the output and the fixed image and the x,y,z displacement vectors. If we specify debug option we can get the outputs at different stages. The filter is templated over the input image type, real image type and the output image types. We implement the algorithm by parsing the input, preprocessing them and registering the processed images.&lt;br /&gt;
&lt;br /&gt;
# Parsing - The images are initialized by the ValidationInputParser. This function reads in the arguments from the parameter file. It sets the histogram bins, match points, number of levels in the multi resolution registration, shrink factors and number of iterations at each levels. If the orientations of the images are different it sets the orientation of the moving image to that of the fixed image.&lt;br /&gt;
# PreProcessing - In the next step the DemonsPreProcessor preprocesses the images by resampling the template image to target image space. The intensity mismatch problem is solved by histogram matching the images. Histogram matching is done only if the command line option -e is set. ItkHistogramMatchingImageFilter is used to perform this function. Another important step in preprocessing is skull stripping. Skull stripping is done only if the command line option -maskProcessingMode is set to BOBF. We have written an itk filter, named itkBOBFFilter for this purpose. This filter takes in an input image and a whole brain mask and outputs a Brain Only Background Filled(BOBF) image. The non-brain parts in the image are filled with the user specified background value. All computations are performed in the precision of ﬂoat data. &lt;br /&gt;
# Registration - The resulting moving Image and the fixed image are given as inputs to the demons registrator.It uses the MultiResolutionPDEDeformableRegistration filter with NN extrapolation as interpolator and implements the demons deformable algorithm by computing the deformation field which will map a moving image onto a fixed image. It is assumed that the vector elements behave like ﬂoating point scalars. Each vector in the deformation field represent the distance between a geometric point in the input space and a point in the output space. The output image is generated by warping the input image with the deformation field using the ItkWarpImageFilter. WarpImageFilter warps an existing image with respect to a given deformation field. Typically the mapped position does not correspond to an integer pixel position in the input image. Interpolation via an image function is used to compute values at non-integer positions. We have used the LinearInterpolateImageFunction for our application. To write the output image we cast the image to the user specified output pixel type. &lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Inputs''''' &amp;lt;/span&amp;gt; Common input parameters.  All must be specified&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingVolume&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt;]: Required: input moving image&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Fixed Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedVolume&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-f&amp;lt;/span&amp;gt;]: Required: input fixed (target) image&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--inputPixelType&amp;lt;/span&amp;gt;]: Input volumes will be typecast to this format: float|short|ushort|int|uchar&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Outputs''''' &amp;lt;/span&amp;gt; Common output parameters.  At least one must be specified.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Image Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputVolume&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-o&amp;lt;/span&amp;gt;]: Required: output resampled moving image (will have the same physical space as the fixedVolume).&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Deformation Field Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputDeformationFieldVolume&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-O&amp;lt;/span&amp;gt;]: Output deformation field vector image (will have the same physical space as the fixedVolume).&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputPixelType&amp;lt;/span&amp;gt;]: outputVolume will be typecast to this format: float|short|ushort|int|uchar&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Interpolation Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--interpolationMode&amp;lt;/span&amp;gt;]: Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;'''''Registration Parameters''''' &amp;lt;/span&amp;gt; Input parameters controlling the behavior of the demons registration.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Registration Filter Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--registrationFilterType&amp;lt;/span&amp;gt;]: Registration Filter Type: Demons|FastSymmetricForces|Diffeomorphic|LogDemons|SymmetricLogDemons&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Deformation field smoothing sigma'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--smoothDeformationFieldSigma&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-s&amp;lt;/span&amp;gt;]: A gaussian smoothing value to be applied to the deformation feild at each iteration.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Pyramid Levels'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfPyramidLevels&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-n&amp;lt;/span&amp;gt;]: Number of image pyramid levels to use in the multi-resolution registration.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Shrink Factors'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumFixedPyramid&amp;lt;/span&amp;gt;]: The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Moving Shrink Factors'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--minimumMovingPyramid&amp;lt;/span&amp;gt;]: The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''the iteration count for each pyramid level'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--arrayOfPyramidLevelIterations&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-i&amp;lt;/span&amp;gt;]: The number of iterations for each pyramid level&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;''''' Input image pre-processing options ''''' &amp;lt;/span&amp;gt;  Operations to perform on the images before starting the registration. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Histogram Match'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--histogramMatch&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;]: Histogram Match the input images.  This is suitable for images of the same modality that may have different absolute scales, but the same overall intensity profile.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of histogram bins to use in histogramMatch'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfHistogramBins&amp;lt;/span&amp;gt;]: The number of histogram levels&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Number of Match Points'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--numberOfMatchPoints&amp;lt;/span&amp;gt;]: The number of match points for histrogramMatch&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Median Filter Size'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--medianFilterSize&amp;lt;/span&amp;gt;]: Median filter radius in all 3 directions.  When images have a lot of salt and pepper noise, this step can improve the registration.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;''''' Deformation field initialziation ''''' &amp;lt;/span&amp;gt;  Options for initializing the deformation field. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initial Deformation Field Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeWithDeformationField&amp;lt;/span&amp;gt;]: Initial deformation field vector image file name&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Initial Transform  Filename'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--initializeWithTransform&amp;lt;/span&amp;gt;]: Initial Transform filename&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;''''' Mask Options ''''' &amp;lt;/span&amp;gt;  Options for setting binary masks for the registration. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Mask Processing Mode'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--maskProcessingMode&amp;lt;/span&amp;gt;]: What mode to use for using the masks: NOMASK|ROIAUTO|ROI|BOBF.  If ROIAUTO is choosen, then the mask is implicitly defined using a otsu forground and hole filling algorithm. Where the Region Of Interest mode uses the masks to define what parts of the image should be used for computing the deformation field.  Brain Only Background Fill uses the masks to pre-process the input images by clipping and filling in the background with a predefined value.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Fixed Mask Filename'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--fixedBinaryVolume&amp;lt;/span&amp;gt;]: Mask filename for desired region of interest in the Fixed image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Input Moving Mask Filename'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--movingBinaryVolume&amp;lt;/span&amp;gt;]: Mask filename for desired region of interest in the Moving image.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''BOBF Lower Threshold'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--lowerThresholdForBOBF&amp;lt;/span&amp;gt;]: Lower threshold for performing BOBF&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''BOBF Upper Threshold'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--upperThresholdForBOBF&amp;lt;/span&amp;gt;]: Upper threshold for performing BOBF&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''BOBF Background Replacement Value'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--backgroundFillValue&amp;lt;/span&amp;gt;]: Replacement value to overwrite background when performing BOBF&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Seed For BOBF'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--seedForBOBF&amp;lt;/span&amp;gt;]: coordinates in all 3 directions for Seed when performing BOBF&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Seed For BOBF'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--neighborhoodForBOBF&amp;lt;/span&amp;gt;]: neighborhood in all 3 directions to be included when performing BOBF&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;''''' Advanced Options ''''' &amp;lt;/span&amp;gt;  Uncommon debugging or other advanced options. &lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Component displacement field prefix'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputDisplacementFieldPrefix&amp;lt;/span&amp;gt;]: Displacement field filename prefix for writing separate x, y, and z component images&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Output Checkerboard Volume'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputCheckerboardVolume&amp;lt;/span&amp;gt;]: Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Checkerboard Pattern Subdivisions'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--checkerboardPatternSubdivisions&amp;lt;/span&amp;gt;]: Number of Checkerboard subdivisions in all 3 directions&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Warp Normalized Images'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputNormalized&amp;lt;/span&amp;gt;]: Flag to warp and write the normalized images to output.  In normalized images the image values are fit-scaled to be between 0 and the maximum storage type value.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Write Intermediate Images'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--outputDebug&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-v&amp;lt;/span&amp;gt;]: Flag to write debugging images after each step.&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Gradient Type'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--gradient_type&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-t&amp;lt;/span&amp;gt;]: Type of gradient used for computing the demons force (0 is symmetrized, 1 is fixed image, 2 is moving image)&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Update field smoothing'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--upFieldSmoothing&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-g&amp;lt;/span&amp;gt;]: Smoothing sigma for the update field at each iteration&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Max Step Length'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--max_step_length&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt;]: Maximum length of an update vector (0: no restriction)&lt;br /&gt;
** &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;'''Turn off Diffeomorphism'''&amp;lt;/span&amp;gt; [&amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;--use_vanilla_dem&amp;lt;/span&amp;gt;][&amp;lt;span style=&amp;quot;color:pink&amp;quot;&amp;gt;-a&amp;lt;/span&amp;gt;]: Run vanilla demons algorithm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
===Notes from the Developer(s)===&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
===Tests===&lt;br /&gt;
http://testing.psychiatry.uiowa.edu/CDash&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
Publications related to this module go here. Links to pdfs would be useful.&lt;/div&gt;</summary>
		<author><name>Hjmjohnson</name></author>
		
	</entry>
</feed>