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

itkLabelToRGBImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLabelToRGBImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-07-07 12:27:34 $
00007   Version:   $Revision: 1.10 $
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 
00018 
00019 #ifndef __itkLabelToRGBImageFilter_h
00020 #define __itkLabelToRGBImageFilter_h
00021 
00022 #include "itkUnaryFunctorImageFilter.h"
00023 #include "itkLabelToRGBFunctor.h"
00024 
00025 namespace itk
00026 {
00027 
00043 template <class TLabelImage, typename  TOutputImage>
00044 class ITK_EXPORT LabelToRGBImageFilter :
00045     public
00046 UnaryFunctorImageFilter<TLabelImage, TOutputImage, 
00047                         Functor::LabelToRGBFunctor< 
00048   typename TLabelImage::PixelType, 
00049   typename TOutputImage::PixelType>   >
00050 {
00051 public:
00053   typedef LabelToRGBImageFilter     Self;
00054   typedef SmartPointer<Self>        Pointer;
00055   typedef SmartPointer<const Self>  ConstPointer;
00056 
00057   typedef UnaryFunctorImageFilter<TLabelImage, TOutputImage, 
00058                         Functor::LabelToRGBFunctor< 
00059                             typename TLabelImage::PixelType, 
00060                             typename TOutputImage::PixelType>   >  Superclass;
00061 
00062   typedef TOutputImage OutputImageType;
00063   typedef TLabelImage  LabelImageType;
00064 
00065   typedef typename TOutputImage::PixelType                     OutputPixelType;
00066   typedef typename TLabelImage::PixelType                      LabelPixelType;
00067   typedef typename NumericTraits< OutputPixelType >::ValueType OutputPixelValueType;
00068 
00070   itkTypeMacro(LabelToRGBImageFilter, UnaryFunctorImageFilter);
00071 
00073   itkNewMacro(Self);
00074 
00076   itkSetMacro( BackgroundValue, LabelPixelType );
00077   itkGetConstReferenceMacro( BackgroundValue, LabelPixelType );
00079 
00081   itkSetMacro( BackgroundColor, OutputPixelType );
00082   itkGetConstReferenceMacro( BackgroundColor, OutputPixelType );
00084 
00086   void ResetColors();
00087 
00089   unsigned int GetNumberOfColors() const;
00090 
00092   typedef typename OutputPixelType::ComponentType  ComponentType;
00093 
00095   void AddColor( ComponentType r, ComponentType g, ComponentType b );
00096 
00097 protected:
00098   LabelToRGBImageFilter();
00099   virtual ~LabelToRGBImageFilter() {};
00100 
00102   void BeforeThreadedGenerateData(void);
00103 
00105   void PrintSelf(std::ostream& os, Indent indent) const;
00106 
00107 private:
00108   LabelToRGBImageFilter(const Self&); //purposely not implemented
00109   void operator=(const Self&); //purposely not implemented
00110   
00111   OutputPixelType   m_BackgroundColor;
00112   LabelPixelType    m_BackgroundValue;
00113 };
00114 
00115 
00116   
00117 } // end namespace itk
00118 
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkLabelToRGBImageFilter.txx"
00121 #endif
00122   
00123 #endif
00124 

Generated at Tue Sep 15 03:49:18 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000