itkScalarToRGBColormapImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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&);
00126 void operator=(const Self&);
00127
00128 typename ColormapType::Pointer m_Colormap;
00129
00130 bool m_UseInputImageExtremaForScaling;
00131 };
00132
00133 }
00134
00135 #ifndef ITK_MANUAL_INSTANTIATION
00136 #include "itkScalarToRGBColormapImageFilter.txx"
00137 #endif
00138
00139 #endif
00140