ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelMapToBinaryImageFilter.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 itkLabelMapToBinaryImageFilter_h
19#define itkLabelMapToBinaryImageFilter_h
20
21#include "itkLabelMapFilter.h"
22
23namespace itk
24{
44template <typename TInputImage, typename TOutputImage>
45class ITK_TEMPLATE_EXPORT LabelMapToBinaryImageFilter : public LabelMapFilter<TInputImage, TOutputImage>
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(LabelMapToBinaryImageFilter);
49
55
57 using InputImageType = TInputImage;
58 using OutputImageType = TOutputImage;
59 using InputImagePointer = typename InputImageType::Pointer;
60 using InputImageConstPointer = typename InputImageType::ConstPointer;
61 using InputImageRegionType = typename InputImageType::RegionType;
62 using InputImagePixelType = typename InputImageType::PixelType;
63 using LabelObjectType = typename InputImageType::LabelObjectType;
64
65 using OutputImagePointer = typename OutputImageType::Pointer;
66 using OutputImageConstPointer = typename OutputImageType::ConstPointer;
67 using OutputImageRegionType = typename OutputImageType::RegionType;
68 using OutputImagePixelType = typename OutputImageType::PixelType;
69 using IndexType = typename OutputImageType::IndexType;
70
72 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
73 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
74
76 itkNewMacro(Self);
77
79 itkOverrideGetNameOfClassMacro(LabelMapToBinaryImageFilter);
80
85 itkSetMacro(BackgroundValue, OutputImagePixelType);
86 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
88
93 itkSetMacro(ForegroundValue, OutputImagePixelType);
94 itkGetConstMacro(ForegroundValue, OutputImagePixelType);
96
99 void
101 {
102 // Process object is not const-correct so the const casting is required.
103 this->SetNthInput(1, const_cast<OutputImageType *>(input));
104 }
105
106 OutputImageType *
108 {
109 return static_cast<OutputImageType *>(const_cast<DataObject *>(this->ProcessObject::GetInput(1)));
110 }
111
113 void
115 {
116 this->SetInput(input);
117 }
118
120 void
122 {
123 this->SetBackgroundImage(input);
124 }
125
126protected:
128 ~LabelMapToBinaryImageFilter() override = default;
129
133 void
135
137 void
138 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
139
140 void
141 GenerateData() override;
142
143 void
144 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
145
146 // part of a compile error workaround for GCC 4.8.5-28 (Red Hat) from 20150623
147 void
149 {
151 }
152
153 void
155
156 void
157 PrintSelf(std::ostream & os, Indent indent) const override;
158
159private:
162}; // end of class
163} // end namespace itk
164
165#ifndef ITK_MANUAL_INSTANTIATION
166# include "itkLabelMapToBinaryImageFilter.hxx"
167#endif
168
169#endif
Base class for all data objects in ITK.
virtual void SetInput(const InputImageType *input)
Control indentation during Print() invocation.
Definition itkIndent.h:50
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
void SuperclassDynamicTGD(const OutputImageRegionType &outputRegion)
void SetInput2(const OutputImageType *input)
void GenerateInputRequestedRegion() override
void SetBackgroundImage(const OutputImageType *input)
void PrintSelf(std::ostream &os, Indent indent) const override
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
void SetInput1(const InputImageType *input)
void ThreadedProcessLabelObject(LabelObjectType *labelObject) override
~LabelMapToBinaryImageFilter() override=default
void EnlargeOutputRequestedRegion(DataObject *output) override
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....