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

itkSampleClassifier.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSampleClassifier.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/23 03:16:57 $
00007   Version:   $Revision: 1.11 $
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 __itkSampleClassifier_h
00018 #define __itkSampleClassifier_h
00019 
00020 #include <vector>
00021 
00022 #include "itkObject.h"
00023 #include "itkExceptionObject.h"
00024 #include "itkSubsample.h"
00025 #include "itkMembershipSample.h"
00026 #include "itkClassifierBase.h"
00027 
00028 namespace itk{ 
00029   namespace Statistics{
00030 
00065 template< class TSample >
00066 class ITK_EXPORT SampleClassifier : 
00067       public ClassifierBase< TSample >
00068 {
00069 public:
00071   typedef SampleClassifier Self;
00072   typedef ClassifierBase< TSample > Superclass;
00073   typedef SmartPointer< Self > Pointer;
00074 
00076   itkTypeMacro(SampleClassifier, Object);
00077   itkNewMacro(Self) ;
00078 
00080   typedef MembershipSample< TSample > OutputType ;
00081 
00083   typedef typename TSample::MeasurementType MeasurementType ;
00084   typedef typename TSample::MeasurementVectorType MeasurementVectorType ;
00085 
00086   itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00087                       TSample::MeasurementVectorSize);
00088 
00090   typedef typename Superclass::MembershipFunctionPointerVector 
00091     MembershipFunctionPointerVector ;
00092 
00094   void SetSample(TSample* sample) ;
00095 
00097   TSample* GetSample() ;
00098 
00104   void SetMembershipFunctionClassLabels(std::vector< unsigned int > labels) ;
00105 
00107   std::vector< unsigned int > GetMembershipFunctionClassLabels() 
00108   { return m_ClassLabels ; }
00109 
00111   OutputType* GetOutput() ;
00112 
00113 protected:
00114   SampleClassifier() ;
00115   virtual ~SampleClassifier() {}
00116   void PrintSelf(std::ostream& os, Indent indent) const;
00117 
00119   void GenerateData() ;
00120 
00121 private:
00123   TSample* m_Sample ;
00124 
00126   typename OutputType::Pointer m_Output ;
00127 
00129   std::vector< unsigned int > m_ClassLabels ;
00130 } ; // end of class
00131 
00132 
00133   } // end of namespace Statistics 
00134 } // end of namespace itk
00135 
00136 
00137 #ifndef ITK_MANUAL_INSTANTIATION
00138 #include "itkSampleClassifier.txx"
00139 #endif
00140 
00141 #endif
00142 
00143 
00144 
00145 
00146 
00147 
00148 

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