00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSelectiveSubsampleGenerator_h
00018 #define __itkSelectiveSubsampleGenerator_h
00019
00020
00021 #include "itkObject.h"
00022 #include "itkMembershipSample.h"
00023
00024 namespace itk{
00025 namespace Statistics{
00026
00048 template< class TInputSample, class TClassMaskSample >
00049 class ITK_EXPORT SelectiveSubsampleGenerator :
00050 public Object
00051 {
00052 public:
00054 typedef SelectiveSubsampleGenerator Self;
00055 typedef Object Superclass ;
00056 typedef SmartPointer<Self> Pointer;
00057 typedef SmartPointer<const Self> ConstPointer;
00058
00060 itkTypeMacro(SelectiveSubsampleGenerator, Object);
00061 itkNewMacro(Self) ;
00062
00064 typedef typename TInputSample::MeasurementVectorType MeasurementVectorType ;
00065
00066 typedef typename TClassMaskSample::MeasurementType ClassLabelType ;
00067 typedef std::vector< ClassLabelType > ClassLabelVectorType ;
00068
00070 typedef Subsample< TInputSample > OutputType ;
00071 typedef typename OutputType::Pointer OutputPointer ;
00072
00074 void SetInput(TInputSample* sample) ;
00075
00077 TInputSample* GetInput() ;
00078
00080 void SetClassMask(const TClassMaskSample* classMask) ;
00081
00083 const TClassMaskSample* GetClassMask() const;
00084
00085 void SetSelectedClassLabels( const ClassLabelVectorType& classLabels )
00086 { m_SelectedClassLabels = classLabels ; }
00087
00090 const OutputType * GetOutput() const;
00091
00093 void GenerateData() ;
00094
00095 protected:
00096 SelectiveSubsampleGenerator() ;
00097 virtual ~SelectiveSubsampleGenerator() {}
00098 void PrintSelf(std::ostream& os, Indent indent) const;
00099
00100 private:
00101 TInputSample* m_Input ;
00102 const TClassMaskSample* m_ClassMask ;
00103 ClassLabelVectorType m_SelectedClassLabels ;
00104 OutputPointer m_Output ;
00105 } ;
00106
00107 }
00108 }
00109
00110 #ifndef ITK_MANUAL_INSTANTIATION
00111 #include "itkSelectiveSubsampleGenerator.txx"
00112 #endif
00113
00114 #endif