<?xml version="1.0" encoding="utf-8"?>
<executable>
  <category>Surface Models</category>
  <title>Model Maker</title>
  <description>
Create 3D surface models from segmented data. \n\nModels are imported into Slicer under a model hierarchy node in a MRML scene. The model colors are set by the color table associated with the input volume (these colours will only be visible if you load the model scene file). \n\n**Create Multiple:** \n\nIf you specify a list of Labels, it will over ride any start/end label settings. \n\nIf you click ~~Generate All~~ it will over ride the list of lables and any start/end label settings. \n\n**Model Maker Settings:**\n\nYou can set the number of smoothing iterations, target reduction in number of polygons (decimal percentage). Use 0 and 1 if you wish no smoothing nor decimation.\n\nYou can set the flags to split normals or generate point normals in this pane as well.\n\nYou can save a copy of the models after intermediate steps (marching cubes, smoothing, and decimation if not joint smoothing, otherwise just after decimation); these models are not saved in the mrml file, turn off deleting temporary files first in the tcl window:\n\n~~[$::slicer3::CommandLineModuleGUI_Model_Maker GetLogic] DeleteTemporaryFilesOff~~\n\n
</description>
  <version>3.2</version>
  <documentation-url>http://www.slicer.org/slicerWiki/index.php/Modules:Model_Maker-Documentation-3.4</documentation-url>
  <license>slicer3</license>
  <contributor>Nicole Aucoin</contributor>
<acknowledgements>
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.
</acknowledgements>
<parameters>
    <label>IO</label>
    <description>Input/output parameters</description>
    <image type="label">
      <name>InputVolume</name>
      <label>Input Volume</label>
      <channel>input</channel>
      <index>0</index>
      <description>Input label map.</description>
      </image>
    <table type="color" reference="InputVolume" hidden="true">
      <name>ColorTable</name>
      <channel>input</channel>
      <longflag>color</longflag>
      <description>Color table to make labels to colors and objects</description>
    </table>   
    <geometry fileExtensions=".mrml" multiple="true" aggregate="true">
      <name>ModelSceneFile</name>
      <channel>output</channel>
      <label>Models</label>
      <longflag>--modelSceneFile</longflag>
      <description>Generated models, under a model hierarchy node.</description>
      <default>models.mrml</default>
    </geometry>
  </parameters>
<parameters>
  <label>Create Multiple</label>
  <description>Create more than one model at the same time, used for continuous ranges of labels.</description>
  <string>
     <name>Name</name>
     <label>Model Name</label>
     <flag>-n</flag>
     <longflag>--name</longflag>
     <description>Name to use for this model. If making multiple models, use this as a prefix to the label and color name</description>
     <default>Model</default>
   </string>
  <boolean>
     <name>GenerateAll</name>
     <label>Generate All Models</label>
     <longflag>--generateAll</longflag>
     <description>Generate models for all labels in the input volume. Ignores Labels, Start Label, End Label settings. Skips label 0.</description>
     <default>true</default>
   </boolean>
</parameters>
  <parameters advanced="true">
  <label>Model Maker Parameters</label>
  <description>Parameters used for making models.</description> 
 <integer-vector>
    <name>Labels</name>
    <flag>-l</flag>
    <longflag>-labels</longflag>
    <description>A comma separated list of label values from which to make models. Over-rides the Start/End Labels.</description>
    <label>Labels</label>
  </integer-vector>
   <integer>
    <name>StartLabel</name>
    <label>Start Label</label>
    <flag>-s</flag>
    <longflag>--start</longflag>
    <description>Voxel value from which to start making models. Used instead of the label list to specify a range (make sure the label list is empty or it will over ride this).</description>
    <default>-1</default>
  </integer>
  <integer>
    <name>EndLabel</name>
    <label>End Label</label>
    <flag>-e</flag>
    <longflag>--end</longflag>
    <description>Voxel value up to which to continue making models. Skip any values with zero voxels.</description>
    <default>-1</default>
  </integer>
  <boolean>
    <name>SkipUnNamed</name>
    <label>Skip Un-Named Labels</label>
    <longflag>--skipUnNamed</longflag>
    <description>If true, only models which have an entry in the color table will be generated. If false, generate all models that exist within the label range.</description>
     <default>true</default>
  </boolean>
  <boolean>
    <name>JointSmoothing</name>
    <label>Joint Smoothing</label>
    <description>Perform joint smoothing between models, so that they will fit together. </description>
    <flag>-j</flag>
    <longflag>--jointsmooth</longflag>
    <default>false</default>
  </boolean>
   <integer>
     <name>Smooth</name>
     <label>Smooth</label>
     <longflag>--smooth</longflag>
     <description>Number of smoothing iterations</description>
     <default>10</default>
     <constraints>
     <minimum>0</minimum>
     </constraints>
   </integer>
   <string-enumeration>
     <name>FilterType</name>
     <label>Filter Type</label>
     <description>Controls the type of smoothing done on the model.</description>
     <longflag>--filtertype</longflag>
     <default>Sinc</default>
     <element>Sinc</element>
     <element>Laplacian</element>
   </string-enumeration>
   <float>
     <name>Decimate</name>
     <label>Decimate</label>
     <longflag>--decimate</longflag>
     <description>Target reduction during decimation, as a decimal percentage reduction in the number of polygons.</description>
     <default>0.25</default>
     <constraints>
     <minimum>0.0</minimum>
     <maximum>1.0</maximum>
     </constraints>
   </float>
   <boolean>
     <name>SplitNormals</name>
     <label>Split Normals</label>
     <longflag>--splitnormals</longflag>
     <description>Splitting normals is useful for visualizing sharp features. However it creates holes in surfaces which affects measurements</description>
     <default>true</default>
   </boolean>
   <boolean>
     <name>PointNormals</name>
     <label>Point Normals</label>
     <longflag>--pointnormals</longflag>
     <description>Calculate the Point Normals?</description>
     <default>true</default>
   </boolean>
   <boolean>
     <name>SaveIntermediateModels</name>
     <label>Save Intermediate Models</label>
     <longflag>saveIntermediateModels</longflag>
     <description>Save a copy of the model after intermediate steps.</description>
     <default>false</default>
   </boolean>
</parameters>

<parameters advanced="true">
  <label>Debug</label>
    <boolean>
      <name>debug</name>
      <label>Debug</label>
      <description>Click to see debugging output</description>
      <flag>-d</flag> 
      <longflag>--debug</longflag>
      <default>false</default>
    </boolean>
</parameters>

</executable>
