ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkMorphologicalWatershedFromMarkersImageFilter.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 itkMorphologicalWatershedFromMarkersImageFilter_h
19#define itkMorphologicalWatershedFromMarkersImageFilter_h
20
22
23namespace itk
24{
79template <typename TInputImage, typename TLabelImage>
81 : public ImageToImageFilter<TInputImage, TLabelImage>
82{
83public:
84 ITK_DISALLOW_COPY_AND_MOVE(MorphologicalWatershedFromMarkersImageFilter);
85
91
93 using InputImageType = TInputImage;
94 using LabelImageType = TLabelImage;
95 using InputImagePointer = typename InputImageType::Pointer;
96 using InputImageConstPointer = typename InputImageType::ConstPointer;
97 using InputImageRegionType = typename InputImageType::RegionType;
98 using InputImagePixelType = typename InputImageType::PixelType;
99 using LabelImagePointer = typename LabelImageType::Pointer;
100 using LabelImageConstPointer = typename LabelImageType::ConstPointer;
101 using LabelImageRegionType = typename LabelImageType::RegionType;
102 using LabelImagePixelType = typename LabelImageType::PixelType;
103
104 using IndexType = typename LabelImageType::IndexType;
105
107 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
108
110 itkNewMacro(Self);
111
113 itkOverrideGetNameOfClassMacro(MorphologicalWatershedFromMarkersImageFilter);
114
116 void
117 SetMarkerImage(const TLabelImage * input)
118 {
119 // Process object is not const-correct so the const casting is required.
120 this->SetNthInput(1, const_cast<TLabelImage *>(input));
121 }
122
124 const LabelImageType *
129
131 void
132 SetInput1(const TInputImage * input)
133 {
134 this->SetInput(input);
135 }
136
138 void
139 SetInput2(const TLabelImage * input)
140 {
141 this->SetMarkerImage(input);
142 }
143
150 itkSetMacro(FullyConnected, bool);
151 itkGetConstReferenceMacro(FullyConnected, bool);
152 itkBooleanMacro(FullyConnected);
154
160 itkSetMacro(MarkWatershedLine, bool);
161 itkGetConstReferenceMacro(MarkWatershedLine, bool);
162 itkBooleanMacro(MarkWatershedLine);
164
165protected:
168 void
169 PrintSelf(std::ostream & os, Indent indent) const override;
170
174 void
176
180 void
181 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
182
184 void
185 GenerateData() override;
186
187private:
188 bool m_FullyConnected{ false };
189
191}; // end of class
192} // end namespace itk
193
194#ifndef ITK_MANUAL_INSTANTIATION
195# include "itkMorphologicalWatershedFromMarkersImageFilter.hxx"
196#endif
197
198#endif
Base class for all data objects in ITK.
virtual void SetInput(const InputImageType *input)
Control indentation during Print() invocation.
Definition itkIndent.h:50
void EnlargeOutputRequestedRegion(DataObject *output) override
~MorphologicalWatershedFromMarkersImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
TTarget itkDynamicCastInDebugMode(TSource x)