ITK  5.4.0
Insight Toolkit
itkWatershedRelabeler.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 itkWatershedRelabeler_h
19#define itkWatershedRelabeler_h
20
23
24namespace itk
25{
26namespace watershed
27{
64template <typename TScalar, unsigned int TImageDimension>
65class ITK_TEMPLATE_EXPORT Relabeler : public ProcessObject
66{
67public:
68
70 using Self = Relabeler;
74
76 itkNewMacro(Self);
77 itkOverrideGetNameOfClassMacro(Relabeler);
81 static constexpr unsigned int ImageDimension = TImageDimension;
82
84 using ScalarType = TScalar;
89
92 using Superclass::MakeOutput;
95
97 void
99 {
100 this->ProcessObject::SetNthInput(0, img);
101 }
102
103 ImageType *
105 {
106 return itkDynamicCastInDebugMode<ImageType *>(this->ProcessObject::GetInput(0));
107 }
108
110 void
112 {
113 this->ProcessObject::SetNthOutput(0, img);
114 }
115
116 ImageType *
118 {
119 return itkDynamicCastInDebugMode<ImageType *>(this->ProcessObject::GetOutput(0));
120 }
121
123 void
125 {
126 this->ProcessObject::SetNthInput(1, et);
127 }
128
129 SegmentTreeType *
131 {
132 return itkDynamicCastInDebugMode<SegmentTreeType *>(this->ProcessObject::GetInput(1));
133 }
134
136 void
137 GenerateData() override;
138
141 itkSetClampMacro(FloodLevel, double, 0.0, 1.0);
142 itkGetConstMacro(FloodLevel, double);
146 void
148
149 void
150 GraftNthOutput(unsigned int idx, ImageType * graft);
151
152protected:
154 ~Relabeler() override = default;
155 Relabeler(const Self &) {}
156 void
158 {}
159 void
160 PrintSelf(std::ostream & os, Indent indent) const override;
161
162 double m_FloodLevel{ 0.0 };
163 void
165
166 void
168};
169} // end namespace watershed
170} // end namespace itk
171
172#ifndef ITK_MANUAL_INSTANTIATION
173# include "itkWatershedRelabeler.hxx"
174#endif
175
176#endif
Base class for all data objects in ITK.
SmartPointer< Self > Pointer
Templated n-dimensional image class.
Definition: itkImage.h:89
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)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
virtual void SetNthOutput(DataObjectPointerArraySizeType idx, DataObject *output)
void GraftNthOutput(unsigned int idx, ImageType *graft)
void SetOutputImage(ImageType *img)
~Relabeler() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
SegmentTreeType * GetInputSegmentTree()
void GenerateOutputRequestedRegion(DataObject *output) override
void GenerateData() override
void GenerateInputRequestedRegion() override
void SetInputSegmentTree(SegmentTreeType *et)
void GraftOutput(ImageType *graft)
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
void SetInputImage(ImageType *img)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41