ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGrayscaleMorphologicalClosingImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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"
29 #include "itkCastImageFilter.h"
31 #include "itkNeighborhood.h"
32 
33 namespace itk
34 {
51 template< typename TInputImage, typename TOutputImage, typename TKernel >
52 class ITK_TEMPLATE_EXPORT GrayscaleMorphologicalClosingImageFilter:
53  public KernelImageFilter< TInputImage, TOutputImage, TKernel >
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_ASSIGN(GrayscaleMorphologicalClosingImageFilter);
57 
63 
65  itkNewMacro(Self);
66 
70 
72  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
73 
76  BASIC = 0,
77  HISTO = 1,
78  ANCHOR = 2,
79  VHGW = 3
80  };
81 
83  using InputImageType = TInputImage;
84  using OutputImageType = TOutputImage;
86  using SizeType = typename TInputImage::SizeType;
88  using PixelType = typename TInputImage::PixelType;
89  using OffsetType = typename TInputImage::OffsetType;
90  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
91 
97  using BasicDilateFilterType =
99  using BasicErodeFilterType =
107 
109  using KernelType = TKernel;
110 // using KernelSuperclass = typename KernelType::Superclass;
111 // using KernelSuperclass = Neighborhood< typename KernelType::PixelType, ImageDimension >;
112 
114  void SetKernel(const KernelType & kernel) override;
115 
117  void SetAlgorithm(int algo);
118  itkGetConstMacro(Algorithm, int);
120 
123  void Modified() const override;
124 
127  itkSetMacro(SafeBorder, bool);
128  itkGetConstReferenceMacro(SafeBorder, bool);
129  itkBooleanMacro(SafeBorder);
131 
132 protected:
134  ~GrayscaleMorphologicalClosingImageFilter() override = default;
135  void PrintSelf(std::ostream & os, Indent indent) const override;
136 
137  void GenerateData() override;
138 
139 private:
140  // the filters used internally
142 
144 
146 
148 
150 
152 
154 
155  // and the name of the filter
157 
159 }; // end of class
160 } // end namespace itk
161 
162 #ifndef ITK_MANUAL_INSTANTIATION
163 #include "itkGrayscaleMorphologicalClosingImageFilter.hxx"
164 #endif
165 
166 #endif
gray scale dilation of an image
typename TInputImage::IndexType IndexType
typename TInputImage::RegionType RegionType
VanHerkGilWermanDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename TInputImage::OffsetType OffsetType
typename OutputImageType::RegionType OutputImageRegionType
typename TInputImage::SizeType SizeType
TOutputImage OutputImageType
A base class for all the filters working on an arbitrary shaped neighborhood.
A class to support a variety of flat structuring elements, including versions created by decompositio...
gray scale erosion of an image
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Casts input pixels to output pixel type.