ITK  6.0.0
Insight Toolkit
itkAnchorOpenCloseImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 : public KernelImageFilter<TImage, TImage, TKernel>
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_MOVE(AnchorOpenCloseImageFilter);
55 
61 
65  using KernelType = TKernel;
66  using KernelLType = typename KernelType::LType;
67 
68  using InputImageType = TImage;
72  using InputImagePixelType = typename InputImageType::PixelType;
73 
75  static constexpr unsigned int InputImageDimension = TImage::ImageDimension;
76  static constexpr unsigned int OutputImageDimension = TImage::ImageDimension;
77 
79  itkNewMacro(Self);
80 
82  itkOverrideGetNameOfClassMacro(AnchorOpenCloseImageFilter);
83 
84 protected:
86  ~AnchorOpenCloseImageFilter() override = default;
87  void
88  PrintSelf(std::ostream & os, Indent indent) const override;
89 
91  void
92  DynamicThreadedGenerateData(const InputImageRegionType & outputRegionForThread) override;
93 
94 
95  InputImagePixelType m_Boundary1{};
96  InputImagePixelType m_Boundary2{};
97 
98 private:
101 
102  // the class that operates on lines -- does the opening in one
103  // operation. The classes following are named on the assumption that
104  // we are doing an opening
105 
106  // using AnchorLineOpenType = AnchorOpenCloseLine<InputImagePixelType, THistogramCompare,
107  // TFunction1, TFunction2>;
109 
111 
112  // the class that does the dilation
114 
115  void
116  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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itkBresenhamLine.h
itkProgressReporter.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::AnchorOpenCloseImageFilter< TImage, TKernel, std::less< TImage::PixelType >, std::greater< TImage::PixelType > >::BresOffsetArray
typename BresType::OffsetArray BresOffsetArray
Definition: itkAnchorOpenCloseImageFilter.h:100
itk::ImageToImageFilter::InputImagePixelType
typename InputImageType::PixelType InputImagePixelType
Definition: itkImageToImageFilter.h:133
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itkKernelImageFilter.h
itk::ImageToImageFilter::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageToImageFilter.h:130
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkAnchorErodeDilateLine.h
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::BresenhamLine::OffsetArray
std::vector< OffsetType > OffsetArray
Definition: itkBresenhamLine.h:51
itk::AnchorErodeDilateLine
class to implement erosions and dilations using anchor methods. This is the base class that must be i...
Definition: itkAnchorErodeDilateLine.h:37
itk::AnchorOpenCloseLine
class to implement openings and closings using anchor methods. This is the base class that must be in...
Definition: itkAnchorOpenCloseLine.h:36
itk::AnchorOpenCloseImageFilter< TImage, TKernel, std::less< TImage::PixelType >, std::greater< TImage::PixelType > >::KernelLType
typename KernelType::LType KernelLType
Definition: itkAnchorOpenCloseImageFilter.h:66
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::AnchorOpenCloseImageFilter
class to implement openings and closings using anchor methods.
Definition: itkAnchorOpenCloseImageFilter.h:51
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itkAnchorOpenCloseLine.h
itk::KernelImageFilter< TImage, TImage, TKernel >::KernelType
TKernel KernelType
Definition: itkKernelImageFilter.h:71
itk::KernelImageFilter
A base class for all the filters working on an arbitrary shaped neighborhood.
Definition: itkKernelImageFilter.h:41
itk::ImageToImageFilter::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition: itkImageToImageFilter.h:132
itk::ImageToImageFilter::InputImageConstPointer
typename InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageToImageFilter.h:131
itk::BresenhamLine
Compute indices along a line in n dimensions.
Definition: itkBresenhamLine.h:43