ITK  6.0.0
Insight Toolkit
itkWatershedBoundaryResolver.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 itkWatershedBoundaryResolver_h
19#define itkWatershedBoundaryResolver_h
20
21
23
24namespace itk
25{
26namespace watershed
27{
64template <typename TPixelType, unsigned int TDimension>
65class ITK_TEMPLATE_EXPORT BoundaryResolver : public ProcessObject
66{
67public:
68 ITK_DISALLOW_COPY_AND_MOVE(BoundaryResolver);
69
75 itkNewMacro(Self);
76 itkOverrideGetNameOfClassMacro(BoundaryResolver);
80 static constexpr unsigned int ImageDimension = TDimension;
81
83 using PixelType = TPixelType;
88
90 void
92 {
93 this->ProcessObject::SetNthInput(0, bd);
94 }
97 {
98 return static_cast<BoundaryType *>(this->GetInput(0));
99 }
103 void
105 {
106 this->ProcessObject::SetNthInput(1, bd);
107 }
108 typename BoundaryType::Pointer
110 {
111 return static_cast<BoundaryType *>(this->GetInput(1));
112 }
117 itkSetMacro(Face, unsigned short);
118 itkGetConstMacro(Face, unsigned short);
124 void
126 {
128 }
131 {
132 return static_cast<EquivalencyTableType *>(this->ProcessObject::GetOutput(0));
133 }
137 void
138 GenerateData() override;
139
142 using Superclass::MakeOutput;
145
146protected:
148 {
149 EquivalencyTable::Pointer eq = static_cast<EquivalencyTable *>(this->MakeOutput(0).GetPointer());
150
151 this->SetNumberOfRequiredOutputs(1);
153 }
154
155 ~BoundaryResolver() override = default;
156
157 void
158 PrintSelf(std::ostream & os, Indent indent) const override;
159
160 unsigned short m_Face{ 0 };
161 void
163};
164} // end namespace watershed
165} // end namespace itk
166
167#ifndef ITK_MANUAL_INSTANTIATION
168# include "itkWatershedBoundaryResolver.hxx"
169#endif
170
171#endif
Base class for all data objects in ITK.
SmartPointer< Self > Pointer
Hash table to manage integral label equivalencies.
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)
virtual void SetNthOutput(DataObjectPointerArraySizeType idx, DataObject *output)
ObjectType * GetPointer() const noexcept
void SetEquivalencyTable(EquivalencyTableType::Pointer a)
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
void GenerateOutputRequestedRegion(DataObject *output) override
~BoundaryResolver() override=default
EquivalencyTableType::Pointer GetEquivalencyTable()
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41