ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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::watershed
25{
62template <typename TPixelType, unsigned int TDimension>
63class ITK_TEMPLATE_EXPORT BoundaryResolver : public ProcessObject
64{
65public:
66 ITK_DISALLOW_COPY_AND_MOVE(BoundaryResolver);
67
74 itkNewMacro(Self);
75 itkOverrideGetNameOfClassMacro(BoundaryResolver);
78 static constexpr unsigned int ImageDimension = TDimension;
79
81 using PixelType = TPixelType;
86
89 void
91 {
92 this->ProcessObject::SetNthInput(0, bd);
93 }
94 typename BoundaryType::Pointer
96 {
97 return static_cast<BoundaryType *>(this->GetInput(0));
98 }
99
102 void
104 {
105 this->ProcessObject::SetNthInput(1, bd);
106 }
107 typename BoundaryType::Pointer
109 {
110 return static_cast<BoundaryType *>(this->GetInput(1));
111 }
112
116 itkSetMacro(Face, unsigned short);
117 itkGetConstMacro(Face, unsigned short);
123 void
128 EquivalencyTableType::Pointer
130 {
131 return static_cast<EquivalencyTableType *>(this->ProcessObject::GetOutput(0));
132 }
133
135 void
136 GenerateData() override;
137
143
144protected:
146 {
147 const EquivalencyTable::Pointer eq = static_cast<EquivalencyTable *>(this->MakeOutput(0).GetPointer());
148
151 }
152
153 ~BoundaryResolver() override = default;
154
155 void
156 PrintSelf(std::ostream & os, Indent indent) const override;
157
158 unsigned short m_Face{ 0 };
159 void
160 GenerateOutputRequestedRegion(DataObject * itkNotUsed(output)) override
161 {}
162};
163} // namespace itk::watershed
164
165#ifndef ITK_MANUAL_INSTANTIATION
166# include "itkWatershedBoundaryResolver.hxx"
167#endif
168
169#endif
SmartPointer< Self > Pointer
Hash table to manage integral label equivalencies.
SmartPointer< Self > Pointer
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 SetEquivalencyTable(EquivalencyTableType::Pointer a)
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
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
static constexpr unsigned int ImageDimension
void GenerateOutputRequestedRegion(DataObject *output) override
Boundary< PixelType, TDimension > BoundaryType
~BoundaryResolver() override=default
Segmenter< Image< TPixelType, TDimension > > SegmenterType
EquivalencyTableType::Pointer GetEquivalencyTable()