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 
24 namespace itk
25 {
41 template <typename TInputImage, typename TOutputImage>
42 class ITK_TEMPLATE_EXPORT IsolatedWatershedImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
43 {
44 public:
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 
123 protected:
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
143  GenerateInputRequestedRegion() override;
144 
145  // Override since the filter produces the entire dataset
146  void
147  EnlargeOutputRequestedRegion(DataObject * output) override;
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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::GradientMagnitudeImageFilter
Computes the gradient magnitude of an image region at each pixel.
Definition: itkGradientMagnitudeImageFilter.h:42
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::IsolatedWatershedImageFilter::IndexType
typename InputImageType::IndexType IndexType
Definition: itkIsolatedWatershedImageFilter.h:64
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::IsolatedWatershedImageFilter::RealPixelType
typename NumericTraits< InputImagePixelType >::RealType RealPixelType
Definition: itkIsolatedWatershedImageFilter.h:72
itk::IsolatedWatershedImageFilter::SizeType
typename InputImageType::SizeType SizeType
Definition: itkIsolatedWatershedImageFilter.h:65
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::WatershedImageFilter
A low-level image analysis algorithm that automatically produces a hierarchy of segmented,...
Definition: itkWatershedImageFilter.h:149
itk::ImageToImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::IsolatedWatershedImageFilter
Isolate watershed basins using two seeds.
Definition: itkIsolatedWatershedImageFilter.h:42
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:60
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkWatershedImageFilter.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::ImageToImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToImageFilter.h:131
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itkGradientMagnitudeImageFilter.h