Repository: nipy/nipype

Issue:
stdout of CommandLineInterface is not always complete
see for example "Slicer3 --launch BRAINSFit --xml"

Missing mask1 and mask2 arguments in doc example for Similarity
The mandatory arguments mask1 and mask2 are missing from the example here:

http://nipy.sourceforge.net/nipype/interfaces/generated/nipype.interfaces.nipy.utils.html

ApplyXFM does not set default value of required flag
from @davidgutman

Just noticed this, after scratching my head for a bit....  by default
it seems the ApplyXfm doesn't bass the applyxfm.inputs.apply_xfm=True
parameter... in which case it is rerunning the registration ...

I couldn't figure out why my transformation was working oddly and
realized it's because that flag wasn't being passed, and I
inadvertently assumed that that was the default behavior of ApplyXfm
(i.e. to apply an XFM)....

Not sure if this should be changed or not as the default behavior that
can be overridden (in which case.. you'd probably just want to use
fsl.FLIRT() anyway)..

More of a semantics thing I guess..

ApplyXfm
Code: http://github.com/nipy/nipype/blob/master/nipype/interfaces/fsl/preprocess.py#L495

Wraps command flirt

Currently just a light wrapper around FLIRT, with no modifications

ApplyXfm is used to apply an existing tranform to an image

Examples

> > > import nipype.interfaces.fsl as fsl
> > > from nipype.testing import example_data
> > > applyxfm = fsl.ApplyXfm()
> > > applyxfm.inputs.in_file = example_data('structural.nii')
> > > applyxfm.inputs.in_matrix_file = example_data('trans.mat')
> > > applyxfm.inputs.out_file = 'newfile.nii'
> > > applyxfm.inputs.reference = example_data('mni.nii')
> > > applyxfm.inputs.apply_xfm = True
> > > result = applyxfm.run()
> > > Inputs:

[Mandatory]
in_file: (an existing file name)
        input file
reference: (an existing file name)
        reference file

[Optional]
angle_rep: ('quaternion' or 'euler')
        representation of rotation angles
apply_xfm: (a boolean)
        apply transformation supplied by in_matrix_file
## 

David A Gutman, M.D. Ph.D.



Discussion:
@chrisfilo can you check this again?

Still applies.

From BASH:

