ITK  4.2.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);
131 protected:
134  void PrintSelf(std::ostream & os, Indent indent) const;
136 
137  void GenerateData();
138 
139 private:
140  GrayscaleMorphologicalClosingImageFilter(const Self &); //purposely not
141  // implemented
142  void operator=(const Self &); //purposely not
143 
144  // implemented
145 
146  // the filters used internally
148 
150 
152 
154 
156 
158 
160 
161  // and the name of the filter
163 
165 }; // end of class
166 } // end namespace itk
167 
168 #ifndef ITK_MANUAL_INSTANTIATION
169 #include "itkGrayscaleMorphologicalClosingImageFilter.hxx"
170 #endif
171 
172 #endif
173