ITK  6.0.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 * 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 itkBlackTopHatImageFilter_h
19#define itkBlackTopHatImageFilter_h
20
23
24namespace itk
25{
42template <typename TInputImage, typename TOutputImage, typename TKernel>
43class ITK_TEMPLATE_EXPORT BlackTopHatImageFilter : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
44{
45public:
46 ITK_DISALLOW_COPY_AND_MOVE(BlackTopHatImageFilter);
47
53
55 using InputImageType = TInputImage;
56 using OutputImageType = TOutputImage;
60 using InputImagePixelType = typename InputImageType::PixelType;
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)
77 using AlgorithmType = AlgorithmEnum;
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
90 itkOverrideGetNameOfClassMacro(BlackTopHatImageFilter);
91
94 itkSetMacro(SafeBorder, bool);
95 itkGetConstReferenceMacro(SafeBorder, bool);
96 itkBooleanMacro(SafeBorder);
101 itkGetConstMacro(Algorithm, AlgorithmEnum);
104 itkSetMacro(ForceAlgorithm, bool);
105 itkGetConstReferenceMacro(ForceAlgorithm, bool);
106 itkBooleanMacro(ForceAlgorithm);
107
108protected:
110 ~BlackTopHatImageFilter() override = default;
111 void
112 PrintSelf(std::ostream & os, Indent indent) const override;
113
114 void
115 GenerateData() override;
116
117private:
118 bool m_SafeBorder{};
119
120 AlgorithmEnum m_Algorithm{};
121
122 bool m_ForceAlgorithm{};
123}; // end of class
124} // end namespace itk
125
126#ifndef ITK_MANUAL_INSTANTIATION
127# include "itkBlackTopHatImageFilter.hxx"
128#endif
129
130#endif
Algorithm or implementation used in the dilation/erosion operations.
Black top hat extracts local minima that are smaller than the structuring element.
void PrintSelf(std::ostream &os, Indent indent) const override
typename OutputImageType::ConstPointer OutputImageConstPointer
~BlackTopHatImageFilter() override=default
void GenerateData() override
Base class for all process objects that output image data.
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::Pointer InputImagePointer
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::RegionType InputImageRegionType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
A base class for all the filters working on an arbitrary shaped neighborhood.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....