ITK  5.2.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  * http://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 
22 #include "itkWatershedSegmenter.h"
23 
24 namespace itk
25 {
26 namespace watershed
27 {
64 template <typename TPixelType, unsigned int TDimension>
65 class ITK_TEMPLATE_EXPORT BoundaryResolver : public ProcessObject
66 {
67 public:
73  itkNewMacro(Self);
74  itkTypeMacro(WatershedBoundaryResolver, ProcessObject);
76 
78  static constexpr unsigned int ImageDimension = TDimension;
79 
81  using PixelType = TPixelType;
86 
88  void
90  {
91  this->ProcessObject::SetNthInput(0, bd);
92  }
93  typename BoundaryType::Pointer
95  {
96  return static_cast<BoundaryType *>(this->GetInput(0));
97  }
99 
101  void
103  {
104  this->ProcessObject::SetNthInput(1, bd);
105  }
106  typename BoundaryType::Pointer
108  {
109  return static_cast<BoundaryType *>(this->GetInput(1));
110  }
112 
115  itkSetMacro(Face, unsigned short);
116  itkGetConstMacro(Face, unsigned short);
118 
122  void
124  {
126  }
127  EquivalencyTableType::Pointer
129  {
130  return static_cast<EquivalencyTableType *>(this->ProcessObject::GetOutput(0));
131  }
133 
135  void
136  GenerateData() override;
137 
140  using Superclass::MakeOutput;
142  MakeOutput(DataObjectPointerArraySizeType idx) override;
143 
144 protected:
146  {
147  EquivalencyTable::Pointer eq = static_cast<EquivalencyTable *>(this->MakeOutput(0).GetPointer());
148 
149  this->SetNumberOfRequiredOutputs(1);
151  }
152 
153  ~BoundaryResolver() override = default;
154  BoundaryResolver(const Self &) {}
155  void
156  operator=(const Self &)
157  {}
158  void
159  PrintSelf(std::ostream & os, Indent indent) const override;
160 
161  unsigned short m_Face{ 0 };
162  void
163  GenerateOutputRequestedRegion(DataObject * output) override;
164 };
165 } // end namespace watershed
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 # include "itkWatershedBoundaryResolver.hxx"
170 #endif
171 
172 #endif
itk::watershed::BoundaryResolver
Definition: itkWatershedBoundaryResolver.h:65
itk::watershed::BoundaryResolver::PixelType
TPixelType PixelType
Definition: itkWatershedBoundaryResolver.h:81
itk::watershed::BoundaryResolver::BoundaryResolver
BoundaryResolver(const Self &)
Definition: itkWatershedBoundaryResolver.h:154
itk::EquivalencyTable
Hash table to manage integral label equivalencies.
Definition: itkEquivalencyTable.h:44
itk::watershed::BoundaryResolver::SetBoundaryB
void SetBoundaryB(BoundaryType *bd)
Definition: itkWatershedBoundaryResolver.h:102
itk::ProcessObject::GetOutput
DataObject * GetOutput(const DataObjectIdentifierType &key)
itk::watershed::BoundaryResolver::SetEquivalencyTable
void SetEquivalencyTable(EquivalencyTableType::Pointer a)
Definition: itkWatershedBoundaryResolver.h:123
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:193
itk::watershed::BoundaryResolver::GetEquivalencyTable
EquivalencyTableType::Pointer GetEquivalencyTable()
Definition: itkWatershedBoundaryResolver.h:128
itk::watershed::BoundaryResolver::SetBoundaryA
void SetBoundaryA(BoundaryType *bd)
Definition: itkWatershedBoundaryResolver.h:89
itk::watershed::Segmenter
Definition: itkWatershedSegmenter.h:89
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::watershed::BoundaryResolver::GetBoundaryB
BoundaryType::Pointer GetBoundaryB()
Definition: itkWatershedBoundaryResolver.h:107
itk::watershed::BoundaryResolver::operator=
void operator=(const Self &)
Definition: itkWatershedBoundaryResolver.h:156
itk::watershed::Boundary
Definition: itkWatershedBoundary.h:54
itkWatershedSegmenter.h
itk::SmartPointer::GetPointer
ObjectType * GetPointer() const noexcept
Definition: itkSmartPointer.h:132
itk::watershed::BoundaryResolver::GetBoundaryA
BoundaryType::Pointer GetBoundaryA()
Definition: itkWatershedBoundaryResolver.h:94
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject::SetNthOutput
virtual void SetNthOutput(DataObjectPointerArraySizeType idx, DataObject *output)
itk::ProcessObject::SetNthInput
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::watershed::BoundaryResolver::BoundaryResolver
BoundaryResolver()
Definition: itkWatershedBoundaryResolver.h:145
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293