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
00059 template< class TSample, class TMaskSample >
00060 class ITK_EXPORT SampleClassifierWithMask :
00061 public SampleClassifier< TSample >
00062 {
00063 public:
00065 typedef SampleClassifierWithMask Self;
00066 typedef SampleClassifier< TSample > Superclass;
00067 typedef SmartPointer< Self > Pointer;
00068 typedef SmartPointer<const Self> ConstPointer;
00069
00071 itkTypeMacro(SampleClassifierWithMask, SampleClassifier);
00072 itkNewMacro(Self) ;
00073
00075 typedef typename Superclass::OutputType OutputType ;
00076 typedef typename Superclass::ClassLabelType ClassLabelType ;
00077 typedef typename Superclass::ClassLabelVectorType ClassLabelVectorType ;
00078
00080 typedef typename TSample::MeasurementType MeasurementType ;
00081 typedef typename TSample::MeasurementVectorType MeasurementVectorType ;
00082
00083
00085 typedef typename Superclass::MembershipFunctionPointerVector
00086 MembershipFunctionPointerVector ;
00087
00088 void SetMask( TMaskSample* mask ) ;
00089
00090 TMaskSample* GetMask()
00091 { return m_Mask.GetPointer() ; }
00092
00093 void SetSelectedClassLabels( ClassLabelVectorType& labels)
00094 { m_SelectedClassLabels = labels ; }
00095
00096 void SetOtherClassLabel( ClassLabelType label)
00097 { m_OtherClassLabel = label ; }
00098
00099 protected:
00100 SampleClassifierWithMask() ;
00101 virtual ~SampleClassifierWithMask() {}
00102 void PrintSelf(std::ostream& os, Indent indent) const;
00103
00105 void GenerateData() ;
00106
00107 private:
00109 typename TMaskSample::Pointer m_Mask ;
00110 ClassLabelVectorType m_SelectedClassLabels ;
00111 ClassLabelType m_OtherClassLabel ;
00112 } ;
00113
00114
00115 }
00116 }
00117
00118
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkSampleClassifierWithMask.txx"
00121 #endif
00122
00123 #endif
00124
00125
00126
00127
00128
00129
00130