ITK  5.3.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  * 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 itkMorphologicalGradientImageFilter_h
19 #define itkMorphologicalGradientImageFilter_h
20 
21 #include "itkKernelImageFilter.h"
30 #include "itkSubtractImageFilter.h"
32 #include "itkNeighborhood.h"
33 
34 namespace itk
35 {
49 template <typename TInputImage, typename TOutputImage, typename TKernel>
50 class ITK_TEMPLATE_EXPORT MorphologicalGradientImageFilter
51  : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_MOVE(MorphologicalGradientImageFilter);
55 
61 
63  itkNewMacro(Self);
64 
67 
69  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
70 
72  using InputImageType = TInputImage;
73  using OutputImageType = TOutputImage;
75  using SizeType = typename TInputImage::SizeType;
77  using PixelType = typename TInputImage::PixelType;
78  using OffsetType = typename TInputImage::OffsetType;
79  using OutputImageRegionType = 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)
99 
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
115  SetAlgorithm(AlgorithmEnum algo);
116  itkGetConstMacro(Algorithm, AlgorithmEnum);
118 
121  void
122  Modified() const override;
123 
124 protected:
126  ~MorphologicalGradientImageFilter() override = default;
127  void
128  PrintSelf(std::ostream & os, Indent indent) const override;
129 
130  void
131  GenerateData() override;
132 
133 private:
134  // the filters used internally
136 
138 
140 
142 
144 
146 
148 
149  // and the name of the filter
151 }; // end of class
152 } // end namespace itk
153 
154 #ifndef ITK_MANUAL_INSTANTIATION
155 # include "itkMorphologicalGradientImageFilter.hxx"
156 #endif
157 
158 #endif
itkVanHerkGilWermanDilateImageFilter.h
itk::MorphologicalGradientImageFilter::m_AnchorDilateFilter
AnchorDilateFilterType::Pointer m_AnchorDilateFilter
Definition: itkMorphologicalGradientImageFilter.h:141
itk::MorphologicalGradientImageFilter::m_BasicDilateFilter
BasicDilateFilterType::Pointer m_BasicDilateFilter
Definition: itkMorphologicalGradientImageFilter.h:137
itk::BasicDilateImageFilter
Grayscale dilation of an image.
Definition: itkBasicDilateImageFilter.h:48
itk::FlatStructuringElement
A class to support a variety of flat structuring elements, including versions created by decompositio...
Definition: itkKernelImageFilter.h:27
AlgorithmType
Algorithm or implementation used in the dilation/erosion operations.
itk::MorphologicalGradientImageFilter::m_BasicErodeFilter
BasicErodeFilterType::Pointer m_BasicErodeFilter
Definition: itkMorphologicalGradientImageFilter.h:139
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::BasicErodeImageFilter
Grayscale erosion of an image.
Definition: itkBasicErodeImageFilter.h:46
itk::MorphologicalGradientImageFilter::PixelType
typename TInputImage::PixelType PixelType
Definition: itkMorphologicalGradientImageFilter.h:77
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::AnchorDilateImageFilter
Definition: itkAnchorDilateImageFilter.h:27
itkNeighborhood.h
itk::VanHerkGilWermanErodeImageFilter
Definition: itkVanHerkGilWermanErodeImageFilter.h:41
itk::MorphologicalGradientImageFilter::m_HistogramFilter
HistogramFilterType::Pointer m_HistogramFilter
Definition: itkMorphologicalGradientImageFilter.h:135
itk::BoxImageFilter::OffsetType
typename TInputImage::OffsetType OffsetType
Definition: itkBoxImageFilter.h:62
itkConstantBoundaryCondition.h
itk::MorphologicalGradientImageFilter::m_VanHerkGilWermanErodeFilter
VHGWErodeFilterType::Pointer m_VanHerkGilWermanErodeFilter
Definition: itkMorphologicalGradientImageFilter.h:147
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
itkKernelImageFilter.h
itk::BoxImageFilter::IndexType
typename TInputImage::IndexType IndexType
Definition: itkBoxImageFilter.h:61
itk::AnchorErodeImageFilter
Definition: itkAnchorErodeImageFilter.h:26
itk::MorphologicalGradientImageFilter::m_AnchorErodeFilter
AnchorErodeFilterType::Pointer m_AnchorErodeFilter
Definition: itkMorphologicalGradientImageFilter.h:143
itk::MovingHistogramMorphologicalGradientImageFilter
Morphological gradients enhance the variation of pixel intensity in a given neighborhood.
Definition: itkMovingHistogramMorphologicalGradientImageFilter.h:235
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkMathematicalMorphologyEnums.h
itk::MorphologicalGradientImageFilter
Compute the gradient of a grayscale image.
Definition: itkMorphologicalGradientImageFilter.h:50
itkAnchorDilateImageFilter.h
itkSubtractImageFilter.h
itk::MorphologicalGradientImageFilter::m_VanHerkGilWermanDilateFilter
VHGWDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter
Definition: itkMorphologicalGradientImageFilter.h:145
itkAnchorErodeImageFilter.h
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::MathematicalMorphologyEnums::Algorithm
Algorithm
Definition: itkMathematicalMorphologyEnums.h:41
itk::SubtractImageFilter
Pixel-wise subtraction of two images.
Definition: itkSubtractImageFilter.h:68
itkMovingHistogramMorphologicalGradientImageFilter.h
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkBasicErodeImageFilter.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkVanHerkGilWermanErodeImageFilter.h
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::KernelImageFilter::KernelType
TKernel KernelType
Definition: itkKernelImageFilter.h:71
itk::VanHerkGilWermanDilateImageFilter
Definition: itkVanHerkGilWermanDilateImageFilter.h:40
itk::MorphologicalGradientImageFilter::m_Algorithm
AlgorithmEnum m_Algorithm
Definition: itkMorphologicalGradientImageFilter.h:150
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
itkBasicDilateImageFilter.h