ITK  4.4.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 
100 private:
101  AnchorOpenCloseImageFilter(const Self &); //purposely not implemented
102  void operator=(const Self &); //purposely not implemented
103 
106 
107  // the class that operates on lines -- does the opening in one
108  // operation. The classes following are named on the assumption that
109  // we are doing an opening
110 
111 // typedef AnchorOpenCloseLine<InputImagePixelType, THistogramCompare,
112 // TFunction1, TFunction2> AnchorLineOpenType;
114 
116 
117  // the class that does the dilation
119 
120  void DoFaceOpen(InputImageConstPointer input,
121  InputImagePointer output,
122  InputImagePixelType border,
123  KernelLType line,
124  AnchorLineOpenType & AnchorLineOpen,
125  const BresOffsetArray LineOffsets,
126  std::vector<InputImagePixelType> & outbuffer,
127  const InputImageRegionType AllImage,
128  const InputImageRegionType face);
129 }; // end of class
130 } // end namespace itk
131 
132 #ifndef ITK_MANUAL_INSTANTIATION
133 #include "itkAnchorOpenCloseImageFilter.hxx"
134 #endif
135 
136 #endif
137