ITK  6.0.0
Insight Toolkit
itkLabelMapToRGBImageFilter.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 itkLabelMapToRGBImageFilter_h
19#define itkLabelMapToRGBImageFilter_h
20
21#include "itkLabelMapFilter.h"
23#include "itkImage.h"
24#include "itkRGBPixel.h"
25
26
27namespace itk
28{
29
44template <typename TInputImage, typename TOutputImage = Image<RGBPixel<unsigned char>, TInputImage::ImageDimension>>
45class ITK_TEMPLATE_EXPORT LabelMapToRGBImageFilter : public LabelMapFilter<TInputImage, TOutputImage>
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(LabelMapToRGBImageFilter);
49
55
57 using InputImageType = TInputImage;
58 using OutputImageType = TOutputImage;
62 using InputImagePixelType = typename InputImageType::PixelType;
63 using LabelObjectType = typename InputImageType::LabelObjectType;
64
68 using OutputImagePixelType = typename OutputImageType::PixelType;
70
72
74 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
75 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
76
78 itkNewMacro(Self);
79
81 itkOverrideGetNameOfClassMacro(LabelMapToRGBImageFilter);
82
86 virtual void
87 SetFunctor(const FunctorType & functor)
88 {
89 if (m_Functor != functor)
90 {
91 m_Functor = functor;
92 this->Modified();
93 }
94 }
97 {
98 return m_Functor;
99 }
100 const FunctorType &
102 {
103 return m_Functor;
104 }
107protected:
109 ~LabelMapToRGBImageFilter() override = default;
110
111 void
113
114 void
116
117 void
119
120private:
121 FunctorType m_Functor{};
122}; // end of class
123
124} // end namespace itk
125
126#ifndef ITK_MANUAL_INSTANTIATION
127# include "itkLabelMapToRGBImageFilter.hxx"
128#endif
129
130#endif
Base class for filters that take an image as input and overwrite that image as the output.
Convert a LabelMap to a colored image.
typename OutputImageType::Pointer OutputImagePointer
typename InputImageType::ConstPointer InputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
typename InputImageType::LabelObjectType LabelObjectType
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::IndexType IndexType
typename Functor::LabelToRGBFunctor< InputImagePixelType, OutputImagePixelType > FunctorType
void ThreadedProcessLabelObject(LabelObjectType *labelObject) override
typename OutputImageType::RegionType OutputImageRegionType
typename InputImageType::Pointer InputImagePointer
void BeforeThreadedGenerateData() override
~LabelMapToRGBImageFilter() override=default
virtual void SetFunctor(const FunctorType &functor)
void GenerateOutputInformation() override
const FunctorType & GetFunctor() const
typename InputImageType::RegionType InputImageRegionType
typename InputImageType::PixelType InputImagePixelType
Light weight base class for most itk classes.
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....