```
filo@filolaptop:~$ Slicer3 --launch BRAINSFit --xml
<?xml version="1.0" encoding="utf-8"?>
<executable>
  <category>Registration</category>
  <title>BRAINSFit</title>
  <description>Uses the Mattes Mutual Registration algorithm to register a three-dimensional volume to a reference volume </description>
  <documentation-url>http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit</documentation-url>
  <license>https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt </license>
  <contributor>Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu</contributor>
  <acknowledgements>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)  </acknowledgements>
  <version>3.0.0</version>
  <parameters advanced="false">
    <label>Input Parameters</label>

    <image>
      <name>fixedVolume</name>
      <longflag>fixedVolume</longflag>
      <label>Fixed Image Volume</label>
      <description>The fixed image for registration by mutual information optimization.</description>
      <channel>input</channel>
      <default></default>
    </image>

    <image>
      <name>movingVolume</name>
      <longflag>movingVolume</longflag>
      <label>Moving Image Volume</label>
      <description>The moving image for registration by mutual information optimization.</description>
      <default></default>
      <channel>input</channel>
    </image>

    <!--
    <string-enumeration>
      <name>initializeTransformMode</name>
      <longflag>initializeTransformMode</longflag>
      <label>Intitialze Transform Mode</label>
      <description>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.</description>
      <default>useGeometryAlign</default>
      <element>Off</element>
      <element>useMomentsAlign</element>
      <element>useCenterOfHeadAlign</element>
      <element>useGeometryAlign</element>
    </string-enumeration>
    -->

  </parameters>
  <!-- -->
  <parameters>
    <label>Registration phases to use</label>
    <description>Parameters that define which registration steps to use.</description>

    <transform fileExtensions=".mat">
      <name>initialTransform</name>
      <longflag>initialTransform</longflag>
      <label>Initialize with previously generated transform</label>
      <description>Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.</description>
      <channel>input</channel>
    </transform>
    <boolean>
       <name>useMomentsAlign</name>
       <longflag>useMomentsAlign</longflag>
       <label>Initialize with MomentsAlign registration phase</label>
       <description>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.</description>
       <default>false</default>
    </boolean>
    <boolean>
       <name>useGeometryAlign</name>
       <longflag>useGeometryAlign</longflag>
       <label>Initialize with GeometryCenterAlign registration phase</label>
       <description>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.</description>
       <default>false</default>
    </boolean>
    <boolean>
       <name>useCenterOfHeadAlign</name>
       <longflag>useCenterOfHeadAlign</longflag>
       <label>Initialize with CenterOfHeadAlign registration phase</label>
       <description>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.</description>
       <default>false</default>
    </boolean>
    <boolean>
       <name>useRigid</name>
       <longflag>useRigid</longflag>
       <label>Include Rigid registration phase</label>
       <description>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.</description>
       <default>false</default>
    </boolean>
    <boolean>
       <name>useScaleVersor3D</name>
       <longflag>useScaleVersor3D</longflag>
       <label>Include ScaleVersor3D registration phase</label>
       <description>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.</description>
       <default>false</default>
    </boolean>
    <boolean>
       <name>useScaleSkewVersor3D</name>
       <longflag>useScaleSkewVersor3D</longflag>
       <label>Include ScaleSkewVersor3D registration phase</label>
       <description>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.</description>
       <default>false</default>
    </boolean>
    <boolean>
       <name>useAffine</name>
       <longflag>useAffine</longflag>
       <label>Include Affine registration phase</label>
       <description>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.</description>
       <default>false</default>
    </boolean>
    <boolean>
       <name>useBSpline</name>
       <longflag>useBSpline</longflag>
       <label>Include BSpline registration phase</label>
       <description>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.</description>
       <default>false</default>
    </boolean>
    <!--
    <string-enumeration>
      <name>registrationClass</name>
      <longflag>registrationClass</longflag>
      <label>Class of Registration</label>
      <description>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 "Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline".  Set to (O)ther when using the more flexible Transform Type flag under Registration Parameters settings.</description>
      <default>O</default>
      <element>R</element>
      <element>R+S</element>
      <element>R+S+S</element>
      <element>A</element>
      <element>BS</element>
      <element>O</element>
    </string-enumeration>
  -->
  </parameters>

  <parameters advanced="false">
    <label>Output Settings (At least one output must be specified.)</label>
    <transform fileExtensions=".mat" type="bspline" reference="movingVolume">
      <name>bsplineTransform</name>
      <longflag>bsplineTransform</longflag>
      <label>Slicer BSpline Transform</label>
      <description>(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</description>
      <channel>output</channel>
    </transform>

    <transform fileExtensions=".mat" type="linear" reference="movingVolume">
      <name>linearTransform</name>
      <longflag>linearTransform</longflag>
      <label>Slicer Linear Transform</label>
      <description>(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</description>
      <channel>output</channel>
    </transform>

    <transform fileExtensions=".mat" reference="movingVolume">
      <name>outputTransform</name>
      <longflag>outputTransform</longflag>
      <label>Output Transform</label>
      <description>(optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.</description>
      <channel>output</channel>
    </transform>


    <image>
      <name>outputVolume</name>
      <longflag>outputVolume</longflag>
      <label>Output Image Volume</label>
      <description>(optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.</description>
      <channel>output</channel>
      <default></default>
    </image>

    <string-enumeration>
      <name>outputVolumePixelType</name>
      <longflag>outputVolumePixelType</longflag>
      <label>Output Image Pixel Type</label>
      <description>The output image Pixel Type is the scalar datatype for representation of the Output Volume.</description>
      <default>float</default>
      <element>float</element>
      <element>short</element>
      <element>ushort</element>
      <element>int</element>
      <element>uint</element>
      <element>uchar</element>
    </string-enumeration>

 </parameters>
  <!-- -->
  <parameters advanced="true">
    <label>Registration Parameters</label>

    <string-vector>
      <name>transformType</name>
      <longflag>transformType</longflag>
      <label>Transform Type</label>
      <description>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.</description>
      <default></default>
    </string-vector>


    <integer-vector>
      <name>numberOfIterations</name>
      <longflag>numberOfIterations</longflag>
      <label>Number Of Iterations</label>
      <description>The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence</description>
      <default>1500</default>
    </integer-vector>

    <integer>
      <name>numberOfSamples</name>
      <longflag>numberOfSamples</longflag>
      <label>Number Of Samples</label>
      <description>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.</description>
      <default>100000</default>
    </integer>

    <double-vector>
      <name>minimumStepSize</name>
      <longflag>minimumStepSize</longflag>
      <label>Minimum Step Size</label>
      <description>Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.</description>
      <default>0.005</default>
    </double-vector>

    <double>
      <name>translationScale</name>
      <longflag deprecatedalias="spatialScale,transformScale">translationScale</longflag>
      <label>Transform Scale</label>
      <description>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.</description>
      <default>1000.0</default>
    </double>

    <double>
      <name>reproportionScale</name>
      <longflag>reproportionScale</longflag>
      <label>Reproportion Scale</label>
      <description>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</description>
      <default>1.0</default>
    </double>

    <double>
      <name>skewScale</name>
      <longflag>skewScale</longflag>
      <label>Skew Scale</label>
      <description>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</description>
      <default>1.0</default>
    </double>

    <integer-vector>
      <name>splineGridSize</name>
      <longflag>splineGridSize</longflag>
      <label>Number Of Grid Subdivisions</label>
      <description>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. </description>
      <default>14,10,12</default>
    </integer-vector>

    <double>
      <name>maxBSplineDisplacement</name>
      <longflag>maxBSplineDisplacement</longflag>
      <label>Maximum B-Spline Displacement</label>
      <description> 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.
      </description>
      <default>0.0</default>
    </double>

  </parameters>
  <!-- -->

  <parameters advanced="true">
    <label>Advanced Output Settings</label>

    <transform fileExtensions=".mat" type="linear">
      <name>strippedOutputTransform</name>
      <longflag>strippedOutputTransform</longflag>
      <label>Stripped Output Transform</label>
      <description>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.</description>
      <channel>output</channel>
    </transform>

    <double>
      <name>backgroundFillValue</name>
      <longflag>backgroundFillValue</longflag>
      <label>Background Fill Value</label>
      <description>Background fill value for output image.</description>
      <default>0.0</default>
    </double>

    <double>
      <name>maskInferiorCutOffFromCenter</name>
      <longflag>maskInferiorCutOffFromCenter</longflag>
      <label>Inferior Cut Off From Center</label>
      <description>For use with --useCenterOfHeadAlign (and --maskProcessingMode ROIAUTO): the cut-off below the image centers, in millimeters, </description>
      <default>1000.0</default>
    </double>

    <boolean>
      <name>scaleOutputValues</name>
      <longflag>scaleOutputValues</longflag>
      <label>Scale Output Values</label>
      <description>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.</description>
      <default>false</default>
    </boolean>

    <string-enumeration>
      <name>interpolationMode</name>
      <longflag>interpolationMode</longflag>
      <label>Interpolation Mode</label>
      <description>Type of interpolation to be used when applying transform to moving volume.  Options are Linear, NearestNeighbor, BSpline, or WindowedSinc</description>
      <default>Linear</default>
      <element>NearestNeighbor</element>
      <element>Linear</element>
      <element>BSpline</element>
      <element>WindowedSinc</element>
    </string-enumeration>
  </parameters>
  <!-- -->
  <parameters advanced="true">
    <label>Control of Mask Processing</label>

    <string-enumeration>
      <name>maskProcessingMode</name>
      <longflag>maskProcessingMode</longflag>
      <description>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.</description>
      <label>Mask Processing Mode</label>
      <default>NOMASK</default>
      <element>NOMASK</element>
      <element>ROIAUTO</element>
      <element>ROI</element>
    </string-enumeration>

    <image type="label">
      <name>outputFixedVolumeROI</name>
      <longflag>outputFixedVolumeROI</longflag>
      <label>Output Fixed Mask (ROIAUTO only)</label>
      <description>The ROI automatically found in fixed image.</description>
      <channel>output</channel>
    </image>

    <image type="label">
      <name>outputMovingVolumeROI</name>
      <longflag>outputMovingVolumeROI</longflag>
      <label>Output Moving Mask (ROIAUTO only)</label>
      <description>The ROI automatically found in moving image.</description>
      <channel>output</channel>
    </image>

    <image type="label">
      <name>fixedBinaryVolume</name>
      <longflag>fixedBinaryVolume</longflag>
      <label>Input Fixed Mask (ROI only)</label>
      <description>Fixed Image binary mask volume.</description>
      <default></default>
      <channel>input</channel>
    </image>

    <image type="label">
      <name>movingBinaryVolume</name>
      <longflag>movingBinaryVolume</longflag>
      <label>Input Moving Mask (ROI only)</label>
      <description>Moving Image binary mask volume.</description>
      <default></default>
      <channel>input</channel>
    </image>

  </parameters>
  <parameters advanced="true">
    <label>Special Input Image Parameters</label>

    <integer>
      <name>fixedVolumeTimeIndex</name>
      <longflag>fixedVolumeTimeIndex</longflag>
      <label>Fixed Image Time Index</label>
      <description>The index in the time series for the 3D fixed image to fit, if 4-dimensional.</description>
      <default>0</default>
    </integer>

    <integer>
      <name>movingVolumeTimeIndex</name>
      <longflag>movingVolumeTimeIndex</longflag>
      <label>Moving Image Time Index</label>
      <description>The index in the time series for the 3D moving image to fit, if 4-dimensional.</description>
      <default>0</default>
    </integer>

    <integer-vector>
      <name>medianFilterSize</name>
      <longflag>medianFilterSize</longflag>
      <label>Median Filter Size</label>
      <description>The radius for the optional MedianImageFilter preprocessing in all 3 directions.</description>
      <default>0,0,0</default>
    </integer-vector>

    <boolean>
       <name>histogramMatch</name>
       <flag>e</flag>
       <longflag deprecatedalias="use_histogram_matching">histogramMatch</longflag>
       <description>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.</description>
       <label>Histogram Match</label>
       <default>false</default>
    </boolean>
    <!-- NOTE numberOfMatchPoints=10, numberOfHistogramBins=50 was a good comprimise for speed for synthesized T1 to T1 data set testing-->
    <integer>
      <name>numberOfHistogramBins</name>
      <longflag>numberOfHistogramBins</longflag>
      <description>the number of histogram levels</description>
      <label>Number of Histogram Bins</label>
      <default>50</default>
    </integer>
    <integer>
      <name>numberOfMatchPoints</name>
      <longflag>numberOfMatchPoints</longflag>
      <description>the number of match points</description>
      <label>Number of Match Points</label>
      <default>10</default>
    </integer>
  </parameters>
  <!-- -->
  <!-- -->
  <parameters advanced="true">
    <label>Registration Debugging Parameters</label>

    <string-enumeration>
      <name>useCachingOfBSplineWeightsMode</name>
      <longflag>useCachingOfBSplineWeightsMode</longflag>
      <description>This is a 5x speed advantage at the expense of requiring much more memory.  Only relevant when transformType is BSpline.</description>
      <label>Caching BSpline Weights Mode</label>
      <default>ON</default>
      <element>ON</element>
      <element>OFF</element>
    </string-enumeration>

    <string-enumeration>
      <name>useExplicitPDFDerivativesMode</name>
      <longflag>useExplicitPDFDerivativesMode</longflag>
      <description>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.</description>
      <label>Explicit PDF Derivatives Mode</label>
      <default>AUTO</default>
      <element>AUTO</element>
      <element>ON</element>
      <element>OFF</element>
    </string-enumeration>

    <double>
      <name>ROIAutoDilateSize</name>
      <longflag>ROIAutoDilateSize</longflag>
      <label> ROIAuto Dilate Size</label>
      <description>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.</description>
      <default>0.0</default>
    </double>

    <double>
      <name>relaxationFactor</name>
      <longflag>relaxationFactor</longflag>
      <label>Relaxation Factor</label>
      <description>Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.</description>
      <default>0.5</default>
    </double>

    <double>
      <name>maximumStepSize</name>
      <longflag>maximumStepSize</longflag>
      <label>Maximum Step Size</label>
      <description>Internal debugging parameter, and should probably never be used from the command line.  This will be removed in the future.</description>
      <default>0.2</default>
    </double>

    <integer>
      <name>failureExitCode</name>
      <longflag>failureExitCode</longflag>
      <label>Failure Exit Code</label>
      <description>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.</description>
      <default>-1</default>
    </integer>

    <boolean>
      <name>writeTransformOnFailure</name>
      <longflag>writeTransformOnFailure</longflag>
      <label>Write Transform On Failure</label>
      <description>Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )</description>
      <default>0</default>
    </boolean>

    <integer>
      <name>debugNumberOfThreads</name>
      <longflag>debugNumberOfThreads</longflag>
      <label>debugNumberOfThreads</label>
      <description>Explicitly specify the maximum number of threads to use.</description>
      <default>-1</default>
    </integer>

    <integer>
      <name>debugLevel</name>
      <label>Debug option</label>
      <description>Display debug messages, and produce debug intermediate results.  0=OFF, 1=Minimal, 10=Maximum debugging.</description>
      <longflag deprecatedalias="debuglevel">debugLevel</longflag>
      <default>0</default>
    </integer>
    <double>
      <name>costFunctionConvergenceFactor</name>
      <longflag>costFunctionConvergenceFactor</longflag>
      <description> From itkLBFGSBOptimizer.h: Set/Get the CostFunctionConvergenceFactor. Algorithm terminates when the reduction in cost function is less than (factor * epsmcj) where epsmch is the machine precision. Typical values for factor: 1e+12 for low accuracy; 1e+7 for moderate accuracy and 1e+1 for extremely high accuracy.  1e+9 seems to work well.
      </description>
      <default>1e+9</default>
    </double>
    <double>
      <name>projectedGradientTolerance</name>
      <longflag>projectedGradientTolerance</longflag>
      <description> From itkLBFGSBOptimizer.h: Set/Get the ProjectedGradientTolerance. Algorithm terminates when the project gradient is below the tolerance. Default lbfgsb value is 1e-5, but 1e-4 seems to work well.
      </description>
      <default>1e-5</default>
    </double>

    <boolean>
      <name>UseDebugImageViewer</name>
      <flag>G</flag>
      <longflag>gui</longflag>
      <description>Display intermediate image volumes for debugging.  NOTE:  This is not part of the standard build sytem, and probably does nothing on your installation.</description>
      <default>false</default>
    </boolean>
    <boolean>
      <name>PromptAfterImageSend</name>
      <flag>p</flag>
      <longflag>promptUser</longflag>
      <description>Prompt the user to hit enter each time an image is sent to the DebugImageViewer</description>
      <default>false</default>
    </boolean>
  </parameters>
  <parameters advanced="true">
    <label>Risky Expert-only Parameters</label>

    <integer-vector>
      <name>permitParameterVariation</name>
      <longflag>permitParameterVariation</longflag>
      <label>Selective Permission for Transform Parameters to Vary</label>
      <description>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.</description>
      <default></default>
    </integer-vector>
<!-- //No longer in use
    <integer-vector>
      <name>fixedVolumeOrigin</name>
      <longflag>fixedVolumeOrigin</longflag>
      <label>Fixed Image Origin</label>
      <description>The coordinates of the origin of the fixed image.  This will over-ride the information read from disk and is VERY DANGEROUS.</description>
      <default>0,0,0</default>
    </integer-vector>

    <integer-vector>
      <name>movingVolumeOrigin</name>
      <longflag>movingVolumeOrigin</longflag>
      <label>Moving Image Origin</label>
      <description>The coordinates of the origin of the moving image.  This will over-ride the information read from disk and is VERY DANGEROUS.</description>
      <default>0,0,0</default>
    </integer-vector>
    -->

  </parameters>

</executable>
```

