ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGrayscaleMorphologicalOpeningImageFilter.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 itkGrayscaleMorphologicalOpeningImageFilter_h
19 #define itkGrayscaleMorphologicalOpeningImageFilter_h
20 
21 #include "itkKernelImageFilter.h"
30 #include "itkNeighborhood.h"
31 
32 namespace itk
33 {
50 template< typename TInputImage, typename TOutputImage, typename TKernel >
51 class ITK_TEMPLATE_EXPORT GrayscaleMorphologicalOpeningImageFilter:
52  public KernelImageFilter< TInputImage, TOutputImage, TKernel >
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_ASSIGN(GrayscaleMorphologicalOpeningImageFilter);
56 
62 
64  itkNewMacro(Self);
65 
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 
88  using BasicErodeFilterType =
90  using BasicDilateFilterType =
98 
100  using KernelType = TKernel;
101 // using KernelSuperclass = typename KernelType::Superclass;
102 // using KernelSuperclass = Neighborhood< typename KernelType::PixelType, ImageDimension >;
103 
105  void SetKernel(const KernelType & kernel) override;
106 
108  void SetAlgorithm(int algo);
109 
110  itkGetConstMacro(Algorithm, int);
111 
114  void Modified() const override;
115 
118  BASIC = 0,
119  HISTO = 1,
120  ANCHOR = 2,
121  VHGW = 3
122  };
123 
126  itkSetMacro(SafeBorder, bool);
127  itkGetConstReferenceMacro(SafeBorder, bool);
128  itkBooleanMacro(SafeBorder);
130 
131 protected:
133  ~GrayscaleMorphologicalOpeningImageFilter() override = default;
134  void PrintSelf(std::ostream & os, Indent indent) const override;
135 
136  void GenerateData() override;
137 
138 private:
139  // the filters used internally
141 
143 
145 
147 
149 
151 
153 
154  // and the name of the filter
156 
157  bool m_SafeBorder{true};
158 }; // end of class
159 } // end namespace itk
160 
161 #ifndef ITK_MANUAL_INSTANTIATION
162 #include "itkGrayscaleMorphologicalOpeningImageFilter.hxx"
163 #endif
164 
165 #endif
gray scale dilation of an image
typename TInputImage::IndexType IndexType
VanHerkGilWermanDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter
typename TInputImage::RegionType RegionType
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.