ITK  5.2.0
Insight Toolkit
itkGrayscaleMorphologicalClosingImageFilter.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 itkGrayscaleMorphologicalClosingImageFilter_h
19 #define itkGrayscaleMorphologicalClosingImageFilter_h
20 
21 #include "itkKernelImageFilter.h"
30 #include "itkCastImageFilter.h"
32 #include "itkNeighborhood.h"
33 
34 namespace itk
35 {
51 template <typename TInputImage, typename TOutputImage, typename TKernel>
53  : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_MOVE(GrayscaleMorphologicalClosingImageFilter);
57 
63 
65  itkNewMacro(Self);
66 
69 
71  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
72 
74  using InputImageType = TInputImage;
75  using OutputImageType = TOutputImage;
77  using SizeType = typename TInputImage::SizeType;
79  using PixelType = typename TInputImage::PixelType;
80  using OffsetType = typename TInputImage::OffsetType;
81  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
82 
83  using FlatKernelType = FlatStructuringElement<(Self::ImageDimension)>;
92 
94  using KernelType = TKernel;
95  // using KernelSuperclass = typename KernelType::Superclass;
96  // using KernelSuperclass = Neighborhood< typename KernelType::PixelType, ImageDimension >;
97 
99 
100 #if !defined(ITK_LEGACY_REMOVE)
101 
103  // We need to expose the enum values at the class level
104  // for backwards compatibility
105  static constexpr AlgorithmType BASIC = AlgorithmEnum::BASIC;
106  static constexpr AlgorithmType HISTO = AlgorithmEnum::HISTO;
107  static constexpr AlgorithmType ANCHOR = AlgorithmEnum::ANCHOR;
108  static constexpr AlgorithmType VHGW = AlgorithmEnum::VHGW;
109 #endif
110 
112  void
113  SetKernel(const KernelType & kernel) override;
114 
116  void
117  SetAlgorithm(AlgorithmEnum algo);
118  itkGetConstMacro(Algorithm, AlgorithmEnum);
120 
123  void
124  Modified() const override;
125 
128  itkSetMacro(SafeBorder, bool);
129  itkGetConstReferenceMacro(SafeBorder, bool);
130  itkBooleanMacro(SafeBorder);
132 
133 protected:
135  ~GrayscaleMorphologicalClosingImageFilter() override = default;
136  void
137  PrintSelf(std::ostream & os, Indent indent) const override;
138 
139  void
140  GenerateData() override;
141 
142 private:
143  // the filters used internally
145 
147 
149 
151 
153 
155 
157 
158  // and the name of the filter
160 
162 }; // end of class
163 } // end namespace itk
164 
165 #ifndef ITK_MANUAL_INSTANTIATION
166 # include "itkGrayscaleMorphologicalClosingImageFilter.hxx"
167 #endif
168 
169 #endif
itkVanHerkGilWermanDilateImageFilter.h
itk::CastImageFilter
Casts input pixels to output pixel type.
Definition: itkCastImageFilter.h:104
itkAnchorCloseImageFilter.h
itk::GrayscaleMorphologicalClosingImageFilter::m_SafeBorder
bool m_SafeBorder
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:161
itkMovingHistogramDilateImageFilter.h
itk::GrayscaleMorphologicalClosingImageFilter::m_BasicErodeFilter
BasicErodeFilterType::Pointer m_BasicErodeFilter
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:148
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
itk::GrayscaleMorphologicalClosingImageFilter::m_VanHerkGilWermanErodeFilter
VanHerkGilWermanErodeFilterType::Pointer m_VanHerkGilWermanErodeFilter
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:154
AlgorithmType
Algorithm or implementation used in the dilation/erosion operations.
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::GrayscaleMorphologicalClosingImageFilter
Grayscale closing of an image.
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:52
itk::MovingHistogramErodeImageFilter
Grayscale erosion of an image.
Definition: itkMovingHistogramErodeImageFilter.h:42
itkNeighborhood.h
itk::VanHerkGilWermanErodeImageFilter
Definition: itkVanHerkGilWermanErodeImageFilter.h:41
itk::BoxImageFilter::OffsetType
typename TInputImage::OffsetType OffsetType
Definition: itkBoxImageFilter.h:62
itkConstantBoundaryCondition.h
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::GrayscaleMorphologicalClosingImageFilter::m_HistogramDilateFilter
HistogramDilateFilterType::Pointer m_HistogramDilateFilter
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:146
itk::GrayscaleMorphologicalClosingImageFilter::m_BasicDilateFilter
BasicDilateFilterType::Pointer m_BasicDilateFilter
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:150
itkMovingHistogramErodeImageFilter.h
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkMathematicalMorphologyEnums.h
itk::AnchorCloseImageFilter
Definition: itkAnchorCloseImageFilter.h:27
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::MathematicalMorphologyEnums::Algorithm
Algorithm
Definition: itkMathematicalMorphologyEnums.h:41
itk::GrayscaleMorphologicalClosingImageFilter::m_HistogramErodeFilter
HistogramErodeFilterType::Pointer m_HistogramErodeFilter
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:144
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkBasicErodeImageFilter.h
itk::GrayscaleMorphologicalClosingImageFilter::PixelType
typename TInputImage::PixelType PixelType
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:79
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::MovingHistogramDilateImageFilter
Grayscale dilation of an image.
Definition: itkMovingHistogramDilateImageFilter.h:43
itkVanHerkGilWermanErodeImageFilter.h
itk::GrayscaleMorphologicalClosingImageFilter::m_VanHerkGilWermanDilateFilter
VanHerkGilWermanDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:152
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::GrayscaleMorphologicalClosingImageFilter::m_Algorithm
AlgorithmEnum m_Algorithm
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:159
itk::VanHerkGilWermanDilateImageFilter
Definition: itkVanHerkGilWermanDilateImageFilter.h:40
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::GrayscaleMorphologicalClosingImageFilter::m_AnchorFilter
AnchorFilterType::Pointer m_AnchorFilter
Definition: itkGrayscaleMorphologicalClosingImageFilter.h:156
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90
itk::BoxImageFilter::RegionType
typename TInputImage::RegionType RegionType
Definition: itkBoxImageFilter.h:59
itkBasicDilateImageFilter.h