ITK  6.0.0
Insight Toolkit
itkIsolatedWatershedImageFilter.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 itkIsolatedWatershedImageFilter_h
19#define itkIsolatedWatershedImageFilter_h
20
23
24namespace itk
25{
41template <typename TInputImage, typename TOutputImage>
42class ITK_TEMPLATE_EXPORT IsolatedWatershedImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
43{
44public:
45 ITK_DISALLOW_COPY_AND_MOVE(IsolatedWatershedImageFilter);
46
52
54 itkNewMacro(Self);
55
57 itkOverrideGetNameOfClassMacro(IsolatedWatershedImageFilter);
58
59 using InputImageType = TInputImage;
63 using InputImagePixelType = typename InputImageType::PixelType;
66
67 using OutputImageType = TOutputImage;
70 using OutputImagePixelType = typename OutputImageType::PixelType;
71
74
77 void
78 PrintSelf(std::ostream & os, Indent indent) const override;
79
83 itkSetMacro(Seed1, IndexType);
84 itkGetConstMacro(Seed1, IndexType);
90 itkSetMacro(Seed2, IndexType);
91 itkGetConstMacro(Seed2, IndexType);
95 itkSetMacro(Threshold, double);
96 itkGetConstMacro(Threshold, double);
101 itkSetMacro(IsolatedValueTolerance, double);
102 itkGetConstMacro(IsolatedValueTolerance, double);
107 itkSetMacro(UpperValueLimit, double);
108 itkGetConstMacro(UpperValueLimit, double);
114 itkSetMacro(ReplaceValue1, OutputImagePixelType);
115 itkGetConstMacro(ReplaceValue1, OutputImagePixelType);
116 itkSetMacro(ReplaceValue2, OutputImagePixelType);
117 itkGetConstMacro(ReplaceValue2, OutputImagePixelType);
121 itkGetConstMacro(IsolatedValue, double);
122
123protected:
125 ~IsolatedWatershedImageFilter() override = default;
126 IndexType m_Seed1{};
127 IndexType m_Seed2{};
128
129 OutputImagePixelType m_ReplaceValue1{};
130 OutputImagePixelType m_ReplaceValue2{};
131
132 typename GradientMagnitudeType::Pointer m_GradientMagnitude{};
133
134 typename WatershedType::Pointer m_Watershed{};
135
136 double m_Threshold{};
137 double m_IsolatedValue{};
138 double m_IsolatedValueTolerance{};
139 double m_UpperValueLimit{};
140
141 // Override since the filter needs all the data for the algorithm
142 void
144
145 // Override since the filter produces the entire dataset
146 void
148
149 void
150 VerifyInputInformation() const override;
151 void
152 GenerateData() override;
153};
154} // end namespace itk
155
156#ifndef ITK_MANUAL_INSTANTIATION
157# include "itkIsolatedWatershedImageFilter.hxx"
158#endif
159
160#endif
Base class for all data objects in ITK.
Computes the gradient magnitude of an image region at each pixel.
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
Base class for filters that take an image as input and produce an image as output.
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::Pointer InputImagePointer
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::RegionType InputImageRegionType
Templated n-dimensional image class.
Definition: itkImage.h:89
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Isolate watershed basins using two seeds.
void EnlargeOutputRequestedRegion(DataObject *output) override
~IsolatedWatershedImageFilter() override=default
void VerifyInputInformation() const override
Verifies that the input images occupy the same physical space and the each index is at the same physi...
typename InputImageType::SizeType SizeType
typename InputImageType::IndexType IndexType
void PrintSelf(std::ostream &os, Indent indent) const override
typename NumericTraits< InputImagePixelType >::RealType RealPixelType
void GenerateInputRequestedRegion() override
Define additional traits for native types such as int or float.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
A low-level image analysis algorithm that automatically produces a hierarchy of segmented,...
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....