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 auto p =
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 );
128 void AddColor(
unsigned char r,
unsigned char g,
unsigned char b)
typename OutputImagePixelType::ComponentType ComponentType
Define numeric traits for std::vector.
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)
~LabelOverlayFunctor()=default
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
void AddColor(unsigned char r, unsigned char g, unsigned char b)
TRGBPixel operator()(const TInputPixel &p1, const TLabel &p2) const
Functor::LabelToRGBFunctor< TLabel, TRGBPixel > m_RGBFunctor