18 #ifndef itkLabelOverlayFunctor_h
19 #define itkLabelOverlayFunctor_h
47 template<
typename TInputPixel,
typename TLabel,
typename TRGBPixel >
60 inline TRGBPixel
operator()(
const TInputPixel & p1,
const TLabel & p2)
const
69 typename TRGBPixel::ValueType p =
70 static_cast< typename TRGBPixel::ValueType
>( p1 );
82 const double p1_blend= p1 * ( 1.0 -
m_Opacity );
83 rgbPixel[0] =
static_cast< typename TRGBPixel::ValueType
>( opaque[0] *
m_Opacity + p1_blend );
84 rgbPixel[1] =
static_cast< typename TRGBPixel::ValueType
>( opaque[1] *
m_Opacity + p1_blend );
85 rgbPixel[2] =
static_cast< typename TRGBPixel::ValueType
>( opaque[2] *
m_Opacity + p1_blend );
100 return !(*
this != l);
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)
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Functor for converting labels into RGB triplets.
bool operator!=(const LabelOverlayFunctor &l) const
unsigned int GetNumberOfColors() const
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