ITK  5.2.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  * http://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 
58 
59  using InputImageType = TInputImage;
60  using InputImagePointer = typename InputImageType::Pointer;
61  using InputImageConstPointer = typename InputImageType::ConstPointer;
63  using InputImagePixelType = typename InputImageType::PixelType;
66 
67  using OutputImageType = TOutputImage;
68  using OutputImagePointer = typename OutputImageType::Pointer;
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);
86 
90  itkSetMacro(Seed2, IndexType);
91  itkGetConstMacro(Seed2, IndexType);
93 
95  itkSetMacro(Threshold, double);
96  itkGetConstMacro(Threshold, double);
98 
101  itkSetMacro(IsolatedValueTolerance, double);
102  itkGetConstMacro(IsolatedValueTolerance, double);
104 
107  itkSetMacro(UpperValueLimit, double);
108  itkGetConstMacro(UpperValueLimit, double);
110 
114  itkSetMacro(ReplaceValue1, OutputImagePixelType);
115  itkGetConstMacro(ReplaceValue1, OutputImagePixelType);
116  itkSetMacro(ReplaceValue2, OutputImagePixelType);
117  itkGetConstMacro(ReplaceValue2, OutputImagePixelType);
119 
121  itkGetConstMacro(IsolatedValue, double);
122 
123 protected:
125  ~IsolatedWatershedImageFilter() override = default;
128 
131 
133 
135 
136  double m_Threshold;
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() ITKv5_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
itk::GradientMagnitudeImageFilter
Computes the gradient magnitude of an image region at each pixel.
Definition: itkGradientMagnitudeImageFilter.h:42
itk::IsolatedWatershedImageFilter::IndexType
typename InputImageType::IndexType IndexType
Definition: itkIsolatedWatershedImageFilter.h:64
itk::IsolatedWatershedImageFilter::m_Seed1
IndexType m_Seed1
Definition: itkIsolatedWatershedImageFilter.h:126
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::IsolatedWatershedImageFilter::m_Seed2
IndexType m_Seed2
Definition: itkIsolatedWatershedImageFilter.h:127
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::IsolatedWatershedImageFilter::m_GradientMagnitude
GradientMagnitudeType::Pointer m_GradientMagnitude
Definition: itkIsolatedWatershedImageFilter.h:132
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::IsolatedWatershedImageFilter::m_ReplaceValue2
OutputImagePixelType m_ReplaceValue2
Definition: itkIsolatedWatershedImageFilter.h:130
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::IsolatedWatershedImageFilter::m_Watershed
WatershedType::Pointer m_Watershed
Definition: itkIsolatedWatershedImageFilter.h:134
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::IsolatedWatershedImageFilter::m_IsolatedValue
double m_IsolatedValue
Definition: itkIsolatedWatershedImageFilter.h:137
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::IsolatedWatershedImageFilter::m_IsolatedValueTolerance
double m_IsolatedValueTolerance
Definition: itkIsolatedWatershedImageFilter.h:138
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:58
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: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::IsolatedWatershedImageFilter::m_Threshold
double m_Threshold
Definition: itkIsolatedWatershedImageFilter.h:136
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::IsolatedWatershedImageFilter::m_ReplaceValue1
OutputImagePixelType m_ReplaceValue1
Definition: itkIsolatedWatershedImageFilter.h:129
itk::ImageToImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToImageFilter.h:131
itk::IsolatedWatershedImageFilter::m_UpperValueLimit
double m_UpperValueLimit
Definition: itkIsolatedWatershedImageFilter.h:139
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