ITK  4.13.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:
60 
62  itkNewMacro(Self);
63 
67 
69  itkStaticConstMacro(ImageDimension, unsigned int,
70  TInputImage::ImageDimension);
71 
73  typedef TInputImage InputImageType;
74  typedef TOutputImage OutputImageType;
75  typedef typename TInputImage::RegionType RegionType;
76  typedef typename TInputImage::SizeType SizeType;
78  typedef typename TInputImage::PixelType PixelType;
79  typedef typename TInputImage::OffsetType OffsetType;
80  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
81 
98 
100  typedef TKernel KernelType;
101 // typedef typename KernelType::Superclass KernelSuperclass;
102 // typedef Neighborhood< typename KernelType::PixelType, ImageDimension >
103 // KernelSuperclass;
104 
106  void SetKernel(const KernelType & kernel) ITK_OVERRIDE;
107 
109  void SetAlgorithm(int algo);
110 
111  itkGetConstMacro(Algorithm, int);
112 
115  virtual void Modified() const ITK_OVERRIDE;
116 
119  BASIC = 0,
120  HISTO = 1,
121  ANCHOR = 2,
122  VHGW = 3
123  };
124 
127  itkSetMacro(SafeBorder, bool);
128  itkGetConstReferenceMacro(SafeBorder, bool);
129  itkBooleanMacro(SafeBorder);
131 
132 protected:
135  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
136 
137  void GenerateData() ITK_OVERRIDE;
138 
139 private:
140  ITK_DISALLOW_COPY_AND_ASSIGN(GrayscaleMorphologicalOpeningImageFilter);
141 
142  // the filters used internally
143  typename HistogramDilateFilterType::Pointer m_HistogramDilateFilter;
144 
145  typename HistogramErodeFilterType::Pointer m_HistogramErodeFilter;
146 
147  typename BasicDilateFilterType::Pointer m_BasicDilateFilter;
148 
149  typename BasicErodeFilterType::Pointer m_BasicErodeFilter;
150 
151  typename VanHerkGilWermanDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter;
152 
153  typename VanHerkGilWermanErodeFilterType::Pointer m_VanHerkGilWermanErodeFilter;
154 
155  typename AnchorFilterType::Pointer m_AnchorFilter;
156 
157  // and the name of the filter
158  int m_Algorithm;
159 
160  bool m_SafeBorder;
161 }; // end of class
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkGrayscaleMorphologicalOpeningImageFilter.hxx"
166 #endif
167 
168 #endif
gray scale dilation of an image
KernelImageFilter< TInputImage, TOutputImage, TKernel > Superclass
BasicErodeImageFilter< TInputImage, TInputImage, TKernel > BasicErodeFilterType
Base class for all process objects that output image data.
VanHerkGilWermanDilateImageFilter< TInputImage, FlatKernelType > VanHerkGilWermanDilateFilterType
VanHerkGilWermanErodeImageFilter< TInputImage, FlatKernelType > VanHerkGilWermanErodeFilterType
AnchorOpenImageFilter< TInputImage, FlatKernelType > AnchorFilterType
A base class for all the filters working on an arbitrary shaped neighborhood.
BasicDilateImageFilter< TInputImage, TOutputImage, TKernel > BasicDilateFilterType
MovingHistogramDilateImageFilter< TInputImage, TOutputImage, TKernel > HistogramDilateFilterType
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
MovingHistogramErodeImageFilter< TInputImage, TOutputImage, TKernel > HistogramErodeFilterType
Casts input pixels to output pixel type.
FlatStructuringElement< itkGetStaticConstMacro(ImageDimension) > FlatKernelType