00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSampleClassifierWithMask_h
00018 #define __itkSampleClassifierWithMask_h
00019
00020 #include <vector>
00021
00022 #include "itkObject.h"
00023 #include "itkExceptionObject.h"
00024 #include "itkSubsample.h"
00025 #include "itkMembershipSample.h"
00026 #include "itkSampleClassifier.h"
00027
00028 namespace itk{
00029 namespace Statistics{
00030
00053 template< class TSample, class TMaskSample >
00054 class ITK_EXPORT SampleClassifierWithMask :
00055 public SampleClassifier< TSample >
00056 {
00057 public:
00059 typedef SampleClassifierWithMask Self;
00060 typedef SampleClassifier< TSample > Superclass;
00061 typedef SmartPointer< Self > Pointer;
00062
00064 itkTypeMacro(SampleClassifierWithMask, SampleClassifier);
00065 itkNewMacro(Self) ;
00066
00068 typedef typename Superclass::OutputType OutputType ;
00069 typedef typename Superclass::ClassLabelType ClassLabelType ;
00070 typedef typename Superclass::ClassLabelVectorType ClassLabelVectorType ;
00071
00073 typedef typename TSample::MeasurementType MeasurementType ;
00074 typedef typename TSample::MeasurementVectorType MeasurementVectorType ;
00075
00076 itkStaticConstMacro(MeasurementVectorSize, unsigned int,
00077 TSample::MeasurementVectorSize);
00078
00080 typedef typename Superclass::MembershipFunctionPointerVector
00081 MembershipFunctionPointerVector ;
00082
00083 void SetMask( TMaskSample* mask ) ;
00084
00085 TMaskSample* GetMask()
00086 { return m_Mask.GetPointer() ; }
00087
00088 void SetSelectedClassLabels( ClassLabelVectorType& labels)
00089 { m_SelectedClassLabels = labels ; }
00090
00091 void SetOtherClassLabel( ClassLabelType label)
00092 { m_OtherClassLabel = label ; }
00093
00094 protected:
00095 SampleClassifierWithMask() ;
00096 virtual ~SampleClassifierWithMask() {}
00097 void PrintSelf(std::ostream& os, Indent indent) const;
00098
00100 void GenerateData() ;
00101
00102 private:
00104 typename TMaskSample::Pointer m_Mask ;
00105 ClassLabelVectorType m_SelectedClassLabels ;
00106 ClassLabelType m_OtherClassLabel ;
00107 } ;
00108
00109
00110 }
00111 }
00112
00113
00114 #ifndef ITK_MANUAL_INSTANTIATION
00115 #include "itkSampleClassifierWithMask.txx"
00116 #endif
00117
00118 #endif
00119
00120
00121
00122
00123
00124
00125