00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkImageClassifierBase_h
00018 #define _itkImageClassifierBase_h
00019
00020 #include "itkClassifierBase.h"
00021 #include "itkExceptionObject.h"
00022 #include "itkImageRegionIterator.h"
00023 #include "itkImageRegionConstIterator.h"
00024
00025 namespace itk
00026 {
00027
00069 template <class TInputImage,
00070 class TClassifiedImage>
00071 class ITK_EXPORT ImageClassifierBase:
00072 public ClassifierBase<TInputImage>
00073 {
00074 public:
00076 typedef ImageClassifierBase Self;
00077 typedef ClassifierBase<TInputImage> Superclass;
00078 typedef SmartPointer<Self> Pointer;
00079 typedef SmartPointer<const Self> ConstPointer;
00080
00082 itkNewMacro(Self);
00083
00085 itkTypeMacro(ImageClassifierBase,ClassifierBase);
00086
00088 typedef TInputImage InputImageType;
00089 typedef typename TInputImage::Pointer InputImagePointer;
00090 typedef typename TInputImage::ConstPointer InputImageConstPointer;
00091
00093 typedef typename TClassifiedImage::Pointer ClassifiedImagePointer;
00094
00098 typedef typename Superclass::MeasurementVectorType MeasurementVectorType ;
00099
00101 typedef typename Superclass::MembershipFunctionType MembershipFunctionType;
00102
00103 typedef typename Superclass::MembershipFunctionPointer
00104 MembershipFunctionPointer;
00105
00106 typedef typename Superclass::MembershipFunctionPointerVector
00107 MembershipFunctionPointerVector;
00108
00110 typedef typename Superclass::DecisionRuleType DecisionRuleType;
00111
00113 itkSetConstObjectMacro(InputImage,InputImageType );
00114
00116 itkGetConstObjectMacro(InputImage,InputImageType);
00117
00119 itkSetMacro(ClassifiedImage,ClassifiedImagePointer);
00120
00122 itkGetMacro(ClassifiedImage,ClassifiedImagePointer);
00123
00126 typedef typename TInputImage::PixelType InputImagePixelType;
00127
00130 typedef typename TClassifiedImage::PixelType ClassifiedImagePixelType;
00131
00133 typedef
00134 ImageRegionConstIterator< TInputImage > InputImageConstIterator;
00135 typedef
00136 ImageRegionIterator< TClassifiedImage > ClassifiedImageIterator;
00137
00139 const std::vector<double> &
00140 GetPixelMembershipValue(const InputImagePixelType inputImagePixel );
00141
00142
00143 protected:
00144 ImageClassifierBase();
00145 ~ImageClassifierBase();
00146 void PrintSelf(std::ostream& os, Indent indent) const;
00147
00149 void Allocate();
00150
00152 void GenerateData() ;
00153
00154 private:
00155 ImageClassifierBase(const Self&);
00156 void operator=(const Self&);
00157
00158 typedef typename TInputImage::SizeType InputImageSizeType;
00159
00160 InputImageConstPointer m_InputImage;
00161 ClassifiedImagePointer m_ClassifiedImage;
00162 std::vector< double > m_PixelMembershipValue;
00163
00165 virtual void Classify();
00166
00167 };
00168
00169 }
00170
00171 #ifndef ITK_MANUAL_INSTANTIATION
00172 #include "itkImageClassifierBase.txx"
00173 #endif
00174
00175
00176
00177 #endif