From Nipype (notice the truncated output):

```
In [4]: cm = CommandLine()
In [5]: cm.cmd = 'Slicer3 --launch BRAINSFit --xml'
In [6]: cm.run()
INFO:interface:stdout 2012-03-01T10:27:24.252722:<?xml version="1.0" encoding="utf-8"?>
INFO:interface:stdout 2012-03-01T10:27:24.252722:<executable>
INFO:interface:stdout 2012-03-01T10:27:24.252722:  <category>Registration</category>
INFO:interface:stdout 2012-03-01T10:27:24.252722:  <title>BRAINSFit</title>
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <description>Uses the Mattes Mutual Registration algorithm to register a three-dimensional volume to a reference volume </description>
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <documentation-url>http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit</documentation-url>
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <license>https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt </license>
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <contributor>Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu</contributor>
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <acknowledgements>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)  </acknowledgements>
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <version>3.0.0</version>
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <parameters advanced="false">
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <label>Input Parameters</label>
INFO:interface:stdout 2012-03-01T10:27:24.254470:
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <image>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <name>fixedVolume</name>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <longflag>fixedVolume</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <label>Fixed Image Volume</label>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <description>The fixed image for registration by mutual information optimization.</description>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <channel>input</channel>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <default></default>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    </image>
INFO:interface:stdout 2012-03-01T10:27:24.254470:
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <image>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <name>movingVolume</name>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <longflag>movingVolume</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <label>Moving Image Volume</label>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <description>The moving image for registration by mutual information optimization.</description>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <default></default>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <channel>input</channel>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    </image>
INFO:interface:stdout 2012-03-01T10:27:24.254470:
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <!--
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <string-enumeration>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <name>initializeTransformMode</name>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <longflag>initializeTransformMode</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <label>Intitialze Transform Mode</label>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <default>useGeometryAlign</default>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <element>Off</element>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <element>useMomentsAlign</element>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <element>useCenterOfHeadAlign</element>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <element>useGeometryAlign</element>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    </string-enumeration>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    -->
INFO:interface:stdout 2012-03-01T10:27:24.254470:
INFO:interface:stdout 2012-03-01T10:27:24.254470:  </parameters>
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <!-- -->
INFO:interface:stdout 2012-03-01T10:27:24.254470:  <parameters>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <label>Registration phases to use</label>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <description>Parameters that define which registration steps to use.</description>
INFO:interface:stdout 2012-03-01T10:27:24.254470:
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <transform fileExtensions=".mat">
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <name>initialTransform</name>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <longflag>initialTransform</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <label>Initialize with previously generated transform</label>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <description>Filename of transform used to initialize the registration.  This CAN NOT be used with either CenterOfHeadLAlign, MomentsAlign, GeometryAlign, or initialTransform file.</description>
INFO:interface:stdout 2012-03-01T10:27:24.254470:      <channel>input</channel>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    </transform>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <boolean>
INFO:interface:stdout 2012-03-01T10:27:24.254470:       <name>useMomentsAlign</name>
INFO:interface:stdout 2012-03-01T10:27:24.254470:       <longflag>useMomentsAlign</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.254470:       <label>Initialize with MomentsAlign registration phase</label>
INFO:interface:stdout 2012-03-01T10:27:24.254470:       <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.254470:       <default>false</default>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    </boolean>
INFO:interface:stdout 2012-03-01T10:27:24.254470:    <boolean>
INFO:interface:stdout 2012-03-01T10:27:24.254470:       <name>useGeometryAlign</name>
INFO:interface:stdout 2012-03-01T10:27:24.254470:       <longflag>useGeometryAlign</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.254470:       <label>Initialize with GeometryCenterAlign registration phase</label>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <default>false</default>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    </boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    <boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <name>useCenterOfHeadAlign</name>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <longflag>useCenterOfHeadAlign</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <label>Initialize with CenterOfHeadAlign registration phase</label>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <default>false</default>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    </boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    <boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <name>useRigid</name>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <longflag>useRigid</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <label>Include Rigid registration phase</label>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <default>false</default>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    </boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    <boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <name>useScaleVersor3D</name>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <longflag>useScaleVersor3D</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <label>Include ScaleVersor3D registration phase</label>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <default>false</default>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    </boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    <boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <name>useScaleSkewVersor3D</name>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <longflag>useScaleSkewVersor3D</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <label>Include ScaleSkewVersor3D registration phase</label>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <default>false</default>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    </boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    <boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <name>useAffine</name>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <longflag>useAffine</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <label>Include Affine registration phase</label>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <default>false</default>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    </boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    <boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <name>useBSpline</name>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <longflag>useBSpline</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <label>Include BSpline registration phase</label>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.270729:       <default>false</default>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    </boolean>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    <!--
INFO:interface:stdout 2012-03-01T10:27:24.270729:    <string-enumeration>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <name>registrationClass</name>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <longflag>registrationClass</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <label>Class of Registration</label>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <description>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 "Rigid,ScaleVersor3D,ScaleSkewVersor3D,Affine,BSpline".  Set to (O)ther when using the more flexible Transform Type flag under Registration Parameters settings.</description>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <default>O</default>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <element>R</element>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <element>R+S</element>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <element>R+S+S</element>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <element>A</element>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <element>BS</element>
INFO:interface:stdout 2012-03-01T10:27:24.270729:      <element>O</element>
INFO:interface:stdout 2012-03-01T10:27:24.270729:    </string-enumeration>
INFO:interface:stdout 2012-03-01T10:27:24.270729:  -->
INFO:interface:stdout 2012-03-01T10:27:24.270729:  </parameters>
INFO:interface:stdout 2012-03-01T10:27:24.270729:
INFO:interface:stdout 2012-03-01T10:27:24.270729:  <parameters advanced="false">
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <label>Output Settings (At least one output must be specified.)</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <transform fileExtensions=".mat" type="bspline" reference="movingVolume">
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>bsplineTransform</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>bsplineTransform</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Slicer BSpline Transform</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>(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</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <channel>output</channel>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </transform>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <transform fileExtensions=".mat" type="linear" reference="movingVolume">
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>linearTransform</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>linearTransform</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Slicer Linear Transform</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>(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</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <channel>output</channel>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </transform>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <transform fileExtensions=".mat" reference="movingVolume">
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>outputTransform</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>outputTransform</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Output Transform</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>(optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <channel>output</channel>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </transform>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <image>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>outputVolume</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>outputVolume</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Output Image Volume</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>(optional) Output image for registration. NOTE: You must select either the outputTransform or the outputVolume option.</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <channel>output</channel>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <default></default>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </image>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <string-enumeration>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>outputVolumePixelType</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>outputVolumePixelType</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Output Image Pixel Type</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>The output image Pixel Type is the scalar datatype for representation of the Output Volume.</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <default>float</default>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <element>float</element>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <element>short</element>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <element>ushort</element>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <element>int</element>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <element>uint</element>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <element>uchar</element>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </string-enumeration>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487: </parameters>
INFO:interface:stdout 2012-03-01T10:27:24.278487:  <!-- -->
INFO:interface:stdout 2012-03-01T10:27:24.278487:  <parameters advanced="true">
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <label>Registration Parameters</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <string-vector>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>transformType</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>transformType</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Transform Type</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <default></default>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </string-vector>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <integer-vector>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>numberOfIterations</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>numberOfIterations</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Number Of Iterations</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>The maximum number of iterations to try before failing to converge.  Use an explicit limit like 500 or 1000 to manage risk of divergence</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <default>1500</default>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </integer-vector>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <integer>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>numberOfSamples</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>numberOfSamples</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Number Of Samples</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>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.</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <default>100000</default>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </integer>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <double-vector>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>minimumStepSize</name>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <longflag>minimumStepSize</longflag>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <label>Minimum Step Size</label>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <description>Each step in the optimization takes steps at least this big.  When none are possible, registration is complete.</description>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <default>0.005</default>
INFO:interface:stdout 2012-03-01T10:27:24.278487:    </double-vector>
INFO:interface:stdout 2012-03-01T10:27:24.278487:
INFO:interface:stdout 2012-03-01T10:27:24.278487:    <double>
INFO:interface:stdout 2012-03-01T10:27:24.278487:      <name>translationScale</name>
Out[6]: <nipype.interfaces.base.InterfaceResult at 0x1c07ad0>
```




