<?xml version="1.0" encoding="utf-8"?>
<executable>
  <category>
  Batch Processing
  </category>
  <title>
  Diffusion Tensor Estimation Batchmake
  </title>
  <description>
  Performs a tensor model estimation from diffusion weighted images.
  There are three estimation methods available: least squares, weigthed least squares and non-linear estimation. The first method is the traditional method for tensor estimation and the fastest one. Weighted least squares takes into account the noise characteristics of the MRI images to weight the DWI samples used in the estimation based on its intensity magnitude. The last method is the more complex.
  </description>
  <version>0.1.0.$Revision: 1892 $(alpha)</version>
  <documentation-url></documentation-url>
  <license></license>
  <contributor>Lauren O'Donnell</contributor>
  <acknowledgements>This command module is based on the estimation capabilities of teem</acknowledgements>

  <parameters>
    <label>Input Datasets</label>
    <description>Input Datasets</description>

    <directory>
      <name>dataDir</name>
      <description>Directory containing the diffusion-weighted image files in nrrd or nhdr format)</description>
      <label>Data directory</label>
      <channel>input</channel>
      <index>0</index>
      <description>Directory where to find input images</description>
    </directory>

    <string>
      <name>dataMask</name>
      <description>Wildcard/mask to apply to the directory listing to select only the images to be processed</description>
      <label>Data file mask</label>
      <default>*.nhdr</default>
      <flag>m</flag>
    </string>
   
    <boolean>
      <name>dataMaskRecursive</name>
      <description>Automatically descend into subdirs to find input files</description>
      <label>Recursive</label>
      <longflag>dataMaskRecursive</longflag> 
      <default>false</default>
    </boolean>

  </parameters>

  <parameters>
    <label>Output Directory</label>
    <description>Output Directory</description>

    <directory>
      <name>outputDir</name>
      <label>Output directory</label>
      <channel>output</channel>
      <index>1</index>
      <description>Directory where to put the processed images</description>
    </directory>
  </parameters>

  <parameters>
    <label>Estimation Parameters</label>
    <description> Parameters for the estimation algorithm</description>
    <string-enumeration>
      <name>estimationMethod</name>
      <flag>e</flag>
      <longflag>enumeration</longflag>
      <description>LS: Least Squares, WLS: Weighted Least Squares; NL: Nonlinear  Control the accuracy of the tensor estimation (at the expense of computation time)</description>
      <label>Estimation Parameters</label>
      <default>LS</default>
      <element>LS</element>
      <element>WLS</element>
      <element>NL</element>
    </string-enumeration>
    <boolean>
      <name>ShiftNegativeEigenvalues</name>
      <longflag>shiftNeg</longflag>
      <description>Shift eigenvalues so all are positive (accounts for bad tensors related to noise or acquisition error)</description>
      <label>Shift Negative Eigenvalues</label>
      <default>false</default>
    </boolean>
    <double>
      <name>otsuOmegaThreshold</name>
      <label>Otsu Omega Threshold Parameter</label>
      <flag>o</flag>
      <longflag>otsuomegathreshold</longflag>
      <description>Control the sharpness of the threshold in the Otsu computation. 0: lower threshold, 1: higher threhold</description>
      <default>0.5</default>
      <constraints>
      	<minimum>0.0</minimum>
	<maximum>1.0</maximum>
	<step>0.1</step>
      </constraints>
    </double>
    <boolean>
     <name>removeIslands</name>
     <label>Remove Islands in Threshold Mask</label>
     <longflag>--removeislands</longflag>
     <description>Remove Islands in Threshold Mask?</description>
     <default>true</default>
    </boolean>
    <boolean>
     <name>applyMask</name>
     <label>Apply Mask to Tensor Image</label>
     <longflag>--applymask</longflag>
     <description>Apply Threshold Mask to Tensor?</description>
     <default>true</default>
    </boolean>
  </parameters>


  <parameters advanced="true">
    <label>BatchMake</label>
    <description>BatchMake specific parameters</description>

    <boolean>
      <name>runUsingCondor</name>
      <description>Select to run on local grid using Condor (BatchMake must have been compiled using Condor)</description>
      <label>Run using Grid/Condor</label>
      <longflag>condor</longflag> 
      <default>false</default>
    </boolean>
  
  </parameters>


</executable>
