18 #ifndef __itkLabelOverlayFunctor_h
19 #define __itkLabelOverlayFunctor_h
46 template<
typename TInputPixel,
typename TLabel,
typename TRGBPixel >
59 inline TRGBPixel
operator()(
const TInputPixel & p1,
const TLabel & p2)
const
68 typename TRGBPixel::ValueType p =
69 static_cast< typename TRGBPixel::ValueType
>( p1 );
81 const double p1_blend= p1 * ( 1.0 -
m_Opacity );
82 rgbPixel[0] =
static_cast< typename TRGBPixel::ValueType
>( opaque[0] *
m_Opacity + p1_blend );
83 rgbPixel[1] =
static_cast< typename TRGBPixel::ValueType
>( opaque[1] *
m_Opacity + p1_blend );
84 rgbPixel[2] =
static_cast< typename TRGBPixel::ValueType
>( opaque[2] *
m_Opacity + p1_blend );
void SetBackgroundValue(TLabel v)
bool operator==(const LabelOverlayFunctor &l) const
Functor for applying a colormap to a label image and combine it with a grayscale image.
void SetOpacity(double opacity)
static void SetLength(T &m, const unsigned int s)
Functor for converting labels into RGB triplets.
bool operator!=(const LabelOverlayFunctor &l) const
unsigned int GetNumberOfColors() const
Define additional traits for native types such as int or float.
TRGBPixel operator()(const TInputPixel &p1, const TLabel &p2) const
TRGBPixel::ComponentType ComponentType
void AddColor(ComponentType r, ComponentType g, ComponentType b)
Functor::LabelToRGBFunctor< TLabel, TRGBPixel > m_RGBFunctor