ITK  6.0.0
Insight Toolkit
itkMorphologicalGradientImageFilter.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 itkMorphologicalGradientImageFilter_h
19#define itkMorphologicalGradientImageFilter_h
20
32#include "itkNeighborhood.h"
33
34namespace itk
35{
49template <typename TInputImage, typename TOutputImage, typename TKernel>
50class ITK_TEMPLATE_EXPORT MorphologicalGradientImageFilter
51 : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
52{
53public:
54 ITK_DISALLOW_COPY_AND_MOVE(MorphologicalGradientImageFilter);
55
61
63 itkNewMacro(Self);
64
66 itkOverrideGetNameOfClassMacro(MorphologicalGradientImageFilter);
67
69 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
70
72 using InputImageType = TInputImage;
73 using OutputImageType = TOutputImage;
77 using PixelType = typename TInputImage::PixelType;
78 using OffsetType = typename TInputImage::OffsetType;
79 using typename Superclass::OutputImageRegionType;
80
90
92 using KernelType = TKernel;
93 // using KernelSuperclass = typename KernelType::Superclass;
94 // using KernelSuperclass = Neighborhood< typename KernelType::PixelType, ImageDimension >;
95
97
98#if !defined(ITK_LEGACY_REMOVE)
100 using AlgorithmType = AlgorithmEnum;
101 // We need to expose the enum values at the class level
102 // for backwards compatibility
103 static constexpr AlgorithmType BASIC = AlgorithmEnum::BASIC;
104 static constexpr AlgorithmType HISTO = AlgorithmEnum::HISTO;
105 static constexpr AlgorithmType ANCHOR = AlgorithmEnum::ANCHOR;
106 static constexpr AlgorithmType VHGW = AlgorithmEnum::VHGW;
107#endif
108
110 void
111 SetKernel(const KernelType & kernel) override;
112
114 void
116 itkGetConstMacro(Algorithm, AlgorithmEnum);
121 void
122 Modified() const override;
123
124protected:
127 void
128 PrintSelf(std::ostream & os, Indent indent) const override;
129
130 void
131 GenerateData() override;
132
133private:
134 // the filters used internally
135 typename HistogramFilterType::Pointer m_HistogramFilter{};
136
137 typename BasicDilateFilterType::Pointer m_BasicDilateFilter{};
138
139 typename BasicErodeFilterType::Pointer m_BasicErodeFilter{};
140
141 typename AnchorDilateFilterType::Pointer m_AnchorDilateFilter{};
142
143 typename AnchorErodeFilterType::Pointer m_AnchorErodeFilter{};
144
145 typename VHGWDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter{};
146
147 typename VHGWErodeFilterType::Pointer m_VanHerkGilWermanErodeFilter{};
148
149 // and the name of the filter
150 AlgorithmEnum m_Algorithm{};
151}; // end of class
152} // end namespace itk
153
154#ifndef ITK_MANUAL_INSTANTIATION
155# include "itkMorphologicalGradientImageFilter.hxx"
156#endif
157
158#endif
Algorithm or implementation used in the dilation/erosion operations.
Grayscale dilation of an image.
Grayscale erosion of an image.
typename TInputImage::RegionType RegionType
typename TInputImage::SizeType SizeType
typename TInputImage::IndexType IndexType
typename TInputImage::OffsetType OffsetType
A class to support a variety of flat structuring elements, including versions created by decompositio...
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.
Compute the gradient of a grayscale image.
void SetKernel(const KernelType &kernel) override
void SetAlgorithm(AlgorithmEnum algo)
void PrintSelf(std::ostream &os, Indent indent) const override
~MorphologicalGradientImageFilter() override=default
Morphological gradients enhance the variation of pixel intensity in a given neighborhood.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Pixel-wise subtraction of two images.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....