ITK  5.4.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 
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:
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  }
95  typename BoundaryType::Pointer
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;
144  MakeOutput(DataObjectPointerArraySizeType idx) override;
145 
146 protected:
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
162  GenerateOutputRequestedRegion(DataObject * output) override;
163 };
164 } // end namespace watershed
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 # include "itkWatershedBoundaryResolver.hxx"
169 #endif
170 
171 #endif
itk::watershed::BoundaryResolver
Definition: itkWatershedBoundaryResolver.h:65
itk::watershed::BoundaryResolver::PixelType
TPixelType PixelType
Definition: itkWatershedBoundaryResolver.h:83
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::EquivalencyTable
Hash table to manage integral label equivalencies.
Definition: itkEquivalencyTable.h:44
itk::watershed::BoundaryResolver::SetBoundaryB
void SetBoundaryB(BoundaryType *bd)
Definition: itkWatershedBoundaryResolver.h:104
itk::ProcessObject::GetOutput
DataObject * GetOutput(const DataObjectIdentifierType &key)
itk::watershed::BoundaryResolver::SetEquivalencyTable
void SetEquivalencyTable(EquivalencyTableType::Pointer a)
Definition: itkWatershedBoundaryResolver.h:125
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:194
itk::watershed::BoundaryResolver::GetEquivalencyTable
EquivalencyTableType::Pointer GetEquivalencyTable()
Definition: itkWatershedBoundaryResolver.h:130
itk::watershed::BoundaryResolver::SetBoundaryA
void SetBoundaryA(BoundaryType *bd)
Definition: itkWatershedBoundaryResolver.h:91
itk::watershed::Segmenter
Definition: itkWatershedSegmenter.h:89
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::watershed::BoundaryResolver::GetBoundaryB
BoundaryType::Pointer GetBoundaryB()
Definition: itkWatershedBoundaryResolver.h:109
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:96
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:139
itk::watershed::BoundaryResolver::BoundaryResolver
BoundaryResolver()
Definition: itkWatershedBoundaryResolver.h:147
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