<?xml version="1.0" encoding="utf-8"?>
<executable>
  <category>Registration</category>
  <title>Rigid registration</title>
  <index>2</index>
  <description>Registers two images together using a rigid transform and mutual information.\n\nThis module was originally distributed as "Linear registration" but has been renamed to eliminate confusion with the "Affine registration" module.\n\nThis module is often used to align images of different subjects or images of the same subject from different modalities.\n\nThis module can smooth images prior to registration to mitigate noise and improve convergence. Many of the registration parameters require a working knowledge of the algorith although the default parameters are sufficient for many registration tasks.\n\n</description>
  <version>0.1.0.$Revision$(alpha)</version>
  <documentation-url>http://www.slicer.org/slicerWiki/index.php/Modules:RigidRegistration-Documentation-3.6</documentation-url>
  <license></license>
  <contributor>Daniel Blezek</contributor>
<acknowledgements>
This module was developed by Daniel Blezek while at GE Research with contributions from Jim Miller.\n\nThis 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 advanced="true">
    <label>Preprocessing</label>
    <description>Preprocessing of images (smoothing) before registration.</description>

    <integer>
      <name>FixedImageSmoothingFactor</name>
      <longflag>fixedsmoothingfactor</longflag>
      <description>Amount of smoothing applied to fixed image prior to registration. Default is 0 (none). Range is 0-5 (unitless). Consider smoothing the input data if there is considerable amounts of noise or the noise pattern in the fixed and moving images is very different.</description>
      <label>Smoothing level for fixed image</label>
      <default>0</default>
      <constraints>
        <minimum>0</minimum>
        <maximum>5</maximum>
        <step>1</step>
      </constraints>
    </integer>

    <integer>
      <name>MovingImageSmoothingFactor</name>
      <longflag>movingsmoothingfactor</longflag>
      <description>Amount of smoothing applied to moving image prior to registration. Default is 0 (none). Range is 0-5 (unitless). Consider smoothing the input data if there is considerable amounts of noise or the noise pattern in the fixed and moving images is very different.</description>
      <label>Smoothing level for moving image</label>
      <default>0</default>
      <constraints>
        <minimum>0</minimum>
        <maximum>5</maximum>
        <step>1</step>
      </constraints>
    </integer>
  </parameters>

  <parameters>
    <label>Registration Parameters</label>
    <description>Parameters used for registration</description>

    <boolean hidden="true">
      <name>TestingMode</name>
      <longflag>testingmode</longflag>
      <description>Enable testing mode. Input transform will be used to construct floating image. The floating image will be ignored if passed.</description>
      <label>Testing mode</label>
      <default>false</default>
    </boolean>

    <integer>
      <name>HistogramBins</name>
      <flag>b</flag>
      <longflag>histogrambins</longflag>
      <description>Number of histogram bins to use for Mattes Mutual Information. Reduce the number of bins if a registration fails. If the number of bins is too large, the estimated PDFs will be a field of impulses and will inhibit reliable registration estimation.</description>
      <label>Histogram Bins</label>
      <default>30</default>
      <constraints>
        <minimum>1</minimum>
        <maximum>500</maximum>
        <step>5</step>
      </constraints>
    </integer>

    <integer>
      <name>SpatialSamples</name>
      <flag>s</flag>
      <longflag>spatialsamples</longflag>
      <description>Number of spatial samples to use in estimating Mattes Mutual Information. Larger values yield more accurate PDFs and improved registration quality.</description>
      <label>Spatial Samples</label>
      <default>10000</default>
      <constraints>
        <minimum>1000</minimum>
        <step>1000</step>
      </constraints>
    </integer>

    <integer-vector>
      <name>Iterations</name>
      <flag>i</flag>
      <longflag>iterations</longflag>
      <description>Comma separated list of iterations. Must have the same number of elements as the learning rate.</description>
      <label>Iterations</label>
      <default>1000,1000,500,200</default>
    </integer-vector>

    <double-vector>
      <name>LearningRate</name>
      <flag>l</flag>
      <longflag>learningrate</longflag>
      <description>Comma separated list of learning rates. Learning rate is a scale factor on the gradient of the registration objective function (gradient with respect to the parameters of the transformation) used to update the parameters of the transformation during optimization. Smaller values cause the optimizer to take smaller steps through the parameter space. Larger values are typically used early in the registration process to take large jumps in parameter space followed by smaller values to home in on the optimum value of the registration objective function. Default is: 0.01, 0.005, 0.0005, 0.0002. Must have the same number of elements as iterations.</description>
      <label>Learning Rates</label>
      <default>0.01,0.005,0.0005,0.0002</default>
    </double-vector>
    
    <double>
      <name>TranslationScale</name>
      <longflag>translationscale</longflag>
      <flag>t</flag>
      <description>Relative scale of translations to rotations, i.e. a value of 100 means 10mm = 1 degree. (Actual scale used 1/(TranslationScale^2)). This parameter is used to "weight" or "standardized" the transform parameters and their effect on the registration objective function.</description>
      <label>Translation scaling</label>
      <default>100.0</default>
      <constraints>
        <minimum>10.0</minimum>
        <maximum>500.0</maximum>
        <step>50.0</step>
      </constraints>
    </double>
  </parameters>

  <parameters>
    <label>IO</label>
    <description>Input/output parameters</description>
    <transform fileExtensions=".txt">
      <name>InitialTransform</name>
      <longflag>initialtransform</longflag>
      <description>Initial transform for aligning the fixed and moving image. Maps positions in the fixed coordinate frame to positions in the moving coordinate frame. Optional.</description>
      <label>Initial transform</label>
      <channel>input</channel>
    </transform>
    <image>
      <name>FixedImageFileName</name>
      <label>Fixed Image</label>
      <channel>input</channel>
      <index>0</index>
      <description>Fixed image to which to register</description>
    </image>
    <image>
      <name>MovingImageFileName</name>
      <label>Moving Image</label>
      <channel>input</channel>
      <index>1</index>
      <description>Moving image</description>
    </image>
    <transform fileExtensions=".txt" reference="MovingImageFileName">
      <name>OutputTransform</name>
      <longflag>outputtransform</longflag>
      <description>Transform calculated that aligns the fixed and moving image. Maps positions in the fixed coordinate frame to the moving coordinate frame. Optional (specify an output transform or an output volume or both).</description>
      <label>Output transform</label>
      <channel>output</channel>
    </transform>
    <image>
      <name>ResampledImageFileName</name>
      <longflag>resampledmovingfilename</longflag>
      <label>Output Volume</label>
      <channel>output</channel>
      <description>Resampled moving image to the fixed image coordinate frame. Optional (specify an output transform or an output volume or both).</description>
    </image>
    
  </parameters>

</executable>
