18#ifndef itkLabelOverlayFunctor_h
19#define itkLabelOverlayFunctor_h
47template <
typename TInputPixel,
typename TLabel,
typename TRGBPixel>
62 operator()(
const TInputPixel & p1,
const TLabel & p2)
const
71 auto p =
static_cast<typename TRGBPixel::ValueType
>(p1);
83 const double p1_blend = p1 * (1.0 -
m_Opacity);
84 rgbPixel[0] =
static_cast<typename TRGBPixel::ValueType
>(opaque[0] *
m_Opacity + p1_blend);
85 rgbPixel[1] =
static_cast<typename TRGBPixel::ValueType
>(opaque[1] *
m_Opacity + p1_blend);
86 rgbPixel[2] =
static_cast<typename TRGBPixel::ValueType
>(opaque[2] *
m_Opacity + p1_blend);
131 AddColor(
unsigned char r,
unsigned char g,
unsigned char b)
Functor for applying a colormap to a label image and combine it with a grayscale image.
TRGBPixel operator()(const TInputPixel &p1, const TLabel &p2) const
bool operator==(const LabelOverlayFunctor &other) const
void AddColor(unsigned char r, unsigned char g, unsigned char b)
void SetBackgroundValue(TLabel v)
~LabelOverlayFunctor()=default
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(LabelOverlayFunctor)
void SetOpacity(double opacity)
Functor::LabelToRGBFunctor< TLabel, TRGBPixel > m_RGBFunctor
typename TRGBPixel::ComponentType ComponentType
unsigned int GetNumberOfColors() const
Functor for converting labels into RGB triplets.
static void SetLength(T &m, const unsigned int s)
bool ExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Return the result of an exact comparison between two scalar values of potentially different types.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....