ITK  6.0.0
Insight Toolkit
itkLabelImageToLabelMapFilter.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 itkLabelImageToLabelMapFilter_h
19#define itkLabelImageToLabelMapFilter_h
20
22#include "itkLabelMap.h"
23#include "itkLabelObject.h"
24
25namespace itk
26{
47template <typename TInputImage,
48 typename TOutputImage = LabelMap<LabelObject<typename TInputImage::PixelType, TInputImage::ImageDimension>>>
49class ITK_TEMPLATE_EXPORT LabelImageToLabelMapFilter : public ImageToImageFilter<TInputImage, TOutputImage>
50{
51public:
52 ITK_DISALLOW_COPY_AND_MOVE(LabelImageToLabelMapFilter);
53
59
61 using InputImageType = TInputImage;
62 using OutputImageType = TOutputImage;
66 using InputImagePixelType = typename InputImageType::PixelType;
68
72 using OutputImagePixelType = typename OutputImageType::PixelType;
73 using LabelObjectType = typename OutputImageType::LabelObjectType;
74 using LengthType = typename LabelObjectType::LengthType;
75
77 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
78 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
79
81 itkNewMacro(Self);
82
84 itkOverrideGetNameOfClassMacro(LabelImageToLabelMapFilter);
85
90 itkSetMacro(BackgroundValue, OutputImagePixelType);
91 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
94#ifdef ITK_USE_CONCEPT_CHECKING
96#endif
97
98protected:
100 ~LabelImageToLabelMapFilter() override = default;
101 void
102 PrintSelf(std::ostream & os, Indent indent) const override;
103
107 void
109
111 void
112 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
113
114 void
116
117 void
118 ThreadedGenerateData(const OutputImageRegionType & regionForThread, ThreadIdType threadId) override;
119
120 void
122 {
123 itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
124 }
125
126 void
128
129private:
130 OutputImagePixelType m_BackgroundValue{};
131
132 typename std::vector<OutputImagePointer> m_TemporaryImages{};
133}; // end of class
134} // end namespace itk
135
136#ifndef ITK_MANUAL_INSTANTIATION
137# include "itkLabelImageToLabelMapFilter.hxx"
138#endif
139
140#endif
Base class for all data objects in ITK.
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
convert a labeled image to a label collection image
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::LabelObjectType LabelObjectType
typename InputImageType::RegionType InputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
typename OutputImageType::Pointer OutputImagePointer
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::IndexType IndexType
typename LabelObjectType::LengthType LengthType
typename InputImageType::PixelType InputImagePixelType
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
void AfterThreadedGenerateData() override
void GenerateInputRequestedRegion() override
void PrintSelf(std::ostream &os, Indent indent) const override
~LabelImageToLabelMapFilter() override=default
void ThreadedGenerateData(const OutputImageRegionType &regionForThread, ThreadIdType threadId) override
void EnlargeOutputRequestedRegion(DataObject *) override
void BeforeThreadedGenerateData() override
typename OutputImageType::ConstPointer OutputImageConstPointer
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition: itkIntTypes.h:102