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

itkScalarToRGBColormapImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkScalarToRGBColormapImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-15 12:51:13 $
00007   Version:   $Revision: 1.2 $
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 __itkScalarToRGBColormapImageFilter_h
00018 #define __itkScalarToRGBColormapImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 
00022 #include "itkColormapFunctor.h"
00023 
00024 namespace itk
00025 {
00026 
00039 template <class TInputImage, class TOutputImage>
00040 class ITK_EXPORT ScalarToRGBColormapImageFilter
00041 : public ImageToImageFilter<TInputImage, TOutputImage>
00042 {
00043 public:
00045   typedef ScalarToRGBColormapImageFilter                 Self;
00046   typedef ImageToImageFilter<TInputImage, TOutputImage>  Superclass;
00047   typedef SmartPointer<Self>                             Pointer;
00048   typedef SmartPointer<const Self>                       ConstPointer;
00049 
00051   itkNewMacro( Self );
00052 
00054   itkTypeMacro( ScalarToRGBColormapImageFilter, ImageToImageFilter );
00055 
00057   typedef TInputImage                                    InputImageType;
00058   typedef typename InputImageType::ConstPointer          InputImagePointer;
00059   typedef typename InputImageType::RegionType            InputImageRegionType;
00060   typedef typename InputImageType::PixelType             InputImagePixelType;
00061   typedef TOutputImage                                   OutputImageType;
00062   typedef typename OutputImageType::Pointer              OutputImagePointer;
00063   typedef typename OutputImageType::RegionType           OutputImageRegionType;
00064   typedef typename OutputImageType::PixelType            OutputImagePixelType;
00065 
00066   typedef Functor::ColormapFunctor<InputImagePixelType,
00067     OutputImagePixelType>                                ColormapType;
00068 
00072   typename ColormapType::Pointer GetColormap() { return m_Colormap; }
00073 
00074   void SetColormap( ColormapType *colormap )
00075     {
00076     if ( m_Colormap != colormap )
00077       {
00078       m_Colormap = colormap;
00079       this->Modified();
00080       }
00081     }
00082 
00086   typedef enum { Red, Green, Blue, Grey, Hot, Cool, Spring, Summer,
00087     Autumn, Winter, Copper, Jet, HSV, OverUnder } ColormapEnumType;
00088 
00089   void SetColormap( ColormapEnumType );
00090 
00096   itkSetMacro( UseInputImageExtremaForScaling, bool );
00097   itkGetConstMacro( UseInputImageExtremaForScaling, bool );
00098   itkBooleanMacro( UseInputImageExtremaForScaling );
00100 
00101 protected:
00102   ScalarToRGBColormapImageFilter();
00103   virtual ~ScalarToRGBColormapImageFilter() {};
00104 
00105   void PrintSelf( std::ostream& os, Indent indent ) const;
00106 
00118   void ThreadedGenerateData( const OutputImageRegionType& outputRegionForThread,
00119                              int threadId );
00120 
00122   void BeforeThreadedGenerateData();
00123 
00124 private:
00125   ScalarToRGBColormapImageFilter(const Self&); //purposely not implemented
00126   void operator=(const Self&); //purposely not implemented
00127 
00128   typename ColormapType::Pointer     m_Colormap;
00129 
00130   bool                               m_UseInputImageExtremaForScaling;
00131 };
00132 
00133 } // end namespace itk
00134 
00135 #ifndef ITK_MANUAL_INSTANTIATION
00136 #include "itkScalarToRGBColormapImageFilter.txx"
00137 #endif
00138 
00139 #endif
00140 

Generated at Tue Sep 15 04:48:55 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000