ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkVoronoiSegmentationImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkVoronoiSegmentationImageFilter_h
00019 #define __itkVoronoiSegmentationImageFilter_h
00020 
00021 #include "itkVoronoiSegmentationImageFilterBase.h"
00022 
00023 namespace itk
00024 {
00052 template< class TInputImage, class TOutputImage, class TBinaryPriorImage = Image< unsigned char, 2 > >
00053 class ITK_EXPORT VoronoiSegmentationImageFilter:
00054   public VoronoiSegmentationImageFilterBase< TInputImage, TOutputImage, TBinaryPriorImage >
00055 {
00056 public:
00058   typedef VoronoiSegmentationImageFilter Self;
00059   typedef VoronoiSegmentationImageFilterBase< TInputImage, TOutputImage,
00060                                               TBinaryPriorImage >                       Superclass;
00061   typedef SmartPointer< Self >       Pointer;
00062   typedef SmartPointer< const Self > ConstPointer;
00063 
00065   itkNewMacro(Self);
00066 
00068   itkTypeMacro(VoronoiSegmentationImageFilter,
00069                VoronoiSegmentationImageFilterBase);
00070 
00072   typedef typename Superclass::BinaryObjectImage BinaryObjectImage;
00073   typedef typename Superclass::IndexList         IndexList;
00074   typedef typename Superclass::IndexType         IndexType;
00075   typedef typename Superclass::RegionType        RegionType;
00076   typedef typename Superclass::InputImageType    InputImageType;
00077 
00079   itkSetMacro(Mean, double);
00080   itkGetConstMacro(Mean, double);
00082 
00085   itkSetMacro(STD, double);
00086   itkGetConstMacro(STD, double);
00088 
00090   itkSetMacro(MeanTolerance, double);
00091   itkGetConstMacro(MeanTolerance, double);
00093 
00095   itkSetMacro(STDTolerance, double);
00096 
00098   itkGetConstMacro(STDTolerance, double);
00099 
00101   void SetMeanPercentError(double x);
00102 
00103   itkGetConstMacro(MeanPercentError, double);
00104 
00106   itkGetConstMacro(STDPercentError, double);
00107   void SetSTDPercentError(double x);
00109 
00112   void TakeAPrior(const BinaryObjectImage *aprior);
00113 
00115   itkStaticConstMacro(InputImageDimension, unsigned int,
00116                       TInputImage::ImageDimension);
00117   itkStaticConstMacro(OutputImageDimension, unsigned int,
00118                       TOutputImage::ImageDimension);
00120 
00121 #ifdef ITK_USE_CONCEPT_CHECKING
00122 
00123   itkConceptMacro( SameDimensionCheck,
00124                    ( Concept::SameDimension< InputImageDimension, OutputImageDimension > ) );
00125   itkConceptMacro( IntConvertibleToOutputCheck,
00126                    ( Concept::Convertible< int, typename TOutputImage::PixelType > ) );
00127 
00129 #endif
00130 protected:
00131   VoronoiSegmentationImageFilter();
00132   ~VoronoiSegmentationImageFilter();
00133   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00135 
00136 private:
00137   double m_Mean;
00138   double m_STD;
00139   double m_MeanTolerance;
00140   double m_STDTolerance;
00141   double m_MeanPercentError;
00142   double m_STDPercentError;
00143 
00144   virtual bool TestHomogeneity(IndexList & Plist);
00145 
00146 private:
00147   VoronoiSegmentationImageFilter(const Self &); //purposely not implemented
00148   void operator=(const Self &);                 //purposely not implemented
00149 };
00150 } //end namespace
00151 
00152 #ifndef ITK_MANUAL_INSTANTIATION
00153 #include "itkVoronoiSegmentationImageFilter.hxx"
00154 #endif
00155 
00156 #endif
00157