ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkIsolatedWatershedImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
40 template< typename TInputImage, typename TOutputImage >
41 class ITK_TEMPLATE_EXPORT IsolatedWatershedImageFilter:
42  public ImageToImageFilter< TInputImage, TOutputImage >
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_ASSIGN(IsolatedWatershedImageFilter);
46 
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(IsolatedWatershedImageFilter,
59 
60  using InputImageType = TInputImage;
61  using InputImagePointer = typename InputImageType::Pointer;
62  using InputImageConstPointer = typename InputImageType::ConstPointer;
64  using InputImagePixelType = typename InputImageType::PixelType;
67 
68  using OutputImageType = TOutputImage;
69  using OutputImagePointer = typename OutputImageType::Pointer;
71  using OutputImagePixelType = typename OutputImageType::PixelType;
72 
75 
78  void 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 GenerateInputRequestedRegion() override;
143 
144  // Override since the filter produces the entire dataset
145  void EnlargeOutputRequestedRegion(DataObject *output) override;
146 
147  void VerifyInputInformation() ITKv5_CONST override;
148  void GenerateData() override;
149 };
150 } // end namespace itk
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkIsolatedWatershedImageFilter.hxx"
154 #endif
155 
156 #endif
A low-level image analysis algorithm that automatically produces a hierarchy of segmented, labeled images from a scalar-valued image input.
typename OutputImageType::Pointer OutputImagePointer
Isolate watershed basins using two seeds.
GradientMagnitudeType::Pointer m_GradientMagnitude
Define numeric traits for std::vector.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename InputImageType::IndexType IndexType
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Computes the gradient magnitude of an image region at each pixel.
typename InputImageType::SizeType SizeType
typename InputImageType::RegionType InputImageRegionType
Base class for filters that take an image as input and produce an image as output.
typename NumericTraits< InputImagePixelType >::RealType RealPixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename InputImageType::ConstPointer InputImageConstPointer
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75