ITK  4.2.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< class TInputImage, class TOutputImage, class TKernel >
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;
77  typedef typename TInputImage::IndexType IndexType;
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);
107 
109  void SetAlgorithm(int algo);
110 
111  itkGetConstMacro(Algorithm, int);
112 
115  virtual void Modified() const;
116 
118  enum {
119  BASIC = 0,
120  HISTO = 1,
121  ANCHOR = 2,
122  VHGW = 3
123  } AlgorithmChoice;
124 
127  itkSetMacro(SafeBorder, bool);
128  itkGetConstReferenceMacro(SafeBorder, bool);
129  itkBooleanMacro(SafeBorder);
130 protected:
133  void PrintSelf(std::ostream & os, Indent indent) const;
135 
136  void GenerateData();
137 
138 private:
139  GrayscaleMorphologicalOpeningImageFilter(const Self &); //purposely not
140  // implemented
141  void operator=(const Self &); //purposely not
142 
143  // implemented
144 
145  // the filters used internally
147 
149 
151 
153 
155 
157 
159 
160  // and the name of the filter
162 
164 }; // end of class
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkGrayscaleMorphologicalOpeningImageFilter.hxx"
169 #endif
170 
171 #endif
172