ITK  6.0.0
Insight Toolkit
itkLabelOverlayImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkLabelOverlayImageFilter_h
19#define itkLabelOverlayImageFilter_h
20
23#include "itkConceptChecking.h"
24
25namespace itk
26{
55template <typename TInputImage, typename TLabelImage, typename TOutputImage>
56class ITK_TEMPLATE_EXPORT LabelOverlayImageFilter
57 : public BinaryGeneratorImageFilter<TInputImage, TLabelImage, TOutputImage>
58{
59public:
60 ITK_DISALLOW_COPY_AND_MOVE(LabelOverlayImageFilter);
61
64
66
67 using FunctorType = Functor::LabelOverlayFunctor<typename TInputImage::PixelType,
68 typename TLabelImage::PixelType,
69 typename TOutputImage::PixelType>;
70
73
74 using OutputImageType = TOutputImage;
75 using LabelImageType = TLabelImage;
76 using InputImageType = TInputImage;
77
78 using OutputPixelType = typename TOutputImage::PixelType;
79 using LabelPixelType = typename TLabelImage::PixelType;
80 using InputPixelType = typename TInputImage::PixelType;
81
83 itkOverrideGetNameOfClassMacro(LabelOverlayImageFilter);
84
86 itkNewMacro(Self);
87
89 void
90 SetLabelImage(const TLabelImage * input);
91 const LabelImageType *
98 itkSetMacro(Opacity, double);
99 itkGetConstReferenceMacro(Opacity, double);
103 itkSetMacro(BackgroundValue, LabelPixelType);
104 itkGetConstReferenceMacro(BackgroundValue, LabelPixelType);
107#ifdef ITK_USE_CONCEPT_CHECKING
108 // Begin concept checking
109 itkConceptMacro(OutputPixelShouldHaveValueType, (Concept::HasValueType<OutputPixelType>));
110 itkConceptMacro(OutputPixelShouldHaveBracketOperator,
112 // End concept checking
113#endif
114
116 void
118
120 unsigned int
122
124 using ComponentType = typename OutputPixelType::ComponentType;
125
127 void
129
130
131 itkGetConstReferenceMacro(Functor, FunctorType);
134 {
135 return m_Functor;
136 }
137
138protected:
140 ~LabelOverlayImageFilter() override = default;
141
143 void
145
147 void
148 PrintSelf(std::ostream & os, Indent indent) const override;
149
150 void
152
153private:
154 FunctorType m_Functor{};
155 double m_Opacity{};
156 LabelPixelType m_BackgroundValue{};
157};
158} // end namespace itk
159
160#ifndef ITK_MANUAL_INSTANTIATION
161# include "itkLabelOverlayImageFilter.hxx"
162#endif
163
164#endif
Implements pixel-wise generic operation of two images, or of an image and a constant.
Base class for all process objects that output image data.
TOutputImage OutputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Apply a colormap to a label image and put it on top of the input image.
void BeforeThreadedGenerateData() override
const LabelImageType * GetLabelImage() const
~LabelOverlayImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputPixelType::ComponentType ComponentType
unsigned int GetNumberOfColors() const
void SetLabelImage(const TLabelImage *input)
typename TOutputImage::PixelType OutputPixelType
void AddColor(ComponentType r, ComponentType g, ComponentType b)
void GenerateOutputInformation() override
typename TInputImage::PixelType InputPixelType
typename TLabelImage::PixelType LabelPixelType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....