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: 2009-01-27 19:30:17 $
00007   Version:   $Revision: 1.35 $
00008 
00009   Copyright (c) Insight Software 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 ITK_EXPORT VoronoiSegmentationRGBImageFilter:
00056     public VoronoiSegmentationImageFilterBase<TInputImage,TOutputImage>
00057 {
00058 
00059 public:
00061   typedef VoronoiSegmentationRGBImageFilter       Self;
00062   typedef VoronoiSegmentationImageFilterBase<TInputImage,TOutputImage>
00063                                                   Superclass;
00064   typedef SmartPointer <Self>                     Pointer;
00065   typedef SmartPointer<const Self>                ConstPointer;
00066 
00068   itkTypeMacro(VoronoiSegmentationRGBImageFilter,
00069                VoronoiSegmentationImageFilterBase);
00070 
00072   itkNewMacro(Self);
00073 
00075   typedef typename Superclass::BinaryObjectImage BinaryObjectImage;
00076   typedef typename Superclass::IndexList         IndexList;
00077   typedef typename Superclass::IndexType         IndexType;
00078   typedef typename Superclass::RegionType        RegionType;
00079   typedef typename Superclass::PixelType         PixelType;
00080   typedef typename Superclass::InputImagePointer InputImagePointer;
00081   typedef typename Superclass::InputImageType    InputImageType;
00082   typedef Vector<float,6>                        RGBHCVPixel;
00083   typedef Image<RGBHCVPixel>                     RGBHCVImage;
00084 
00086   void SetMeanPercentError(double x[6]);
00087   void SetSTDPercentError(double x[6]);
00088   void GetMeanPercentError(double x[6]){for(int i=0;i<6;i++) x[i]=m_MeanPercentError[i];}
00089   void GetSTDPercentError(double x[6]){for(int i=0;i<6;i++) x[i]=m_STDPercentError[i];}
00090   void GetMean(double x[6]){for(int i=0;i<6;i++) x[i]=m_Mean[i];}
00091   void GetSTD(double x[6]){for(int i=0;i<6;i++) x[i]=m_STD[i];}
00092   void SetMean(double x[6]){for(int i=0;i<6;i++) m_Mean[i]=x[i];}
00093   void SetSTD(double x[6]){for(int i=0;i<6;i++) m_STD[i]=x[i];}
00094   void GetMeanTolerance(double x[6]){for(int i=0;i<6;i++) x[i]=m_MeanTolerance[i];}
00095   void GetSTDTolerance(double x[6]){for(int i=0;i<6;i++) x[i]=m_STDTolerance[i];}
00097 
00101   itkSetMacro(MaxValueOfRGB,double);
00102   itkGetMacro(MaxValueOfRGB,double);
00104 
00107   void SetTestMean(unsigned int t1,unsigned int t2,unsigned int t3){
00108     m_TestMean[0] = t1;
00109     m_TestMean[1] = t2;
00110     m_TestMean[2] = t3;
00111   }
00112   void SetTestSTD(unsigned int t1,unsigned int t2,unsigned int t3){
00113     m_TestSTD[0] = t1;
00114     m_TestSTD[1] = t2;
00115     m_TestSTD[2] = t3;
00116   }
00117   void GetTestMean(unsigned int x[3]){
00118     x[0]=m_TestMean[0];x[1]=m_TestMean[1];x[2]=m_TestMean[2];
00119   }
00120   void GetTestSTD(unsigned int x[3]){
00121     x[0]=m_TestSTD[0];x[1]=m_TestSTD[1];x[2]=m_TestSTD[2];
00122   }
00123   void TakeAPrior(const BinaryObjectImage* aprior);
00125 
00126   virtual void SetInput(const InputImageType *input); 
00127   virtual void SetInput( unsigned int, const InputImageType * image);
00128 
00130   itkStaticConstMacro(InputImageDimension, unsigned int,
00131                       TInputImage::ImageDimension );
00132   itkStaticConstMacro(OutputImageDimension, unsigned int,
00133                       TOutputImage::ImageDimension );
00135 
00136 #ifdef ITK_USE_CONCEPT_CHECKING
00137 
00138   itkConceptMacro(SameDimensionCheck,
00139     (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
00140   itkConceptMacro(IntConvertibleToOutputCheck,
00141     (Concept::Convertible<int, typename TOutputImage::PixelType>));
00142 
00144 #endif
00145 
00146 protected:
00147   VoronoiSegmentationRGBImageFilter();
00148   ~VoronoiSegmentationRGBImageFilter();
00149   void PrintSelf(std::ostream& os, Indent indent) const;
00150 
00151 private:
00152   double m_Mean[6];
00153   double m_STD[6];  
00154   double m_MeanTolerance[6];
00155   double m_STDTolerance[6];
00156   double m_MeanPercentError[6];
00157   double m_STDPercentError[6];
00158   double m_MaxValueOfRGB;
00159   unsigned int m_TestMean[3];
00160   unsigned int m_TestSTD[3];
00161   typename RGBHCVImage::Pointer m_WorkingImage;
00162 
00163   virtual bool TestHomogeneity(IndexList &Plist);
00164   
00165 private:
00166   VoronoiSegmentationRGBImageFilter(const Self&); //purposely not implemented
00167   void operator=(const Self&); //purposely not implemented  
00168 };
00169 
00170 }//end namespace
00171 
00172 
00173 #ifndef ITK_MANUAL_INSTANTIATION
00174 #include "itkVoronoiSegmentationRGBImageFilter.txx"
00175 #endif
00176 
00177 #endif
00178 

Generated at Sat Feb 28 13:51:35 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000