00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkVoronoiSegmentationRGBImageFilter_h
00018 #define _itkVoronoiSegmentationRGBImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkVoronoiSegmentationImageFilterBase.h"
00022 #include "itkImage.h"
00023
00024 namespace itk
00025 {
00026
00054 template <class TInputImage, class TOutputImage>
00055 class VoronoiSegmentationRGBImageFilter:
00056 public VoronoiSegmentationImageFilterBase<TInputImage,TOutputImage>
00057 {
00058
00059 public:
00061 typedef VoronoiSegmentationRGBImageFilter Self;
00062 typedef VoronoiSegmentationImageFilterBase<TInputImage,TOutputImage> Superclass;
00063 typedef SmartPointer <Self> Pointer;
00064 typedef SmartPointer<const Self> ConstPointer;
00065
00067 itkTypeMacro(VoronoiSegmentationRGBImageFilter,
00068 VoronoiSegmentationImageFilterBase);
00069
00071 itkNewMacro(Self);
00072
00074 typedef typename Superclass::BinaryObjectImage BinaryObjectImage;
00075 typedef typename Superclass::IndexList IndexList;
00076 typedef typename Superclass::IndexType IndexType;
00077 typedef typename Superclass::RegionType RegionType;
00078 typedef typename Superclass::PixelType PixelType;
00079 typedef typename Superclass::InputImagePointer InputImagePointer;
00080 typedef typename Superclass::InputImageType InputImageType;
00081 typedef Vector<float,6> RGBHCVPixel;
00082 typedef Image<RGBHCVPixel> RGBHCVImage;
00083
00085 void SetMeanPercentError(double x[6]);
00086 void SetSTDPercentError(double x[6]);
00087 void GetMeanPercentError(double x[6]){for(int i=0;i<6;i++) x[i]=m_MeanPercentError[i];};
00088 void GetSTDPercentError(double x[6]){for(int i=0;i<6;i++) x[i]=m_STDPercentError[i];};
00089 void GetMean(double x[6]){for(int i=0;i<6;i++) x[i]=m_Mean[i];};
00090 void GetSTD(double x[6]){for(int i=0;i<6;i++) x[i]=m_STD[i];};
00091 void SetMean(double x[6]){for(int i=0;i<6;i++) m_Mean[i]=x[i];};
00092 void SetSTD(double x[6]){for(int i=0;i<6;i++) m_STD[i]=x[i];};
00093 void GetMeanTolerance(double x[6]){for(int i=0;i<6;i++) x[i]=m_MeanTolerance[i];};
00094 void GetSTDTolerance(double x[6]){for(int i=0;i<6;i++) x[i]=m_STDTolerance[i];};
00095
00099 itkSetMacro(MaxValueOfRGB,double);
00100 itkGetMacro(MaxValueOfRGB,double);
00101
00104 void SetTestMean(unsigned int t1,unsigned int t2,unsigned int t3){
00105 m_TestMean[0] = t1;
00106 m_TestMean[1] = t2;
00107 m_TestMean[2] = t3;
00108 }
00109 void SetTestSTD(unsigned int t1,unsigned int t2,unsigned int t3){
00110 m_TestSTD[0] = t1;
00111 m_TestSTD[1] = t2;
00112 m_TestSTD[2] = t3;
00113 }
00114 void GetTestMean(unsigned int x[3]){
00115 x[0]=m_TestMean[0];x[1]=m_TestMean[1];x[2]=m_TestMean[2];
00116 }
00117 void GetTestSTD(unsigned int x[3]){
00118 x[0]=m_TestSTD[0];x[1]=m_TestSTD[1];x[2]=m_TestSTD[2];
00119 }
00120 void TakeAPrior(BinaryObjectImage* aprior);
00121
00122 void SetInput(const InputImageType *input);
00123
00124 protected:
00125 VoronoiSegmentationRGBImageFilter();
00126 ~VoronoiSegmentationRGBImageFilter();
00127
00128
00129 private:
00130 double m_Mean[6];
00131 double m_STD[6];
00132 double m_MeanTolerance[6];
00133 double m_STDTolerance[6];
00134 double m_MeanPercentError[6];
00135 double m_STDPercentError[6];
00136 double m_MaxValueOfRGB;
00137 unsigned int m_TestMean[3];
00138 unsigned int m_TestSTD[3];
00139 typename RGBHCVImage::Pointer m_WorkingImage;
00140
00141 virtual bool TestHomogeneity(IndexList Plist);
00142
00143 private:
00144 VoronoiSegmentationRGBImageFilter(const Self&);
00145 void operator=(const Self&);
00146 };
00147
00148 }
00149
00150
00151 #ifndef ITK_MANUAL_INSTANTIATION
00152 #include "itkVoronoiSegmentationRGBImageFilter.txx"
00153 #endif
00154
00155 #endif
00156
00157
00158
00159