00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkClassifierBase_h
00018 #define _itkClassifierBase_h
00019
00020 #include <vector>
00021
00022 #include "itkLightProcessObject.h"
00023 #include "itkMembershipFunctionBase.h"
00024 #include "itkDecisionRuleBase.h"
00025
00026 namespace itk
00027 {
00028
00085 template <class TDataContainer>
00086 class ITK_EXPORT ClassifierBase : public LightProcessObject
00087 {
00088 public:
00090 typedef ClassifierBase Self;
00091 typedef LightProcessObject Superclass;
00092
00094 itkTypeMacro(ClassifierBase,LightProcessObject);
00095
00097 itkSetMacro(NumberOfClasses, unsigned int);
00098
00100 itkGetConstReferenceMacro(NumberOfClasses, unsigned int);
00101
00103 typedef typename TDataContainer::ValueType MeasurementVectorType ;
00104
00106 typedef Statistics::MembershipFunctionBase< MeasurementVectorType >
00107 MembershipFunctionType;
00108 typedef typename MembershipFunctionType::Pointer MembershipFunctionPointer ;
00109
00110 typedef std::vector< MembershipFunctionPointer >
00111 MembershipFunctionPointerVector;
00112
00114 typedef DecisionRuleBase DecisionRuleType;
00115
00119 void SetDecisionRule( DecisionRuleType* ptrToDecisionRule )
00120 {
00121 m_DecisionRule = ptrToDecisionRule;
00122 }
00123
00125 DecisionRuleType* GetDecisionRule(void)
00126 {
00127 return m_DecisionRule.GetPointer() ;
00128 }
00129
00134 const MembershipFunctionType* GetMembershipFunction(unsigned int index)const
00135 {
00136 return m_MembershipFunctions[index].GetPointer() ;
00137 }
00138
00140 unsigned int GetNumberOfMembershipFunctions()
00141 {
00142 return static_cast<unsigned int>( m_MembershipFunctions.size() );
00143 }
00144
00146 unsigned int AddMembershipFunction(MembershipFunctionType* function);
00147
00149 void Update() ;
00150
00151 protected:
00152 ClassifierBase() ;
00153 ~ClassifierBase() ;
00154 void PrintSelf(std::ostream& os, Indent indent) const;
00155
00158 virtual void GenerateData() = 0 ;
00159
00160 private:
00161 ClassifierBase(const Self&);
00162 void operator=(const Self&);
00163
00165 unsigned int m_NumberOfClasses ;
00166
00168 typename DecisionRuleType::Pointer m_DecisionRule ;
00169
00171 MembershipFunctionPointerVector m_MembershipFunctions ;
00172
00173 };
00174
00175
00176 }
00177
00178 #ifndef ITK_MANUAL_INSTANTIATION
00179 #include "itkClassifierBase.txx"
00180 #endif
00181
00182
00183
00184 #endif
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200