ITK  6.0.0
Insight Toolkit
itkFastChamferDistanceImageFilter.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 itkFastChamferDistanceImageFilter_h
19#define itkFastChamferDistanceImageFilter_h
20
23#include "itkNarrowBand.h"
24
25namespace itk
26{
55template <typename TInputImage, typename TOutputImage>
56class ITK_TEMPLATE_EXPORT FastChamferDistanceImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
57{
58public:
59 ITK_DISALLOW_COPY_AND_MOVE(FastChamferDistanceImageFilter);
60
66
68 itkNewMacro(Self);
69
71 itkOverrideGetNameOfClassMacro(FastChamferDistanceImageFilter);
72
74 using InputImageType = TInputImage;
75
77 using OutputImageType = TOutputImage;
78
81
83 using PixelType = typename InputImageType::PixelType;
84
87
89 using OffsetType = typename InputImageType::OffsetType;
90
93
95 static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
96 static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
97
100
105
107
109 itkSetMacro(Weights, WeightsType);
110 itkGetConstReferenceMacro(Weights, WeightsType);
114 itkSetMacro(MaximumDistance, float);
115 itkGetConstMacro(MaximumDistance, float);
119 void
121
124
125 void
127
130
131#ifdef ITK_USE_CONCEPT_CHECKING
132 // Begin concept checking
135 itkConceptMacro(FloatConvertibleToPixelTypeCheck, (Concept::Convertible<float, PixelType>));
136 itkConceptMacro(PixelTypeConvertibleToFloatCheck, (Concept::Convertible<PixelType, float>));
137 itkConceptMacro(PixelTypeGreaterThanFloatCheck, (Concept::GreaterThanComparable<PixelType, float>));
139 itkConceptMacro(PixelTypeFloatAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType, float, float>));
140 itkConceptMacro(FloatGreaterThanPixelTypeCheck, (Concept::GreaterThanComparable<float, PixelType>));
142 // End concept checking
143#endif
144
145protected:
148 void
149 PrintSelf(std::ostream & os, Indent indent) const override;
150
153 void
155
158 void
159 GenerateData() override;
160
161private:
162 float m_MaximumDistance{};
163
165 WeightsType m_Weights{};
166
167 NarrowBandPointer m_NarrowBand{};
168
170 RegionType m_RegionToProcess{};
171}; // end of FastChamferDistanceImageFilter class
172} // end namespace itk
173
174#ifndef ITK_MANUAL_INSTANTIATION
175# include "itkFastChamferDistanceImageFilter.hxx"
176#endif
177
178#endif
This class compute the signed (positive and negative) chamfer distance in a narrow band.
typename NarrowBandType::Pointer NarrowBandPointer
NarrowBandPointer GetNarrowBand() const
typename InputImageType::PixelType PixelType
~FastChamferDistanceImageFilter() override=default
typename InputImageType::RegionType RegionType
RegionType GetRegionToProcess() const
typename InputImageType::OffsetType OffsetType
void SetNarrowBand(NarrowBandType *ptr)
void SetRegionToProcess(const RegionType &r)
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for all process objects that output image data.
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
typename InputImageType::Pointer InputImagePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Narrow Band class.
Definition: itkNarrowBand.h:52
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....