<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Change SYSTEM "http://itk.org/migrationv4/ITKMigration.dtd">
<!--**
**
** StatisticsFrameworkResolveDecisionRulesDuplicates.xml
**
** >>>>>>>>>>>>>>>>>>>>>>>>>>>>
** THIS FILE HAS BEEN AUTOMATICALLY GENERATED. EDIT IT BEFORE COMMITING
** <<<<<<<<<<<<<<<<<<<<<<<<<<<
**
**-->
<Change>
    <!--**
    ** Title for the online migration page
    **-->
    <Title>
      Statistics Framework Resolve Decision Rules Duplicates
    </Title>

    <!--**
    ** The author of the change
    **-->
    <Author>
      Jim Miller
    </Author>

    <!--**
    ** Date of creation for the XML document
    **-->
    <Date>
      2011-05-31
    </Date>

    <!--**
    ** Plain text description of the change
    ** Extracted from git commit messages
    **-->
    <Description>
      The statistics library was refactored in 2007 and has been available under the Review directory since that time. ITKv4 has adoped the refactored statistics library and has removed the original statistics library. Remnants of the old statistics library were still visible in ITK as a few of the classes in the new statistics library were named using a convention that would not clash with the old statistics framework, e.g. MaximumDecisionRule2. In an effort to complete the transition to the new statistics framework, these duplicate classes have been resolved into single class definitions. Classes from the old statistics framework have been removed and classes from the new statistics framework have been renamed to officially take their place. Along with these changes, the documentation and API has been revised.

      For users of the old statistics framework, there are two main changes: (1) itk::DecisionRuleBase has been renamed itk::Statistics::DecisionRule, and (2) the subclasses of DecisionRule are now in the itk::Statistics namespace, i.e. itk::MaximumDecisionRule is now referred to as itk::Statistics::MaximumDecisionRule.

      For users of the new statistics framework, there are two main changes: (1) decision rule classes have been renamed to supplant the names from the old statistics library, i.e. itk::Statistics::MaximumDecisionRule2 is now itk::Statistics::MaximumDecisionRule (this affect header inclusion and class references), and (2) the API to MaximumRatioDecisionRule has been modified to make it consistent with ITK conventions. With the latter, ther has been a change that prior probabilities are assumed to be doubles not floats, to make prior probabilities consistent in type with the likelihood functions. Finally, typedefs have been created to define class ids and probability value types.
    </Description>

    <!--**
    ** Sample code snippets
    ** Extracted from git diff of changed files in Examples and Testing
    **-->
    <SampleCode>
      <Old>
        #include &quot;itkMaximumDecisionRule2.h&quot;

        int main(int, char*[])
        {
        typedef itk::Statistics::MaximumDecisionRule2 DecisionRuleType;
        DecisionRuleType::Pointer decisionRule = DecisionRuleType::New();

        return 0;
        }
      </Old>

      <New>
        #include &quot;itkMaximumDecisionRule.h&quot;

        int main(int, char*[])
        {
        typedef itk::Statistics::MaximumDecisionRule DecisionRuleType;
        DecisionRuleType::Pointer decisionRule = DecisionRuleType::New();

        return 0;
        }
      </New>
    </SampleCode>

    <SampleCode>
      <Old>
        #include &quot;itkMaximumRatioDecisionRule2.h&quot;

        int main(int, char*[])
        {
        typedef itk::Statistics::MaximumRatioDecisionRule2 DecisionRuleType;
        DecisionRuleType::Pointer decisionRule = DecisionRuleType::New();

        std::vector&amp;lt; double &gt; discriminantScores;
        discriminantScores.push_back( 0.1 );
        discriminantScores.push_back( 0.3 );
        discriminantScores.push_back( 0.6 );

        DecisionRuleType::APrioriVectorType aPrioris;
        aPrioris.push_back( 0.1 );
        aPrioris.push_back( 0.8 );
        aPrioris.push_back( 0.1 );

        decisionRule-&gt;SetAPriori( aPrioris );
        unsigned int cid = decisionRule-&gt;Evaluate( discriminantScores );

        return 0;
        }
      </Old>

      <New>
        #include &quot;itkMaximumRatioDecisionRule.h&quot;

        int main(int, char*[])
        {
        typedef itk::Statistics::MaximumRatioDecisionRule DecisionRuleType;
        DecisionRuleType::Pointer decisionRule = DecisionRuleType::New();

        DecisionRuleType::MembershipVectorType discriminantScores;
        discriminantScores.push_back( 0.1 );
        discriminantScores.push_back( 0.3 );
        discriminantScores.push_back( 0.6 );

        DecisionRuleType::PriorProbabilityVectorType aPrioris;
        aPrioris.push_back( 0.1 );
        aPrioris.push_back( 0.8 );
        aPrioris.push_back( 0.1 );

        decisionRule-&gt;SetPriorProbabilities( aPrioris );
        DecisionRuleType::ClassIdentifierType cid = decisionRule-&gt;Evaluate( discriminantScores );

        return 0;
        }
      </New>
    </SampleCode>

    <!--**
    ** The change-ids for all commits in the topic branch
    **-->
    <Gerrit-ChangeId>
