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
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);
78
80 static constexpr unsigned int ImageDimension = TDimension;
81
83 using PixelType = TPixelType;
88
90 void
92 {
93 this->ProcessObject::SetNthInput(0, bd);
94 }
95 typename BoundaryType::Pointer
97 {
98 return static_cast<BoundaryType *>(this->GetInput(0));
99 }
100
101
103 void
105 {
106 this->ProcessObject::SetNthInput(1, bd);
107 }
108 typename BoundaryType::Pointer
110 {
111 return static_cast<BoundaryType *>(this->GetInput(1));
112 }
113
114
117 itkSetMacro(Face, unsigned short);
118 itkGetConstMacro(Face, unsigned short);
120
124 void
129 EquivalencyTableType::Pointer
131 {
132 return static_cast<EquivalencyTableType *>(this->ProcessObject::GetOutput(0));
133 }
134
135
137 void
138 GenerateData() override;
139
145
146protected:
148 {
149 const EquivalencyTable::Pointer eq = static_cast<EquivalencyTable *>(this->MakeOutput(0).GetPointer());
150
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
162 GenerateOutputRequestedRegion(DataObject * itkNotUsed(output)) override
163 {}
164};
165} // end namespace watershed
166} // end namespace itk
167
168#ifndef ITK_MANUAL_INSTANTIATION
169# include "itkWatershedBoundaryResolver.hxx"
170#endif
171
172#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()
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....