ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkAnchorOpenCloseImageFilter.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 __itkAnchorOpenCloseImageFilter_h
19 #define __itkAnchorOpenCloseImageFilter_h
20 
21 #include "itkKernelImageFilter.h"
22 #include "itkProgressReporter.h"
23 #include "itkAnchorOpenCloseLine.h"
25 #include "itkBresenhamLine.h"
26 
27 namespace itk
28 {
50 template< class TImage, class TKernel, class TCompare1, class TCompare2 >
51 class ITK_EXPORT AnchorOpenCloseImageFilter:
52  public KernelImageFilter< TImage, TImage, TKernel >
53 {
54 public:
55 
62 
66  typedef TKernel KernelType;
67  typedef typename KernelType::LType KernelLType;
68 
69  typedef TImage InputImageType;
70  typedef typename InputImageType::Pointer InputImagePointer;
71  typedef typename InputImageType::ConstPointer InputImageConstPointer;
72  typedef typename InputImageType::RegionType InputImageRegionType;
73  typedef typename InputImageType::PixelType InputImagePixelType;
74 
76  itkStaticConstMacro(InputImageDimension, unsigned int,
77  TImage::ImageDimension);
78  itkStaticConstMacro(OutputImageDimension, unsigned int,
79  TImage::ImageDimension);
81 
83  itkNewMacro(Self);
84 
86  itkTypeMacro(AnchorOpenCloseImageFilter,
88 
89 protected:
92  void PrintSelf(std::ostream & os, Indent indent) const;
93 
95  void ThreadedGenerateData(const InputImageRegionType & outputRegionForThread,
96  ThreadIdType threadId);
97 
99 private:
100  AnchorOpenCloseImageFilter(const Self &); //purposely not implemented
101  void operator=(const Self &); //purposely not implemented
102 
105 
106  // the class that operates on lines -- does the opening in one
107  // operation. The classes following are named on the assumption that
108  // we are doing an opening
109 
110 // typedef AnchorOpenCloseLine<InputImagePixelType, THistogramCompare,
111 // TFunction1, TFunction2> AnchorLineOpenType;
113 
115 
116  // the class that does the dilation
118 
119  void DoFaceOpen(InputImageConstPointer input,
120  InputImagePointer output,
121  InputImagePixelType border,
122  KernelLType line,
123  AnchorLineOpenType & AnchorLineOpen,
124  const BresOffsetArray LineOffsets,
125  std::vector<InputImagePixelType> & outbuffer,
126  const InputImageRegionType AllImage,
127  const InputImageRegionType face);
128 }; // end of class
129 } // end namespace itk
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 #include "itkAnchorOpenCloseImageFilter.hxx"
133 #endif
134 
135 #endif
136