ITK  5.4.0
Insight Toolkit
itkWatershedEquivalenceRelabeler.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 itkWatershedEquivalenceRelabeler_h
19#define itkWatershedEquivalenceRelabeler_h
20
22
23namespace itk
24{
25namespace watershed
26{
53template <typename TScalar, unsigned int TImageDimension>
54class ITK_TEMPLATE_EXPORT EquivalenceRelabeler : public ProcessObject
55{
56public:
57 ITK_DISALLOW_COPY_AND_MOVE(EquivalenceRelabeler);
58
60 static constexpr unsigned int ImageDimension = TImageDimension;
61
66 using ScalarType = TScalar;
70
74 itkNewMacro(Self);
75 itkOverrideGetNameOfClassMacro(EquivalenceRelabeler);
79 void
81 {
82 this->ProcessObject::SetNthInput(0, img);
83 }
84 const ImageType *
86 {
87 return static_cast<ImageType *>(this->ProcessObject::GetInput(0));
88 }
92 void
94 {
95 this->ProcessObject::SetNthOutput(0, img);
96 }
97
98 typename ImageType::Pointer
100 {
101 return static_cast<ImageType *>(this->ProcessObject::GetOutput(0));
102 }
103
105 void
107 {
108 this->ProcessObject::SetNthInput(1, et);
109 }
110
113 {
114 return static_cast<EquivalencyTableType *>(this->ProcessObject::GetInput(1));
115 }
116
118 void
119 GenerateData() override;
120
123 using Superclass::MakeOutput;
126
127protected:
129 {
130 typename ImageType::Pointer img = static_cast<ImageType *>(this->MakeOutput(0).GetPointer());
131 this->SetNumberOfRequiredOutputs(1);
133 }
134
135 ~EquivalenceRelabeler() override = default;
136
137 void
138 PrintSelf(std::ostream & os, Indent indent) const override;
139
140 void
142
143 void
145};
146} // end namespace watershed
147} // end namespace itk
148
149#ifndef ITK_MANUAL_INSTANTIATION
150# include "itkWatershedEquivalenceRelabeler.hxx"
151#endif
152
153#endif
Base class for all data objects in ITK.
SmartPointer< Self > Pointer
Hash table to manage integral label equivalencies.
Templated n-dimensional image class.
Definition: itkImage.h:89
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
DataObject * GetOutput(const DataObjectIdentifierType &key)
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
virtual void SetNthOutput(DataObjectPointerArraySizeType idx, DataObject *output)
ObjectType * GetPointer() const noexcept
void GenerateInputRequestedRegion() override
void GenerateOutputRequestedRegion(DataObject *output) override
~EquivalenceRelabeler() override=default
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
void PrintSelf(std::ostream &os, Indent indent) const override
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41