ITK  4.4.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< class TInputImage, class TOutputImage, class TKernel >
53  public KernelImageFilter< TInputImage, TOutputImage, TKernel >
54 {
55 public:
61 
63  itkNewMacro(Self);
64 
68 
70  itkStaticConstMacro(ImageDimension, unsigned int,
71  TInputImage::ImageDimension);
72 
74  typedef TInputImage InputImageType;
75  typedef TOutputImage OutputImageType;
76  typedef typename TInputImage::RegionType RegionType;
77  typedef typename TInputImage::SizeType SizeType;
78  typedef typename TInputImage::IndexType IndexType;
79  typedef typename TInputImage::PixelType PixelType;
80  typedef typename TInputImage::OffsetType OffsetType;
81  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
82 
99 
101  typedef TKernel KernelType;
102 // typedef typename KernelType::Superclass KernelSuperClass;
103 // typedef Neighborhood< typename KernelType::PixelType, ImageDimension >
104 // KernelSuperClass;
105 
107  void SetKernel(const KernelType & kernel);
108 
110  void SetAlgorithm(int algo);
111 
112  itkGetConstMacro(Algorithm, int);
113 
116  virtual void Modified() const;
117 
119  enum {
120  BASIC = 0,
121  HISTO = 1,
122  ANCHOR = 2,
123  VHGW = 3
124  } AlgorithmChoice;
125 
128  itkSetMacro(SafeBorder, bool);
129  itkGetConstReferenceMacro(SafeBorder, bool);
130  itkBooleanMacro(SafeBorder);
132 
133 protected:
136  void PrintSelf(std::ostream & os, Indent indent) const;
137 
138  void GenerateData();
139 
140 private:
141  GrayscaleMorphologicalClosingImageFilter(const Self &); //purposely not
142  // implemented
143  void operator=(const Self &); //purposely not
144 
145  // implemented
146 
147  // the filters used internally
149 
151 
153 
155 
157 
159 
161 
162  // and the name of the filter
164 
166 }; // end of class
167 } // end namespace itk
168 
169 #ifndef ITK_MANUAL_INSTANTIATION
170 #include "itkGrayscaleMorphologicalClosingImageFilter.hxx"
171 #endif
172 
173 #endif
174