ITK  4.13.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< typename TImage, typename TKernel, typename TCompare1, typename TCompare2 >
51 class ITK_TEMPLATE_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:
91  ~AnchorOpenCloseImageFilter() ITK_OVERRIDE {}
92  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
93 
95  void ThreadedGenerateData(const InputImageRegionType & outputRegionForThread,
96  ThreadIdType threadId) ITK_OVERRIDE;
97 
100 
101 private:
102  ITK_DISALLOW_COPY_AND_ASSIGN(AnchorOpenCloseImageFilter);
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
BresenhamLine< itkGetStaticConstMacro(InputImageDimension) > BresType
InputImageType::RegionType InputImageRegionType
InputImageType::ConstPointer InputImageConstPointer
InputImageType::ConstPointer InputImageConstPointer
AnchorErodeDilateLine< InputImagePixelType, TCompare2 > AnchorLineDilateType
InputImageType::Pointer InputImagePointer
AnchorOpenCloseLine< InputImagePixelType, TCompare1 > AnchorLineOpenType
KernelImageFilter< TImage, TImage, TKernel > Superclass
AnchorErodeDilateLine< InputImagePixelType, TCompare1 > AnchorLineErodeType
Base class for all process objects that output image data.
class to implement openings and closings using anchor methods.
InputImageType::RegionType InputImageRegionType
A base class for all the filters working on an arbitrary shaped neighborhood.
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
InputImageType::PixelType InputImagePixelType
class to implement openings and closings using anchor methods. This is the base class that must be in...
Control indentation during Print() invocation.
Definition: itkIndent.h:49
std::vector< OffsetType > OffsetArray
class to implement erosions and dilations using anchor methods. This is the base class that must be i...