Resolving patch:
diff --git a/nipype/interfaces/fsl/__init__.py b/nipype/interfaces/fsl/__init__.py
--- a/nipype/interfaces/fsl/__init__.py
+++ b/nipype/interfaces/fsl/__init__.py
@@ -15,7 +15,8 @@
 from .utils import (Smooth, Merge, ExtractROI, Split, ImageMaths, ImageMeants,
                     ImageStats, FilterRegressor, Overlay, Slicer,
                     PlotTimeSeries, PlotMotionParams, ConvertXFM,
-                    SwapDimensions, PowerSpectrum, Reorient2Std)
+                    SwapDimensions, PowerSpectrum, SigLoss, Reorient2Std,
+                    Complex)
 from .dti import (EddyCorrect, BEDPOSTX, DTIFit, ProbTrackX, VecReg, ProjThresh,
                   FindTheBiggest, DistanceMap, TractSkeleton, XFibres,
                   MakeDyadicVectors)
diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py
--- a/nipype/interfaces/fsl/preprocess.py
+++ b/nipype/interfaces/fsl/preprocess.py
@@ -1157,14 +1157,15 @@ def _gen_filename(self, name):
 class FUGUEInputSpec(FSLCommandInputSpec):
     in_file = File(exists=True, argstr='--in=%s',
                    desc='filename of input volume')
