Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkClassifierBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkClassifierBase.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/02/23 06:00:37 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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&); //purposely not implemented
00162   void operator=(const Self&); //purposely not implemented
00163 
00164   unsigned int                       m_NumberOfClasses;
00165 
00167   typename DecisionRuleType::Pointer m_DecisionRulePointer;
00168 
00170   MembershipFunctionPointerVector    m_MembershipFunctions ;
00171 
00172 }; // class Classifier
00173 
00174 
00175 } // namespace itk
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 

Generated at Fri May 21 01:14:32 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000