ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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::watershed
24{
51template <typename TScalar, unsigned int TImageDimension>
52class ITK_TEMPLATE_EXPORT EquivalenceRelabeler : public ProcessObject
53{
54public:
55 ITK_DISALLOW_COPY_AND_MOVE(EquivalenceRelabeler);
56
58 static constexpr unsigned int ImageDimension = TImageDimension;
59
64 using ScalarType = TScalar;
68
73 itkNewMacro(Self);
74 itkOverrideGetNameOfClassMacro(EquivalenceRelabeler);
78 void
80 {
81 this->ProcessObject::SetNthInput(0, img);
82 }
83 const ImageType *
85 {
86 return static_cast<ImageType *>(this->ProcessObject::GetInput(0));
87 }
88
90 void
92 {
93 this->ProcessObject::SetNthOutput(0, img);
94 }
95
96 typename ImageType::Pointer
98 {
99 return static_cast<ImageType *>(this->ProcessObject::GetOutput(0));
100 }
101
103 void
108
109 EquivalencyTableType::Pointer
111 {
112 return static_cast<EquivalencyTableType *>(this->ProcessObject::GetInput(1));
113 }
114
116 void
117 GenerateData() override;
118
124
125protected:
127 {
128 const typename ImageType::Pointer img = static_cast<ImageType *>(this->MakeOutput(0).GetPointer());
131 }
132
133 ~EquivalenceRelabeler() override = default;
134
135 void
136 PrintSelf(std::ostream & os, Indent indent) const override;
137
138 void
140
141 void
143};
144} // namespace itk::watershed
145
146#ifndef ITK_MANUAL_INSTANTIATION
147# include "itkWatershedEquivalenceRelabeler.hxx"
148#endif
149
150#endif
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
DataObject * GetOutput(const DataObjectIdentifierType &key)
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
virtual void SetNumberOfRequiredOutputs(DataObjectPointerArraySizeType _arg)
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
virtual void SetNthOutput(DataObjectPointerArraySizeType idx, DataObject *output)
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Make a DataObject of the correct type to used as the specified output.
Implements transparent reference counting.
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.
Image< IdentifierType, TImageDimension > ImageType
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Segmenter< Image< ScalarType, TImageDimension > > SegmenterType
void PrintSelf(std::ostream &os, Indent indent) const override