Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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&);
00109 void operator=(const Self&);
00110
00111 OutputPixelType m_BackgroundColor;
00112 LabelPixelType m_BackgroundValue;
00113 };
00114
00115
00116
00117 }
00118
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkLabelToRGBImageFilter.txx"
00121 #endif
00122
00123 #endif
00124