<?xml version="1.0" encoding="utf-8"?>
  <executable>
  <category>Registration</category>
  <title>Resample Image (BRAINS)</title>

  <description>
    This program collects together three common image processing tasks that all involve resampling an image volume: Resampling to a new resolution and spacing, applying a transformation (using an ITK transform IO mechanisms) and Warping (using a vector image deformation field).
  </description>
  <version>5.4.0</version>
  <documentation-url>https://slicer.readthedocs.io/en/latest/user_guide/modules/brainsresample.html</documentation-url>
  <license>https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt</license>
  <contributor>This tool was developed by Vincent Magnotta, Greg Harris, and Hans Johnson.</contributor>
  <acknowledgements>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.  </acknowledgements>

  <parameters>
    <label>Inputs</label>
    <description>Parameters for specifying the image to warp and resulting image space</description>

    <image>
      <name>inputVolume</name>
      <longflag alias="fixedVolume">inputVolume</longflag>
      <description>Image To Warp</description>
      <label>Image To Warp</label>
      <channel>input</channel>
    </image>

    <image>
      <name>referenceVolume</name>
      <longflag  alias="movingVolume">referenceVolume</longflag>
      <description>Reference image used only to define the output space. If not specified, the warping is done in the same space as the image to warp.</description>
      <label>Reference Image</label>
      <channel>input</channel>
    </image>
  </parameters>

  <parameters>
    <label>Outputs</label>
    <description>Resulting deformed image parameters</description>

    <image>
      <name>outputVolume</name>
      <longflag>outputVolume</longflag>
      <description>Resulting deformed image</description>
      <label>Output Image</label>
      <channel>output</channel>
    </image>


    <string-enumeration>
      <name>pixelType</name>
      <longflag>pixelType</longflag>
      <label>Pixel Type</label>
      <description>Specifies the pixel type for the input/output images.  If the type is "input", then infer from the input image.  The "binary" pixel type uses a modified algorithm whereby the image is read in as unsigned char, a signed distance map is created, signed distance map is resampled, and then a thresholded image of type unsigned char is written to disk.</description>
      <default>float</default>
      <element>float</element>
      <element>short</element>
      <element>ushort</element>
      <element>int</element>
      <element>uint</element>
      <element>uchar</element>
      <element>binary</element>
      <element>input</element>
    </string-enumeration>

  </parameters>

  <parameters>
    <label>Warping Parameters</label>
    <description>Parameters used to define home the image is warped</description>

    <transform fileExtensions=".nrrd" type="nonlinear">
      <name>deformationVolume</name>
      <longflag>deformationVolume</longflag>
      <description>Displacement Field to be used to warp the image (ITKv3 or earlier)</description>
      <label>Displacement Field (deprecated)</label>
      <channel>input</channel>
      <default></default>
    </transform>

    <transform fileExtensions=".h5,.hdf5,.mat,.txt">
      <name>warpTransform</name>
      <longflag>warpTransform</longflag>
      <label>Transform file</label>
      <description>Filename for the BRAINSFit transform (ITKv3 or earlier) or composite transform file (ITKv4)</description>
      <channel>input</channel>
      <default></default>
    </transform>

    <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, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc</description>
      <default>Linear</default>
      <element>NearestNeighbor</element>
      <element>Linear</element>
      <element>ResampleInPlace</element>
      <element>BSpline</element>
      <element>WindowedSinc</element>
      <element>Hamming</element>
      <element>Cosine</element>
      <element>Welch</element>
      <element>Lanczos</element>
      <element>Blackman</element>
    </string-enumeration>

    <boolean>
      <name>inverseTransform</name>
      <longflag>inverseTransform</longflag>
      <label>Compute inverse transform of given transformation?</label>
      <description>True/False is to compute inverse of given transformation. Default is false</description>
      <default>false</default>
    </boolean>
    <float>
      <name>defaultValue</name>
      <longflag>defaultValue</longflag>
      <label>Default Value</label>
      <description>Default voxel value</description>
      <default>0.0</default>
    </float>
  </parameters>


  <parameters advanced="true">
    <label>Advanced Options</label>
<!-- Not yet implemented
    <boolean>
      <name>invertTransform</name>
      <longflag>invertTransform</longflag>
      <label>Invert Linear Transform flag</label>
      <description>Perform transform inversion in itk physical space before applying the linear transform to the image.</description>
      <default>false</default>
    </boolean>
-->

    <integer-vector>
      <name>gridSpacing</name>
      <longflag>gridSpacing</longflag>
      <label>Add Grids</label>
      <description>Add warped grid to output image to help show the deformation that occurred with specified spacing.   A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane).  This is useful for making a 2D image of grid lines from the 3D space</description>
      <default></default>
    </integer-vector>
  </parameters>

  <parameters advanced="true">
    <label>Multiprocessing Control</label>
    <integer>
      <name>numberOfThreads</name>
      <longflag deprecatedalias="debugNumberOfThreads" >numberOfThreads</longflag>
      <label>Number Of Threads</label>
      <description>Explicitly specify the maximum number of threads to use.</description>
      <default>-1</default>
    </integer>
  </parameters>
</executable>
