<?xml version="1.0" encoding="utf-8"?>
<executable>
  <category>Tractography.Stochastic</category>
  <title>Stochastic Tractography Filter</title>
  <description>
  Generates a VTK XML polydata file that contains a collection of sampled fiber tracts.
  Each fiber tract is a sample from the fiber tract posterior probability distribution.
  </description>
  <version>1.0</version>
  <license></license>
  <contributor>Tri Ngo (tringo@gmail.com)</contributor>

  <parameters>
    <label>
    Stochastic Tractography Parameters
    </label>
    <description>
    Parameters for the Stochastic Tractography algorithm
    </description>

    <integer>
      <name>labelnumber</name>
      <flag>l</flag>
      <longflag>labelnumber</longflag>
      <description>Label Number to use as seed points</description>
      <label>Seed Point(s) Label Number</label>
      <default>0</default>
      <constraints>
        <minimum>0</minimum>
        <step>1</step>
      </constraints>
    </integer>
       
    <integer>
      <name>totaltracts</name>
      <flag>t</flag>
      <longflag>totaltracts</longflag>
      <description>Number of Sample Tracts</description>
      <label>Total Tracts</label>
      <default>100</default>
      <constraints>
        <minimum>0</minimum>
        <step>1</step>
      </constraints>
    </integer>

    <integer>
      <name>maxtractlength</name>
      <flag>m</flag>
      <longflag>maxtractlength</longflag>
      <description>Maximum Length of Sample Tract in real dimensions (usually millimeters)</description>
      <label>Maximum Tract Length (mm)</label>
      <default>200</default>
      <constraints>
        <minimum>0</minimum>
        <step>1</step>
      </constraints>
    </integer>
    <double>
      <name>stepsize</name>
      <flag>s</flag>
      <longflag>stepsize</longflag>
      <description>The length of each segment of the tract in real dimensions (usually millimeters)</description>
      <label>Step Size(mm)</label>
      <default>0.5</default>
      <constraints>
        <minimum>0.1</minimum>
        <step>0.1</step>
      </constraints>
    </double>
    <double>
      <name>gamma</name>
      <flag>g</flag>
      <longflag>gamma</longflag>
      <description>A prior parameter controlling the smoothness of the tracts. Larger values reduce probability of sharp turns</description>
      <label>Gamma</label>
      <default>1</default>
    </double>
    <integer>
      <name>maxlikelihoodcachesize</name>
      <flag>c</flag>
      <longflag>maxlikelihoodcachesize</longflag>
      <description>Maximum Size of Likelihood Cache</description>
      <label>Maximum Cache Size</label>
      <default>100</default>
      <constraints>
        <minimum>0</minimum>
        <step>1</step>
      </constraints>
    </integer>
    <boolean>
      <name>recenteroriginswitch</name>
      <flag>r</flag>
      <default>true</default>
      <longflag>recenteroriginswitch</longflag>
      <label>Recenter Image Origins</label>
      <description>Ignore the origins of the ROI and WM mask and set it to be the same as the DWI image origin</description>
    </boolean>
    <boolean>
      <name>rotatesampgridswitch</name>
      <flag>x</flag>
      <default>false</default>
      <longflag>rotatesampgridswitch</longflag>
      <label>Rotate Sampling Grid</label>
      <description>Rotate the sampling grid so that one of the sampling directions
        is guaranteed to point in the principal eigenvector direction
      </description>
    </boolean>
    <boolean>
      <name>streamlineswitch</name>
      <flag>z</flag>
      <default>false</default>
      <longflag>streamlineswitch</longflag>
      <label>Streamline Tractography</label>
      <description>
        Perform simple major eigenvector streamline tractography instead of stochastic tractography.
        Enabling this option ignores all options relating to stochastic tractography.
      </description>
    </boolean>
    <boolean>
      <name>nninterpolationswitch</name>
      <flag>n</flag>
      <default>false</default>
      <longflag>nninterpolationswitch</longflag>
      <label>Nearest Neighbor Interpolation</label>
      <description>Use Nearest Neighbor instead of Stochastic Voxel Interpolation</description>
    </boolean>
    <integer>
      <name>totalthreads</name>
      <flag>j</flag>
      <longflag>totalthreads</longflag>
      <description>Total number of threads to use.  Default value of zero sets number of threads to number of CPUs</description>
      <label>Total Threads</label>
      <default>0</default>
      <constraints>
        <minimum>0</minimum>
        <step>1</step>
      </constraints>
    </integer>
    <boolean>
      <name>continuoustractsswitch</name>
      <flag>d</flag>
      <longflag>continuous</longflag>
      <description>Output tracts in continuous instead of discretized IJK space.</description>
      <label>continuoustractsswitch</label>
      <default>false</default>
    </boolean>  
  </parameters>

  <parameters>
    <label>IO</label>
    <description>Input/output parameters</description>
    <image type="diffusion-weighted">
      <name>dwifilename</name>
      <label>Input Volume</label>
      <channel>input</channel>
      <index>0</index>
      <description>Input DWI volume to be filtered</description>
    </image>
    <image>
      <name>wmpfilename</name>
      <label>Input White Matter Probability Volume</label>
      <channel>input</channel>
      <index>1</index>
      <description>Input Mask volume that provides the probability that the voxel is white matter </description>
    </image>
    <image>
      <name>roifilename</name>
      <label>Input ROI Volume</label>
      <channel>input</channel>
      <index>2</index>
      <description>Input ROI volume used to seed algorithm</description>
    </image>
    <file>
      <name>tractsfilename</name>
      <label>Output Tracts</label>
      <channel>output</channel>
      <index>3</index>
      <description>Output tracts as VTK XML Polydata file (.vtp extension)</description>
    </file>
  </parameters>

</executable>