-    unwarped_file = File(argstr='--unwarp=%s', genfile=True,
-                         desc='apply unwarping and save as filename', hash_files=False)
-
-    save_warped = traits.Bool(desc='apply forward warp and save')
-
-    warped_file = File(argstr='--warp=%s', genfile=True,
-                         desc='apply forward warp and save as filename', hash_files=False)
-
+    unwarped_file = File(
+        argstr='--unwarp=%s', genfile=True,
+        desc='apply unwarping and save as filename', hash_files=False)
+    forward_warping = traits.Bool(
+        False, usedefault=True,
+        desc='apply forward warping instead of unwarping')
+    warped_file = File(argstr='--warp=%s', 
+                       desc='apply forward warping and save as filename',
+                       hash_files=False)
     phasemap_file = File(exists=True, argstr='--phasemap=%s',
                          desc='filename for input phase image')
     dwell_to_asym_ratio = traits.Float(argstr='--dwelltoasym=%.10f',
@@ -1180,7 +1181,7 @@ class FUGUEInputSpec(FSLCommandInputSpec):
 
     save_shift = traits.Bool(desc='output pixel shift volume')
 
-    shift_out_file = traits.File(argstr='--saveshift=%s', genfile=True,
+    shift_out_file = traits.File(argstr='--saveshift=%s', 
                            desc='filename for saving pixel shift volume', hash_files=False)
 
     shift_in_file = File(exists=True, argstr='--loadshift=%s',
@@ -1216,25 +1217,20 @@ class FUGUEInputSpec(FSLCommandInputSpec):
                              desc='apply intensity correction only')
     mask_file = File(exists=True, argstr='--mask=%s',
                      desc='filename for loading valid mask')
-    save_unmasked_fmap = traits.Either(traits.Bool,
-                                       traits.File,
-                                       argstr='--unmaskfmap=%s',
-                                       requires=['fmap_out_file'],
-                                       desc='saves the unmasked fieldmap when using --savefmap', hash_files=False)
-    save_unmasked_shift = traits.Either(traits.Bool,
-                                       traits.File,
-                                       argstr='--unmaskshift=%s',
-                                       requires=['shift_out_file'],
-                                       desc='saves the unmasked shiftmap when using --saveshift', hash_files=False)
-    nokspace = traits.Bool(
-        argstr='--nokspace', desc='do not use k-space forward warping')
+    save_unmasked_fmap = traits.Bool(argstr='--unmaskfmap',
+                                     requires=['fmap_out_file'],
+                                     desc='saves the unmasked fieldmap when using --savefmap')
+    save_unmasked_shift = traits.Bool(argstr='--unmaskshift',
+                                      requires=['shift_out_file'],
+                                      desc='saves the unmasked shiftmap when using --saveshift')
+    nokspace = traits.Bool(argstr='--nokspace', desc='do not use k-space forward warping')
 
 
 class FUGUEOutputSpec(TraitedSpec):
-    unwarped_file = File(exists=True, desc='unwarped file')
+    unwarped_file = File(desc='unwarped file')
+    warped_file = File(desc='forward warped file')
     shift_out_file = File(desc='voxel shift map file')
-    warped_file = File(desc='warped file')
-
+    fmap_out_file = File(desc='fieldmap file')
 
 class FUGUE(FSLCommand):
     """Use FSL FUGUE to unwarp epi's with fieldmaps
@@ -1268,43 +1264,40 @@ def _parse_inputs(self, skip=None):
 
     def _list_outputs(self):
         outputs = self._outputs().get()
-        out_file = self.inputs.unwarped_file
-        if not isdefined(out_file):
-            out_file = self._gen_fname(self.inputs.in_file,
-                                      suffix='_unwarped')
-        outputs['unwarped_file'] = os.path.abspath(out_file)
-
-        if isdefined(self.inputs.save_shift) and self.inputs.save_shift:
-            shift_out = self.inputs.shift_out_file
-            if not isdefined(shift_out):
-                shift_out = self._gen_fname(
-                    self.inputs.in_file, suffix='_shift')
+        if self.inputs.forward_warping:
+            out_field = 'warped_file'
+        else: 
+            out_field = 'unwarped_file'
 
-            outputs['shift_out_file'] = os.path.abspath(shift_out)
-
-        if isdefined(self.inputs.save_warped) and self.inputs.save_warped:
-            warped_out = self.inputs.warped_file
-            if not isdefined(warped_out):
-                warped_out = self._gen_fname(
-                    self.inputs.in_file, suffix='_fwdwarp')
-
-            outputs['warped_file'] = os.path.abspath(warped_out)
-            del outputs['unwarped_file']
+        out_file = getattr(self.inputs,out_field)
+        if not isdefined(out_file):
+            if isdefined(self.inputs.in_file):
+                out_file = self._gen_fname(self.inputs.in_file,
+                                           suffix='_'+out_field[:-5])
+        if isdefined(out_file):
+            outputs[out_field] = os.path.abspath(out_file)
+        if isdefined(self.inputs.fmap_out_file):
+            outputs['fmap_out_file'] = os.path.abspath(self.inputs.fmap_out_file)
+        if isdefined(self.inputs.shift_out_file):
+            outputs['shift_out_file'] = os.path.abspath(self.inputs.shift_out_file)
 
         return outputs
 
     def _gen_filename(self, name):
-        if name == 'unwarped_file':
+        if name == 'unwarped_file' and not self.inputs.forward_warping:
             return self._list_outputs()['unwarped_file']
-
-        if name == 'warped_file':
+        if name == 'warped_file' and self.inputs.forward_warping:
             return self._list_outputs()['warped_file']
-
-        if name == 'shift_out_file':
-            return self._list_outputs()['shift_out_file']
-
         return None
 
+    def _parse_inputs(self,skip=None):
+        if skip==None:
+            skip=[]
+        if self.inputs.forward_warping or not isdefined(self.inputs.in_file):
+            skip+=['unwarped_file']
+        if not self.inputs.forward_warping or not isdefined(self.inputs.in_file):
+            skip+=['warped_file']
+        return super(FUGUE,self)._parse_inputs(skip=skip)
 
 class PRELUDEInputSpec(FSLCommandInputSpec):
     complex_phase_file = File(exists=True, argstr='--complex=%s',
diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py
--- a/nipype/interfaces/fsl/utils.py
+++ b/nipype/interfaces/fsl/utils.py
@@ -1152,6 +1152,54 @@ def _list_outputs(self):
                                                   basename='maskexf')
         return outputs
 
+class SigLossInputSpec(FSLCommandInputSpec):
+    in_file = File(mandatory=True,
+                   exists=True,
+                   argstr='-i %s',
+                   desc='b0 fieldmap file')
+    out_file = File(argstr='-s %s',
+                    desc='output signal loss estimate file',
+                    genfile=True)
+    
+    mask_file = File(exists=True,
+                     argstr='-m %s',
+                     desc='brain mask file')
+    echo_time = traits.Float(argstr='--te=%f',
+                             desc='echo time in seconds')
+    slice_direction = traits.Enum('x','y','z',
+                                  argstr='-d %s',
+                                  desc='slicing direction')
+class SigLossOuputSpec(TraitedSpec):
+    out_file = File(exists=True,
+                    desc='signal loss estimate file')
+
+class SigLoss(FSLCommand):
+    """Estimates signal loss from a field map (in rad/s)
+
+    Examples
+    --------
+    >>> sigloss = Sigloss()
+    >>> sigloss.inputs.in_file = "phase.nii"
+    >>> sigloss.inputs.echo_time = 0.03
+    >>> res = sigloss.run() # doctest: +SKIP
+    """
+    input_spec = SigLossInputSpec
+    output_spec = SigLossOuputSpec
+    _cmd = 'sigloss'
+
+    def _list_outputs(self):
+        outputs = self.output_spec().get()
+        outputs['out_file'] = self.inputs.out_file
+        if not isdefined(outputs['out_file']) and isdefined(self.inputs.in_file):
+            outputs['out_file']=self._gen_fname(self.inputs.in_file,
+                                                suffix='_sigloss')
+        return outputs
+    
+    def _gen_filename(self, name):
+        if name=='out_file':
+            return self._list_outputs()['out_file']
+        return None
+    
 class Reorient2StdInputSpec(FSLCommandInputSpec):
     in_file = File(exists=True, mandatory=True, argstr="%s")
     out_file = File(genfile=True, hash_files=False, argstr="%s")
@@ -1188,3 +1236,130 @@ def _list_outputs(self):
         else:
             outputs['out_file'] = os.path.abspath(self.inputs.out_file)
         return outputs
+
+
+class ComplexInputSpec(FSLCommandInputSpec):
+    complex_in_file = File(exists=True, argstr="%s", position=2)
+    complex_in_file2 = File(exists=True, argstr="%s", position=3)
+
+    real_in_file = File(exists=True, argstr="%s", position=2)
+    imaginary_in_file = File(exists=True, argstr="%s", position=3)
+    magnitude_in_file = File(exists=True, argstr="%s", position=2)
+    phase_in_file = File(exists=True, argstr='%s', position=3)
+
+    _ofs = ['complex_out_file',
+            'magnitude_out_file','phase_out_file',
+            'real_out_file','imaginary_out_file']
+    _conversion = ['real_polar','real_cartesian',
+                   'complex_cartesian','complex_polar',
+                   'complex_split','complex_merge',]
+
+    complex_out_file = File(genfile=True, argstr="%s", position=-3, 
+                            xor=_ofs+_conversion[:2])
+    magnitude_out_file = File(genfile=True, argstr="%s", position=-4,
+                              xor=_ofs[:1]+_ofs[3:]+_conversion[1:])
+    phase_out_file = File(genfile=True, argstr="%s", position=-3,
+                          xor=_ofs[:1]+_ofs[3:]+_conversion[1:])
+    real_out_file = File(genfile=True, argstr="%s", position=-4,
+                         xor=_ofs[:3]+_conversion[:1]+_conversion[2:])
+    imaginary_out_file = File(genfile=True, argstr="%s", position=-3,
+                              xor=_ofs[:3]+_conversion[:1]+_conversion[2:])
+
+    start_vol = traits.Int(position=-2, argstr='%d')
+    end_vol = traits.Int(position=-1, argstr='%d')
+
+    real_polar = traits.Bool(
+        argstr = '-realpolar', xor = _conversion, position=1,)
+#        requires=['complex_in_file','magnitude_out_file','phase_out_file'])
+    real_cartesian = traits.Bool(
+        argstr = '-realcartesian', xor = _conversion, position=1,)
+#        requires=['complex_in_file','real_out_file','imaginary_out_file'])
+    complex_cartesian = traits.Bool(
+        argstr = '-complex', xor = _conversion, position=1,)
+#        requires=['real_in_file','imaginary_in_file','complex_out_file'])
+    complex_polar = traits.Bool(
+        argstr = '-complexpolar', xor = _conversion, position=1,)
+#        requires=['magnitude_in_file','phase_in_file',
+#                  'magnitude_out_file','phase_out_file'])
+    complex_split = traits.Bool(
+        argstr = '-complexsplit', xor = _conversion, position=1,)
+#        requires=['complex_in_file','complex_out_file'])
+    complex_merge = traits.Bool(
+        argstr = '-complexmerge', xor = _conversion + ['start_vol','end_vol'],
+        position=1,)
+#        requires=['complex_in_file','complex_in_file2','complex_out_file'])
+
+class ComplexOuputSpec(TraitedSpec):
+    magnitude_out_file = File()
+    phase_out_file = File()
+    real_out_file = File()
+    imaginary_out_file = File()
+    complex_out_file = File()
+    
+    
+class Complex(FSLCommand):
+    """fslcomplex is a tool for converting complex data
+    Examples
+    --------
+    >>> cplx = Complex()
+    >>> cplx.inputs.complex_in_file = "complex.nii"
+    >>> cplx.real_polar = True
+    >>> res = cplx.run() # doctest: +SKIP
+
+    """
+    _cmd = 'fslcomplex'
+    input_spec = ComplexInputSpec
+    output_spec = ComplexOuputSpec
+
+    def _parse_inputs(self, skip=None):
+        if skip == None:
+            skip = []
+        if self.inputs.real_cartesian:
+            skip += self.inputs._ofs[:3]
+        elif self.inputs.real_polar:
+            skip += self.inputs._ofs[:1]+self.inputs._ofs[3:]
+        else:
+            skip += self.inputs._ofs[1:]
+        return super(Complex,self)._parse_inputs(skip)
+
+    def _gen_filename(self, name):
+        if name == 'complex_out_file':
+            if self.inputs.complex_cartesian:
+                in_file = self.inputs.real_in_file
+            elif self.inputs.complex_polar:
+                in_file = self.inputs.magnitude_in_file
+            elif self.inputs.complex_split or self.inputs.complex_merge:
+                in_file = self.inputs.complex_in_file
+            else:
+                return None
+            return self._gen_fname(in_file, suffix="_cplx")
+        elif name =='magnitude_out_file':
+            return self._gen_fname(self.inputs.complex_in_file, suffix="_mag")
+        elif name =='phase_out_file':
+            return self._gen_fname(self.inputs.complex_in_file,suffix="_phase")
+        elif name =='real_out_file':
+            return self._gen_fname(self.inputs.complex_in_file, suffix="_real")
+        elif name =='imaginary_out_file':
+            return self._gen_fname(self.inputs.complex_in_file, suffix="_imag")
+        return None
+
+    def _get_output(self,name):
+        output = getattr(self.inputs,name)
+        if not isdefined(output):
+            output = self._gen_filename(name)
+        return os.path.abspath(output)
+
+    def _list_outputs(self):
+        outputs = self.output_spec().get()
+        if self.inputs.complex_cartesian or self.inputs.complex_polar or \
+                self.inputs.complex_split or self.inputs.complex_merge:
+            outputs['complex_out_file'] = self._get_output('complex_out_file')
+        elif self.inputs.real_cartesian:
+            outputs['real_out_file'] = self._get_output('real_out_file')
+            outputs['imaginary_out_file'] = self._get_output('imaginary_out_file')
+        elif self.inputs.real_polar:
+            outputs['magnitude_out_file'] = self._get_output('magnitude_out_file')
+            outputs['phase_out_file'] = self._get_output('phase_out_file')
+        return outputs
+
+


Test patch: