ITK  5.2.0
Insight Toolkit
itkBlackTopHatImageFilter.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  * 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 itkBlackTopHatImageFilter_h
19 #define itkBlackTopHatImageFilter_h
20 
21 #include "itkKernelImageFilter.h"
23 
24 namespace itk
25 {
42 template <typename TInputImage, typename TOutputImage, typename TKernel>
43 class ITK_TEMPLATE_EXPORT BlackTopHatImageFilter : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
44 {
45 public:
46  ITK_DISALLOW_COPY_AND_MOVE(BlackTopHatImageFilter);
47 
53 
55  using InputImageType = TInputImage;
56  using OutputImageType = TOutputImage;
57  using InputImagePointer = typename InputImageType::Pointer;
58  using InputImageConstPointer = typename InputImageType::ConstPointer;
60  using InputImagePixelType = typename InputImageType::PixelType;
61  using OutputImagePointer = typename OutputImageType::Pointer;
62  using OutputImageConstPointer = typename OutputImageType::ConstPointer;
64  using OutputImagePixelType = typename OutputImageType::PixelType;
65 
67  using KernelType = TKernel;
68 
70  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
71  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
72 
74 
75 #if !defined(ITK_LEGACY_REMOVE)
76 
78  // We need to expose the enum values at the class level
79  // for backwards compatibility
80  static constexpr AlgorithmType BASIC = AlgorithmEnum::BASIC;
81  static constexpr AlgorithmType HISTO = AlgorithmEnum::HISTO;
82  static constexpr AlgorithmType ANCHOR = AlgorithmEnum::ANCHOR;
83  static constexpr AlgorithmType VHGW = AlgorithmEnum::VHGW;
84 #endif
85 
87  itkNewMacro(Self);
88 
91 
94  itkSetMacro(SafeBorder, bool);
95  itkGetConstReferenceMacro(SafeBorder, bool);
96  itkBooleanMacro(SafeBorder);
98 
100  itkSetMacro(Algorithm, AlgorithmEnum);
101  itkGetConstMacro(Algorithm, AlgorithmEnum);
103 
104  itkSetMacro(ForceAlgorithm, bool);
105  itkGetConstReferenceMacro(ForceAlgorithm, bool);
106  itkBooleanMacro(ForceAlgorithm);
107 
108 protected:
110  ~BlackTopHatImageFilter() override = default;
111  void
112  PrintSelf(std::ostream & os, Indent indent) const override;
113 
114  void
115  GenerateData() override;
116 
117 private:
119 
121 
123 }; // end of class
124 } // end namespace itk
125 
126 #ifndef ITK_MANUAL_INSTANTIATION
127 # include "itkBlackTopHatImageFilter.hxx"
128 #endif
129 
130 #endif
itk::BlackTopHatImageFilter::OutputImageConstPointer
typename OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkBlackTopHatImageFilter.h:62
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::BlackTopHatImageFilter
Black top hat extracts local minima that are smaller than the structuring element.
Definition: itkBlackTopHatImageFilter.h:43
AlgorithmType
Algorithm or implementation used in the dilation/erosion operations.
itk::BlackTopHatImageFilter::m_SafeBorder
bool m_SafeBorder
Definition: itkBlackTopHatImageFilter.h:118
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::BlackTopHatImageFilter::m_Algorithm
AlgorithmEnum m_Algorithm
Definition: itkBlackTopHatImageFilter.h:120
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
itkMathematicalMorphologyEnums.h
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::MathematicalMorphologyEnums::Algorithm
Algorithm
Definition: itkMathematicalMorphologyEnums.h:41
itk::BlackTopHatImageFilter::m_ForceAlgorithm
bool m_ForceAlgorithm
Definition: itkBlackTopHatImageFilter.h:122
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::ImageSource::OutputImagePixelType
typename OutputImageType::PixelType OutputImagePixelType
Definition: itkImageSource.h:93
itk::KernelImageFilter::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::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90