| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkMaximumRatioDecisionRule.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:41 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
DEF |
#ifndef __MaximumRatioDecisionRule_h |
| 18 |
DEF |
#define __MaximumRatioDecisionRule_h |
| 19 |
|
|
| 20 |
|
#include "itkWin32Header.h" |
| 21 |
|
|
| 22 |
|
#include <vector> |
| 23 |
|
#include "vnl/vnl_matrix.h" |
| 24 |
|
|
| 25 |
|
#include "itkNumericTraits.h" |
| 26 |
|
#include "itkDecisionRuleBase.h" |
| 27 |
|
|
| 28 |
|
namespace itk { |
| 29 |
|
|
| 30 |
|
/** \class MaximumRatioDecisionRule |
| 31 |
|
* \brief This rule returns \f$i\f$ if |
| 32 |
|
* \f$\frac{f_{i}(\overrightarrow{x})}{f_{j}(\overrightarrow{x})} > |
| 33 |
|
* \frac{K_{j}}{K_{i}}\f$ for all \f$j \not= i\f$, |
| 34 |
|
* where the \f$i\f$ is the index of a class which has |
| 35 |
|
* membership function \f$f_{i}\f$ and its prior value |
| 36 |
|
* (usually, the a priori probability or the size of a class) is |
| 37 |
|
* \f$K_{i}\f$ |
| 38 |
|
* |
| 39 |
|
* Users should set the a priori values before calling the Evaluate method. |
| 40 |
|
* |
| 41 |
|
* \sa MaximumDecisionRule, MinimumDecisionRule |
| 42 |
|
*/ |
| 43 |
|
|
| 44 |
|
class ITKCommon_EXPORT MaximumRatioDecisionRule : |
| 45 |
IND |
****public DecisionRuleBase |
| 46 |
|
{ |
| 47 |
|
public: |
| 48 |
|
/** Standard class typedefs */ |
| 49 |
SEM |
typedef MaximumRatioDecisionRule Self ; |
| 50 |
TDA |
typedef DecisionRuleBase Superclass; |
| 51 |
TDA |
typedef SmartPointer<Self> Pointer; |
| 52 |
|
|
| 53 |
|
/** Run-time type information (and related methods) */ |
| 54 |
|
itkTypeMacro(MaximumRatioDecisionRule, DecisionRuleBase); |
| 55 |
|
|
| 56 |
|
/** Standard New() method support */ |
| 57 |
SEM |
itkNewMacro(Self) ; |
| 58 |
|
|
| 59 |
SEM |
typedef float APrioriValueType ; |
| 60 |
TDA,SEM |
typedef std::vector< APrioriValueType > APrioriVectorType ; |
| 61 |
|
|
| 62 |
|
|
| 63 |
|
/** Types for the arguments that are acceptable in the Evaluate() method */ |
| 64 |
|
typedef Superclass::VectorType VectorType; |
| 65 |
|
typedef Superclass::ArrayType ArrayType; |
| 66 |
|
|
| 67 |
|
|
| 68 |
|
/** The return value of this function is a class label. |
| 69 |
|
* Basically, using its internal logic based on the discriminant |
| 70 |
|
* scores, this function decides best class label and return it. |
| 71 |
|
*/ |
| 72 |
|
virtual unsigned int Evaluate( const VectorType &discriminantScores) const; |
| 73 |
|
|
| 74 |
|
/** The return value of this function is a class label. |
| 75 |
|
* Basically, using its internal logic based on the discriminant |
| 76 |
|
* scores, this function decides best class label and return it. |
| 77 |
|
*/ |
| 78 |
|
virtual unsigned int Evaluate( const ArrayType &discriminantScores) const; |
| 79 |
|
|
| 80 |
|
|
| 81 |
|
/** Sets the a priori probabilities */ |
| 82 |
SEM |
void SetAPriori(APrioriVectorType& values) ; |
| 83 |
|
|
| 84 |
|
protected: |
| 85 |
SEM |
MaximumRatioDecisionRule() ; |
| 86 |
|
virtual ~MaximumRatioDecisionRule() {} |
| 87 |
|
|
| 88 |
|
private: |
| 89 |
|
/** Number of classes */ |
| 90 |
SEM |
unsigned int m_NumberOfClasses ; |
| 91 |
|
|
| 92 |
|
/** a priori probability ratio matrix: internal use */ |
| 93 |
SEM |
vnl_matrix< double > m_APrioriRatioMatrix ; |
| 94 |
SEM |
} ; // end of class |
| 95 |
|
|
| 96 |
|
} // end of namespace |
| 97 |
|
#endif |
| 98 |
|
|
| 99 |
EOF |
|
| 100 |
EOF,EML |
|
| 101 |
EOF,EML |
|
| 102 |
EOF,EML |
|
| 103 |
EOF,EML |
|
| 104 |
EOF,EML |
|
| 105 |
EOF,EML |
|