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

itkLabelVotingImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLabelVotingImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/07/15 11:48:09 $
00007   Version:   $Revision: 1.2 $
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 __itkLabelVotingImageFilter_h
00018 #define __itkLabelVotingImageFilter_h
00019 
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk
00024 {
00073 template <typename TInputImage, typename TOutputImage = TInputImage>
00074 class ITK_EXPORT LabelVotingImageFilter :
00075     public ImageToImageFilter< TInputImage, TOutputImage >
00076 {
00077 public:
00079   typedef LabelVotingImageFilter Self;
00080   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00081   typedef SmartPointer<Self> Pointer;
00082   typedef SmartPointer<const Self>  ConstPointer;
00083 
00085   itkNewMacro(Self);
00086 
00088   itkTypeMacro(LabelVotingImageFilter, ImageToImageFilter);
00089   
00092   typedef typename TOutputImage::PixelType OutputPixelType;
00093   typedef typename TInputImage::PixelType InputPixelType;
00094 
00097   itkStaticConstMacro(ImageDimension, unsigned int,
00098                       TOutputImage::ImageDimension);
00099   
00101   typedef TInputImage  InputImageType;
00102   typedef TOutputImage OutputImageType;
00103   typedef typename InputImageType::ConstPointer InputImagePointer;
00104   typedef typename OutputImageType::Pointer     OutputImagePointer;
00105   
00107   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00108 
00111   void SetLabelForUndecidedPixels( const OutputPixelType l )
00112   {
00113     this->m_LabelForUndecidedPixels = l;
00114     this->m_HasLabelForUndecidedPixels = true;
00115     this->Modified();
00116   }
00117   
00124   OutputPixelType GetLabelForUndecidedPixels() const
00125   {
00126     return this->m_LabelForUndecidedPixels;
00127   }
00128   
00131   void UnsetLabelForUndecidedPixels()
00132   {
00133     if ( this->m_HasLabelForUndecidedPixels )
00134       {
00135       this->m_HasLabelForUndecidedPixels = false;
00136       this->Modified();
00137       }
00138   }
00139   
00140 protected:
00141   LabelVotingImageFilter() { this->m_HasLabelForUndecidedPixels = false; }
00142   virtual ~LabelVotingImageFilter() {}  
00143 
00145   void BeforeThreadedGenerateData ();
00146   void ThreadedGenerateData
00147   ( const OutputImageRegionType &outputRegionForThread, int threadId);
00148   
00149   void PrintSelf(std::ostream&, Indent) const;
00150 
00152   InputPixelType ComputeMaximumInputValue();
00153 
00154 private:
00155   LabelVotingImageFilter(const Self&); //purposely not implemented
00156   void operator=(const Self&); //purposely not implemented
00157 
00158   OutputPixelType m_LabelForUndecidedPixels;
00159   bool m_HasLabelForUndecidedPixels;
00160   InputPixelType m_TotalLabelCount;
00161 };
00162   
00163 } // end namespace itk
00164 
00165 #ifndef ITK_MANUAL_INSTANTIATION
00166 #include "itkLabelVotingImageFilter.txx"
00167 #endif
00168 
00169 #endif

Generated at Wed May 24 23:32:00 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000