ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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,
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;
63 using InputImagePointer = typename InputImageType::Pointer;
64 using InputImageConstPointer = typename InputImageType::ConstPointer;
65 using InputImageRegionType = typename InputImageType::RegionType;
66 using InputImagePixelType = typename InputImageType::PixelType;
67 using IndexType = typename InputImageType::IndexType;
68
69 using OutputImagePointer = typename OutputImageType::Pointer;
70 using OutputImageConstPointer = typename OutputImageType::ConstPointer;
71 using OutputImageRegionType = typename OutputImageType::RegionType;
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);
93
95
96protected:
98 ~LabelImageToLabelMapFilter() override = default;
99 void
100 PrintSelf(std::ostream & os, Indent indent) const override;
101
105 void
107
109 void
110 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
111
112 void
114
115 void
116 ThreadedGenerateData(const OutputImageRegionType & regionForThread, ThreadIdType threadId) override;
117
118 void
120 {
121 itkExceptionMacro("This class requires threadId so it must use classic multi-threading model");
122 }
123
124 void
126
127private:
129
130 typename std::vector<OutputImagePointer> m_TemporaryImages{};
131}; // end of class
132} // end namespace itk
133
134#ifndef ITK_MANUAL_INSTANTIATION
135# include "itkLabelImageToLabelMapFilter.hxx"
136#endif
137
138#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
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::LabelObjectType LabelObjectType
typename InputImageType::RegionType InputImageRegionType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
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 EnlargeOutputRequestedRegion(DataObject *output) 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 BeforeThreadedGenerateData() override
typename OutputImageType::ConstPointer OutputImageConstPointer
Templated n-dimensional image to store labeled objects.
Definition itkLabelMap.h:71
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType