ITK  4.13.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:
61 
63  itkNewMacro(Self);
64 
68 
70  itkStaticConstMacro(ImageDimension, unsigned int,
71  TInputImage::ImageDimension);
72 
75  BASIC = 0,
76  HISTO = 1,
77  ANCHOR = 2,
78  VHGW = 3
79  };
80 
82  typedef TInputImage InputImageType;
83  typedef TOutputImage OutputImageType;
84  typedef typename TInputImage::RegionType RegionType;
85  typedef typename TInputImage::SizeType SizeType;
87  typedef typename TInputImage::PixelType PixelType;
88  typedef typename TInputImage::OffsetType OffsetType;
89  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
90 
107 
109  typedef TKernel KernelType;
110 // typedef typename KernelType::Superclass KernelSuperclass;
111 // typedef Neighborhood< typename KernelType::PixelType, ImageDimension >
112 // KernelSuperclass;
113 
115  void SetKernel(const KernelType & kernel) ITK_OVERRIDE;
116 
118  void SetAlgorithm(int algo);
119  itkGetConstMacro(Algorithm, int);
121 
124  virtual void Modified() const ITK_OVERRIDE;
125 
128  itkSetMacro(SafeBorder, bool);
129  itkGetConstReferenceMacro(SafeBorder, bool);
130  itkBooleanMacro(SafeBorder);
132 
133 protected:
135  ~GrayscaleMorphologicalClosingImageFilter() ITK_OVERRIDE {}
136  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
137 
138  void GenerateData() ITK_OVERRIDE;
139 
140 private:
141  ITK_DISALLOW_COPY_AND_ASSIGN(GrayscaleMorphologicalClosingImageFilter);
142 
143  // the filters used internally
144  typename HistogramErodeFilterType::Pointer m_HistogramErodeFilter;
145 
146  typename HistogramDilateFilterType::Pointer m_HistogramDilateFilter;
147 
148  typename BasicErodeFilterType::Pointer m_BasicErodeFilter;
149 
150  typename BasicDilateFilterType::Pointer m_BasicDilateFilter;
151 
152  typename VanHerkGilWermanDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter;
153 
154  typename VanHerkGilWermanErodeFilterType::Pointer m_VanHerkGilWermanErodeFilter;
155 
156  typename AnchorFilterType::Pointer m_AnchorFilter;
157 
158  // and the name of the filter
159  int m_Algorithm;
160 
161  bool m_SafeBorder;
162 }; // end of class
163 } // end namespace itk
164 
165 #ifndef ITK_MANUAL_INSTANTIATION
166 #include "itkGrayscaleMorphologicalClosingImageFilter.hxx"
167 #endif
168 
169 #endif
VanHerkGilWermanDilateImageFilter< TInputImage, FlatKernelType > VanHerkGilWermanDilateFilterType
gray scale dilation of an image
FlatStructuringElement< itkGetStaticConstMacro(ImageDimension) > FlatKernelType
BasicDilateImageFilter< TInputImage, TInputImage, TKernel > BasicDilateFilterType
MovingHistogramDilateImageFilter< TInputImage, TOutputImage, TKernel > HistogramDilateFilterType
Base class for all process objects that output image data.
BasicErodeImageFilter< TInputImage, TOutputImage, TKernel > BasicErodeFilterType
MovingHistogramErodeImageFilter< TInputImage, TOutputImage, TKernel > HistogramErodeFilterType
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
VanHerkGilWermanErodeImageFilter< TInputImage, FlatKernelType > VanHerkGilWermanErodeFilterType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
AnchorCloseImageFilter< TInputImage, FlatKernelType > AnchorFilterType
KernelImageFilter< TInputImage, TOutputImage, TKernel > Superclass
Casts input pixels to output pixel type.