<?xml version="1.0" encoding="UTF-8"?>
<executable>
  <category>Diffusion.Utilities</category>
  <title>Resample DTI Volume</title>
  <description><![CDATA[Resampling an image is a very important task in image analysis. It is especially important in the frame of image registration. This module implements DT image resampling through the use of itk Transforms. The resampling is controlled by the Output Spacing. "Resampling" is performed in space coordinates, not pixel/grid coordinates. It is quite important to ensure that image spacing is properly set on the images involved. The interpolator is required since the mapping from one space to the other will often require evaluation of the intensity of the image at non-grid positions.]]></description>
  <version>1.0.2</version>
  <documentation-url>https://slicer.readthedocs.io/en/latest/user_guide/modules/resampledtivolume.html</documentation-url>
  <license/>
  <contributor>Francois Budin (UNC)</contributor>
  <acknowledgements><![CDATA[This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from http://nihroadmap.nih.gov/bioinformatics]]></acknowledgements>
  <parameters>
    <label>Input/Output</label>
    <description><![CDATA[Input/output parameters]]></description>
    <image type="tensor">
      <name>inputVolume</name>
      <label>Input Volume</label>
      <channel>input</channel>
      <index>0</index>
      <description><![CDATA[Input volume to be resampled]]></description>
    </image>
    <image type="tensor" reference="inputVolume">
      <name>outputVolume</name>
      <label>Output Volume</label>
      <channel>output</channel>
      <index>1</index>
      <description><![CDATA[Resampled Volume]]></description>
    </image>
    <image type="any">
      <name>referenceVolume</name>
      <label>Reference Volume (To Set Output Parameters)</label>
      <channel>input</channel>
      <flag>-R</flag>
      <longflag>--Reference</longflag>
      <description><![CDATA[Reference Volume (spacing,size,orientation,origin)]]></description>
      <default/>
    </image>
  </parameters>
  <parameters>
    <label>Transform Parameters</label>
    <description><![CDATA[Parameters used to transform the input image into the output image]]></description>
    <transform fileExtensions=".h5">
      <name>transformationFile</name>
      <label>Transform Node</label>
      <flag>-f</flag>
      <longflag>--transformationFile</longflag>
      <default/>
      <channel>input</channel>
    </transform>
    <image type="vector">
      <name>deffield</name>
      <label>Deformation Field Volume</label>
      <channel>input</channel>
      <flag>-H</flag>
      <longflag>--defField</longflag>
      <description><![CDATA[File containing the deformation field (3D vector image containing vectors with 3 components)]]></description>
      <default/>
    </image>
    <string-enumeration>
      <name>typeOfField</name>
      <longflag>--hfieldtype</longflag>
      <description><![CDATA[Set if the deformation field is an -Field]]></description>
      <label>Displacement or h-Field</label>
      <element>displacement</element>
      <element>h-Field</element>
      <default>h-Field</default>
    </string-enumeration>
  </parameters>
  <parameters>
    <label>Processing Options</label>
    <string-enumeration>
      <name>interpolationType</name>
      <flag>-i</flag>
      <longflag>--interpolation</longflag>
      <description><![CDATA[Sampling algorithm (linear , nn (nearest neighbor), ws (WindowedSinc), bs (BSpline) )]]></description>
      <label>Interpolation</label>
      <element>linear</element>
      <element>nn</element>
      <element>ws</element>
      <element>bs</element>
      <default>linear</default>
    </string-enumeration>
    <boolean>
      <name>noMeasurementFrame</name>
      <longflag>--noMeasurementFrame</longflag>
      <description><![CDATA[Do not use the measurement frame that is in the input image to transform the tensors. Uses the image orientation instead]]></description>
      <label>No Measurement Frame</label>
      <default>false</default>
    </boolean>
    <string-enumeration>
      <name>correction</name>
      <longflag>--correction</longflag>
      <description><![CDATA[Correct the tensors if computed tensor is not semi-definite positive]]></description>
      <label>Tensors Correction</label>
      <element>zero</element>
      <element>none</element>
      <element>abs</element>
      <element>nearest</element>
      <default>zero</default>
    </string-enumeration>
  </parameters>
  <parameters advanced="true">
    <label>Tensor Transform Type</label>
    <string-enumeration>
      <name>ppd</name>
      <longflag>--transform_tensor_method</longflag>
      <flag>-T</flag>
      <description><![CDATA[Chooses between 2 methods to transform the tensors: Finite Strain (FS), faster but less accurate, or Preservation of the Principal Direction (PPD)]]></description>
      <label>Finite Strain (FS) or \nPreservation of the Principal Direction (PPD)</label>
      <element>PPD</element>
      <element>FS</element>
      <default>PPD</default>
    </string-enumeration>
  </parameters>
  <parameters advanced="true">
    <label>Advanced Transform Parameters</label>
    <description><![CDATA[Those parameters should normally not be modified]]></description>
    <string-enumeration>
      <name>transformsOrder</name>
      <longflag>--transform_order</longflag>
      <description><![CDATA[Select in what order the transforms are read]]></description>
      <label>Transforms Order</label>
      <element>input-to-output</element>
      <element>output-to-input</element>
      <default>output-to-input</default>
    </string-enumeration>
    <boolean>
      <name>notbulk</name>
      <longflag>--notbulk</longflag>
      <description><![CDATA[The transform following the BSpline transform is not set as a bulk transform for the BSpline transform]]></description>
      <label>Not a Bulk Transform</label>
      <default>false</default>
    </boolean>
    <boolean>
      <name>space</name>
      <longflag>--spaceChange</longflag>
      <description><![CDATA[Space Orientation between transform and image is different (RAS/LPS) (warning: if the transform is a Transform Node in Slicer3, do not select)]]></description>
      <label>Space Orientation inconsistency (between transform and image)</label>
      <default>false</default>
    </boolean>
  </parameters>
  <parameters advanced="true">
    <label>Advanced Rigid/Affine Parameters</label>
    <point multiple="false" coordinateSystem="lps">
      <name>rotationPoint</name>
      <flag>-r</flag>
      <longflag>--rotation_point</longflag>
      <description><![CDATA[Center of rotation (only for rigid and affine transforms)]]></description>
      <label>Rotation Center</label>
      <default>0,0,0</default>
    </point>
    <boolean>
      <name>centeredTransform</name>
      <flag>-c</flag>
      <longflag>--centered_transform</longflag>
      <description><![CDATA[Set the center of the transformation to the center of the input image (only for rigid and affine transforms)]]></description>
      <label>Centered Transform</label>
      <default>false</default>
    </boolean>
    <string-enumeration>
      <name>imageCenter</name>
      <longflag>--image_center</longflag>
      <description><![CDATA[Image to use to center the transform (used only if "Centered Transform" is selected)]]></description>
      <label>Image Center</label>
      <element>input</element>
      <element>output</element>
      <default>input</default>
    </string-enumeration>
    <boolean>
      <name>inverseITKTransformation</name>
      <flag>-b</flag>
      <longflag>--Inverse_ITK_Transformation</longflag>
      <description><![CDATA[Inverse the transformation before applying it from output image to input image (only for rigid and affine transforms)]]></description>
      <label>Inverse Transformation</label>
      <default>false</default>
    </boolean>
  </parameters>
  <parameters advanced="true">
    <label>Manual Output Parameters</label>
    <description><![CDATA[Parameters of the output image]]></description>
    <double-vector>
      <name>outputImageSpacing</name>
      <flag>-s</flag>
      <longflag>--spacing</longflag>
      <description><![CDATA[Spacing along each dimension (0 means use input spacing)]]></description>
      <label>Spacing</label>
      <default>0,0,0</default>
    </double-vector>
    <double-vector>
      <name>outputImageSize</name>
      <flag>-z</flag>
      <longflag>--size</longflag>
      <description><![CDATA[Size along each dimension (0 means use input size)]]></description>
      <label>Size</label>
      <default>0,0,0</default>
    </double-vector>
    <point multiple="false" coordinateSystem="lps">
      <name>outputImageOrigin</name>
      <flag>-O</flag>
      <longflag>--origin</longflag>
      <description><![CDATA[Origin of the output Image]]></description>
      <label>Origin</label>
      <default/>
    </point>
    <double-vector>
      <name>directionMatrix</name>
      <flag>-d</flag>
      <longflag>--direction_matrix</longflag>
      <description><![CDATA[9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)]]></description>
      <label>Direction Matrix</label>
      <default>0,0,0,0,0,0,0,0,0</default>
    </double-vector>
  </parameters>
  <parameters advanced="true">
    <label>Advanced Resampling Parameters</label>
    <description><![CDATA[Parameters used for resampling]]></description>
    <integer>
      <name>numberOfThread</name>
      <flag>-n</flag>
      <longflag>--number_of_thread</longflag>
      <description><![CDATA[Number of thread used to compute the output image]]></description>
      <label>Number Of Threads</label>
      <default>0</default>
    </integer>
    <double>
      <name>defaultPixelValue</name>
      <flag>-p</flag>
      <longflag>--default_pixel_value</longflag>
      <description><![CDATA[Default pixel value for samples falling outside of the input region]]></description>
      <label>Default Pixel Value</label>
      <default>1e-10</default>
    </double>
  </parameters>
  <parameters advanced="true">
    <label>Windowed Sinc Interpolate Function Parameters</label>
    <description><![CDATA[Parameters used for the Windowed Sinc interpolation]]></description>
    <string-enumeration>
      <name>windowFunction</name>
      <flag>-W</flag>
      <longflag>--window_function</longflag>
      <description><![CDATA[Window Function \nh = Hamming \nc = Cosine \nw = Welch \nl = Lanczos \nb = Blackman]]></description>
      <label>Window Function</label>
      <element>h</element>
      <element>c</element>
      <element>w</element>
      <element>l</element>
      <element>b</element>
      <default>c</default>
    </string-enumeration>
  </parameters>
  <parameters advanced="true">
    <label>BSpline Interpolate Function Parameters</label>
    <description><![CDATA[Parameters used for the BSpline interpolation]]></description>
    <integer>
      <name>splineOrder</name>
      <flag>-o</flag>
      <longflag>--spline_order</longflag>
      <description><![CDATA[Spline Order (Spline order may be from 0 to 5)]]></description>
      <label>Spline Order</label>
      <default>3</default>
    </integer>
  </parameters>
  <parameters advanced="true">
    <label>Manual Transform (Used only if no transform node set)</label>
    <double-vector>
      <name>transformMatrix</name>
      <flag>-m</flag>
      <longflag>--transform_matrix</longflag>
      <description><![CDATA[12 parameters of the transform matrix by rows ( --last 3 being translation-- )]]></description>
      <label>Transform Matrix</label>
      <default>1,0,0,0,1,0,0,0,1,0,0,0</default>
    </double-vector>
    <string-enumeration>
      <name>transformType</name>
      <flag>-t</flag>
      <longflag>--transform</longflag>
      <description><![CDATA[Transform algorithm\nrt = Rigid Transform\na = Affine Transform]]></description>
      <label>Transform Type</label>
      <element>rt</element>
      <element>a</element>
      <default>a</default>
    </string-enumeration>
  </parameters>
</executable>
