00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 } ;
00131
00132
00133 }
00134 }
00135
00136
00137 #ifndef ITK_MANUAL_INSTANTIATION
00138 #include "itkSampleClassifier.txx"
00139 #endif
00140
00141 #endif
00142
00143
00144
00145
00146
00147
00148