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
27#include "itkCastImageFilter.h"
29#include "itkNeighborhood.h"
30
31namespace itk
32{
53template <typename TInputImage, typename TOutputImage, typename TKernel>
54class ITK_TEMPLATE_EXPORT GrayscaleErodeImageFilter : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
55{
56public:
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;
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)
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
129 itkGetConstMacro(Algorithm, AlgorithmEnum);
133 void
134 Modified() const override;
135
136 void
138
139protected:
141 ~GrayscaleErodeImageFilter() override = default;
142 void
143 PrintSelf(std::ostream & os, Indent indent) const override;
144
145 void
146 GenerateData() override;
147
148private:
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 or implementation used in the dilation/erosion operations.
Grayscale erosion of an image.
typename TInputImage::RegionType RegionType
typename TInputImage::SizeType SizeType
typename TInputImage::IndexType IndexType
typename TInputImage::OffsetType OffsetType
Casts input pixels to output pixel type.
A class to support a variety of flat structuring elements, including versions created by decompositio...
Grayscale erosion of an image.
void SetKernel(const KernelType &kernel) override
void SetNumberOfWorkUnits(ThreadIdType nb) override
~GrayscaleErodeImageFilter() override=default
typename TInputImage::PixelType PixelType
void Modified() const override
void PrintSelf(std::ostream &os, Indent indent) const override
void SetAlgorithm(AlgorithmEnum algo)
void SetBoundary(const PixelType value)
Base class for all process objects that output image data.
TOutputImage OutputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
A base class for all the filters working on an arbitrary shaped neighborhood.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition: itkIntTypes.h:102