ITK  5.0.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  ITK_DISALLOW_COPY_AND_ASSIGN(AnchorOpenCloseImageFilter);
56 
59  using Superclass =
63 
67  using KernelType = TKernel;
68  using KernelLType = typename KernelType::LType;
69 
70  using InputImageType = TImage;
71  using InputImagePointer = typename InputImageType::Pointer;
72  using InputImageConstPointer = typename InputImageType::ConstPointer;
74  using InputImagePixelType = typename InputImageType::PixelType;
75 
77  static constexpr unsigned int InputImageDimension = TImage::ImageDimension;
78  static constexpr unsigned int OutputImageDimension = TImage::ImageDimension;
79 
81  itkNewMacro(Self);
82 
84  itkTypeMacro(AnchorOpenCloseImageFilter,
86 
87 protected:
89  ~AnchorOpenCloseImageFilter() override = default;
90  void PrintSelf(std::ostream & os, Indent indent) const override;
91 
93  void DynamicThreadedGenerateData(const InputImageRegionType & outputRegionForThread) override;
94 
95 
98 
99 private:
102 
103  // the class that operates on lines -- does the opening in one
104  // operation. The classes following are named on the assumption that
105  // we are doing an opening
106 
107 // using AnchorLineOpenType = AnchorOpenCloseLine<InputImagePixelType, THistogramCompare,
108 // TFunction1, TFunction2>;
110 
112 
113  // the class that does the dilation
115 
116  void DoFaceOpen(InputImageConstPointer input,
117  InputImagePointer output,
118  InputImagePixelType border,
119  KernelLType line,
120  AnchorLineOpenType & AnchorLineOpen,
121  const BresOffsetArray LineOffsets,
122  std::vector<InputImagePixelType> & outbuffer,
123  const InputImageRegionType AllImage,
124  const InputImageRegionType face);
125 }; // end of class
126 } // end namespace itk
127 
128 #ifndef ITK_MANUAL_INSTANTIATION
129 #include "itkAnchorOpenCloseImageFilter.hxx"
130 #endif
131 
132 #endif
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::Pointer InputImagePointer
class to implement openings and closings using anchor methods.
A base class for all the filters working on an arbitrary shaped neighborhood.
typename InputImageType::RegionType InputImageRegionType
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
typename InputImageType::ConstPointer InputImageConstPointer
class to implement erosions and dilations using anchor methods. This is the base class that must be i...
std::vector< OffsetType > OffsetArray