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
00086 template <class TDataContainer>
00087 class ITK_EXPORT ClassifierBase : public LightProcessObject
00088 {
00089 public:
00091 typedef ClassifierBase Self;
00092 typedef LightProcessObject Superclass;
00093 typedef SmartPointer<Self> Pointer;
00094 typedef SmartPointer<const Self> ConstPointer;
00095
00097 itkTypeMacro(ClassifierBase,LightProcessObject);
00098
00100 itkSetMacro(NumberOfClasses, unsigned int);
00101
00103 itkGetConstMacro(NumberOfClasses, unsigned int);
00104
00106 typedef typename TDataContainer::ValueType MeasurementVectorType ;
00107
00109 typedef Statistics::MembershipFunctionBase< MeasurementVectorType >
00110 MembershipFunctionType;
00111 typedef typename MembershipFunctionType::Pointer MembershipFunctionPointer ;
00112
00113 typedef std::vector< MembershipFunctionPointer >
00114 MembershipFunctionPointerVector;
00115
00117 typedef DecisionRuleBase DecisionRuleType;
00118
00122 void SetDecisionRule( typename DecisionRuleType::Pointer ptrToDecisionRule )
00123 {
00124 m_DecisionRulePointer = ptrToDecisionRule;
00125 }
00126
00128 DecisionRuleType * GetDecisionRule(void)
00129 {
00130 return m_DecisionRulePointer;
00131 }
00132
00134 const MembershipFunctionPointerVector GetMembershipFunctions() const
00135 {
00136 return m_MembershipFunctions;
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
00150 void Update() ;
00151
00152 protected:
00153 ClassifierBase();
00154 ~ClassifierBase();
00155 void PrintSelf(std::ostream& os, Indent indent) const;
00156
00157 virtual void GenerateData();
00158
00159 private:
00160
00161 ClassifierBase(const Self&);
00162 void operator=(const Self&);
00163
00164 unsigned int m_NumberOfClasses;
00165
00167 typename DecisionRuleType::Pointer m_DecisionRulePointer;
00168
00170 MembershipFunctionPointerVector m_MembershipFunctions ;
00171
00172 };
00173
00174
00175 }
00176
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkClassifierBase.txx"
00179 #endif
00180
00181
00182
00183 #endif
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199