Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkVoronoiSegmentationRGBImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVoronoiSegmentationRGBImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/10/21 17:39:46 $
00007   Version:   $Revision: 1.25 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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&); //purposely not implemented
00145   void operator=(const Self&); //purposely not implemented  
00146 };
00147 
00148 }//end namespace
00149 
00150 
00151 #ifndef ITK_MANUAL_INSTANTIATION
00152 #include "itkVoronoiSegmentationRGBImageFilter.txx"
00153 #endif
00154 
00155 #endif
00156 
00157 
00158 
00159 

Generated at Wed Mar 12 01:13:13 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000