http://review.source.kitware.com/#change,1740
    </Gerrit-ChangeId>

    <!--**
    ** List of all changed files from the topic branch
    **-->
    <FileList>
      Examples/Statistics/CMakeLists.txt
      Examples/Statistics/MaximumDecisionRule.cxx
      Examples/Statistics/MaximumDecisionRule2.cxx
      Examples/Statistics/MaximumRatioDecisionRule.cxx
      Examples/Statistics/MaximumRatioDecisionRule2.cxx
      Examples/Statistics/MinimumDecisionRule.cxx
      Examples/Statistics/MinimumDecisionRule2.cxx
      Modules/Numerics/Statistics/include/itkDecisionRule.h
      Modules/Numerics/Statistics/include/itkDecisionRuleBase.h
      Modules/Numerics/Statistics/include/itkMaximumDecisionRule.h
      Modules/Numerics/Statistics/include/itkMaximumDecisionRule2.h
      Modules/Numerics/Statistics/include/itkMaximumRatioDecisionRule.h
      Modules/Numerics/Statistics/include/itkMaximumRatioDecisionRule2.h
      Modules/Numerics/Statistics/include/itkMinimumDecisionRule.h
      Modules/Numerics/Statistics/include/itkMinimumDecisionRule2.h
      Modules/Numerics/Statistics/src/itkMaximumRatioDecisionRule.cxx
      Modules/Numerics/Statistics/test/CMakeLists.txt
      Modules/Numerics/Statistics/test/itkDecisionRuleBackwardCompatibilityTest.cxx
      Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx
      Examples/Segmentation/GibbsPriorImageFilter1.cxx
      Examples/Statistics/BayesianPluginClassifier.cxx
      Examples/Statistics/KdTreeBasedKMeansClustering.cxx
      Examples/Statistics/ScalarImageMarkovRandomField1.cxx
      Modules/Nonunit/IntegratedTest/test/itkCommonPrintTest.cxx
      Modules/Nonunit/IntegratedTest/test/itkMaximumDecisionRuleTest.cxx
      Modules/Nonunit/IntegratedTest/test/itkMaximumRatioDecisionRuleTest.cxx
      Modules/Nonunit/IntegratedTest/test/itkMinimumDecisionRuleTest.cxx
      Modules/Nonunit/IntegratedTest/test/itkStatisticsPrintTest.cxx
      Modules/Numerics/Statistics/src/CMakeLists.txt
      Modules/Numerics/Statistics/src/itkDecisionRule.cxx
      Modules/Numerics/Statistics/src/itkDecisionRuleBase.cxx
      Modules/Numerics/Statistics/src/itkMaximumDecisionRule.cxx
      Modules/Numerics/Statistics/src/itkMaximumDecisionRule2.cxx
      Modules/Numerics/Statistics/src/itkMaximumRatioDecisionRule2.cxx
      Modules/Numerics/Statistics/src/itkMinimumDecisionRule.cxx
      Modules/Numerics/Statistics/src/itkMinimumDecisionRule2.cxx
      Modules/Numerics/Statistics/test/itkDecisionRuleBackwardCompatibility.cxx
      Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx
      Modules/Numerics/Statistics/test/itkMaximumDecisionRuleTest.cxx
      Modules/Numerics/Statistics/test/itkMaximumRatioDecisionRuleTest.cxx
      Modules/Numerics/Statistics/test/itkMinimumDecisionRuleTest.cxx
      Modules/Numerics/Statistics/test/itkStatisticsHeaderTest.cxx
      Modules/Segmentation/Classifiers/include/itkBayesianClassifierImageFilter.h
      Modules/Segmentation/Classifiers/include/itkBayesianClassifierImageFilter.txx
      Modules/Segmentation/Classifiers/include/itkClassifierBase.h
      Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.h
      Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx
      Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx
      Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx
      Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx
      Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx
      Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx
      Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx
      Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx
      Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx
      Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkGibbsTest.cxx
    </FileList>

    <MigrationFix-Automatic>
      <Old>
        itk::DecisionRuleBase
      </Old>
      <New>
        itk::Statistics::DecisionRule
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        itk::Statistics::MaximumDecisionRule2
      </Old>
      <New>
        itk::Statistics::MaximumDecisionRule
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        itk::Statistics::MinimumDecisionRule2
      </Old>
      <New>
        itk::Statistics::MinimumDecisionRule
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        itk::Statistics::MaximumRatioDecisionRule2
      </Old>
      <New>
        itk::Statistics::MaximumRatioDecisionRule
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        #include "itkDecisionRuleBase.h"
      </Old>
      <New>
        #include "itkDecisionRule.h"
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        #include "itkMaximumDecisionRule2.h"
      </Old>
      <New>
        #include "itkMaximumDecisionRule.h"
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        #include "itkMinimumDecisionRule2.h"
      </Old>
      <New>
        #include "itkMinimumDecisionRule.h"
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        #include "itkMaximumRatioDecisionRule2.h"
      </Old>
      <New>
        #include "itkMaximumRatioDecisionRule.h"
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        SetAPrioris
      </Old>
      <New>
        SetPriorProbabilities
      </New>
    </MigrationFix-Automatic>

    <MigrationFix-Automatic>
      <Old>
        ::APrioriVectorType
      </Old>
      <New>
        ::PriorProbabilityVectorType
      </New>
    </MigrationFix-Automatic>

    <!--**
    ** If the migration can NOT be accomplished by a simple string
    ** substitution, but potential problem spots can be identified,
    ** use the following construct to define a migration flag rule.
    **
    ** <MigrationFix-Manual>
    **   OldFunctionName
    ** </MigrationFix-Manual>
    **-->

</Change>
