ITK  6.0.0
Insight Toolkit
itkGrayscaleErodeImageFilter.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 itkGrayscaleErodeImageFilter_h
19 #define itkGrayscaleErodeImageFilter_h
20 
21 #include "itkKernelImageFilter.h"
27 #include "itkCastImageFilter.h"
29 #include "itkNeighborhood.h"
30 
31 namespace itk
32 {
53 template <typename TInputImage, typename TOutputImage, typename TKernel>
54 class ITK_TEMPLATE_EXPORT GrayscaleErodeImageFilter : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_MOVE(GrayscaleErodeImageFilter);
58 
64 
66  itkNewMacro(Self);
67 
69  itkOverrideGetNameOfClassMacro(GrayscaleErodeImageFilter);
70 
72  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
73 
75  using InputImageType = TInputImage;
76  using OutputImageType = TOutputImage;
78  using SizeType = typename TInputImage::SizeType;
80  using PixelType = typename TInputImage::PixelType;
81  using OffsetType = typename TInputImage::OffsetType;
82  using typename Superclass::OutputImageRegionType;
83 
86 
88 
92 
97 
99  using KernelType = TKernel;
100  // using KernelSuperclass = typename KernelType::Superclass;
101  // using KernelSuperclass = Neighborhood< typename KernelType::PixelType, ImageDimension >;
102 
104 
105 #if !defined(ITK_LEGACY_REMOVE)
106 
107  using AlgorithmType = AlgorithmEnum;
108  // We need to expose the enum values at the class level
109  // for backwards compatibility
110  static constexpr AlgorithmType BASIC = AlgorithmType::BASIC;
111  static constexpr AlgorithmType HISTO = AlgorithmType::HISTO;
112  static constexpr AlgorithmType ANCHOR = AlgorithmType::ANCHOR;
113  static constexpr AlgorithmType VHGW = AlgorithmType::VHGW;
114 #endif
115 
117  void
118  SetKernel(const KernelType & kernel) override;
119 
121  void
122  SetBoundary(const PixelType value);
123 
124  itkGetConstMacro(Boundary, PixelType);
125 
127  void
128  SetAlgorithm(AlgorithmEnum algo);
129  itkGetConstMacro(Algorithm, AlgorithmEnum);
133  void
134  Modified() const override;
135 
136  void
137  SetNumberOfWorkUnits(ThreadIdType nb) override;
138 
139 protected:
141  ~GrayscaleErodeImageFilter() override = default;
142  void
143  PrintSelf(std::ostream & os, Indent indent) const override;
144 
145  void
146  GenerateData() override;
147 
148 private:
149  PixelType m_Boundary{};
150 
151  // the filters used internally
152  typename HistogramFilterType::Pointer m_HistogramFilter{};
153 
154  typename BasicFilterType::Pointer m_BasicFilter{};
155 
156  typename AnchorFilterType::Pointer m_AnchorFilter{};
157 
158  typename VHGWFilterType::Pointer m_VHGWFilter{};
159 
160  // and the name of the filter
161  AlgorithmEnum m_Algorithm{};
162 
163  // the boundary condition need to be stored here
164  DefaultBoundaryConditionType m_BoundaryCondition{};
165 }; // end of class
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 # include "itkGrayscaleErodeImageFilter.hxx"
170 #endif
171 
172 #endif
Algorithm
Algorithm or implementation used in the dilation/erosion operations.
itk::GrayscaleErodeImageFilter::PixelType
typename TInputImage::PixelType PixelType
Definition: itkGrayscaleErodeImageFilter.h:80
itk::CastImageFilter
Casts input pixels to output pixel type.
Definition: itkCastImageFilter.h:100
itk::FlatStructuringElement
A class to support a variety of flat structuring elements, including versions created by decompositio...
Definition: itkKernelImageFilter.h:27
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::BasicErodeImageFilter
Grayscale erosion of an image.
Definition: itkBasicErodeImageFilter.h:46
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkCastImageFilter.h
itk::MovingHistogramErodeImageFilter
Grayscale erosion of an image.
Definition: itkMovingHistogramErodeImageFilter.h:42
itkNeighborhood.h
itk::VanHerkGilWermanErodeImageFilter
Definition: itkVanHerkGilWermanErodeImageFilter.h:39
itk::BoxImageFilter::OffsetType
typename TInputImage::OffsetType OffsetType
Definition: itkBoxImageFilter.h:62
itkConstantBoundaryCondition.h
itk::ImageBoundaryCondition< InputImageType >
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ConstantBoundaryCondition< InputImageType >
itkKernelImageFilter.h
itk::GrayscaleErodeImageFilter
Grayscale erosion of an image.
Definition: itkGrayscaleErodeImageFilter.h:54
itk::BoxImageFilter::IndexType
typename TInputImage::IndexType IndexType
Definition: itkBoxImageFilter.h:61
itk::AnchorErodeImageFilter
Definition: itkAnchorErodeImageFilter.h:26
itkMovingHistogramErodeImageFilter.h
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkMathematicalMorphologyEnums.h
itkAnchorErodeImageFilter.h
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::MathematicalMorphologyEnums::Algorithm
Algorithm
Definition: itkMathematicalMorphologyEnums.h:42
itkBasicErodeImageFilter.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itkVanHerkGilWermanErodeImageFilter.h
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::KernelImageFilter::KernelType
TKernel KernelType
Definition: itkKernelImageFilter.h:71
itk::BoxImageFilter::SizeType
typename TInputImage::SizeType SizeType
Definition: itkBoxImageFilter.h:60
itk::KernelImageFilter
A base class for all the filters working on an arbitrary shaped neighborhood.
Definition: itkKernelImageFilter.h:41
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::BoxImageFilter::RegionType
typename TInputImage::RegionType RegionType
Definition: itkBoxImageFilter.h:59