ITK  5.4.0
Insight Toolkit
itkDirectedHausdorffDistanceImageFilter.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 itkDirectedHausdorffDistanceImageFilter_h
19#define itkDirectedHausdorffDistanceImageFilter_h
20
22#include "itkNumericTraits.h"
23#include "itkArray.h"
25#include <mutex>
26
27namespace itk
28{
73template <typename TInputImage1, typename TInputImage2>
74class ITK_TEMPLATE_EXPORT DirectedHausdorffDistanceImageFilter : public ImageToImageFilter<TInputImage1, TInputImage1>
75{
76public:
77 ITK_DISALLOW_COPY_AND_MOVE(DirectedHausdorffDistanceImageFilter);
78
84
86 itkNewMacro(Self);
87
89 itkOverrideGetNameOfClassMacro(DirectedHausdorffDistanceImageFilter);
90
92 using InputImage1Type = TInputImage1;
93 using InputImage2Type = TInputImage2;
98
102
103 using InputImage1PixelType = typename TInputImage1::PixelType;
104 using InputImage2PixelType = typename TInputImage2::PixelType;
105
107 static constexpr unsigned int ImageDimension = TInputImage1::ImageDimension;
108
111
113 void
115
117 void
119
121 const InputImage1Type *
123
125 const InputImage2Type *
127
129 itkSetMacro(UseImageSpacing, bool);
130 itkGetConstMacro(UseImageSpacing, bool);
131 itkBooleanMacro(UseImageSpacing);
135 itkGetConstMacro(DirectedHausdorffDistance, RealType);
136 itkGetConstMacro(AverageHausdorffDistance, RealType);
139#ifdef ITK_USE_CONCEPT_CHECKING
140 // Begin concept checking
142 // End concept checking
143#endif
144
145protected:
148 void
149 PrintSelf(std::ostream & os, Indent indent) const override;
150
153 void
154 AllocateOutputs() override;
155
157 void
159
162 void
164
166 void
167 DynamicThreadedGenerateData(const RegionType & outputRegionForThread) override;
168
169
170 // Override since the filter needs all the data for the algorithm
171 void
173
174 // Override since the filter produces all of its output
175 void
177
178private:
180
183
184 DistanceMapPointer m_DistanceMap{ nullptr };
185
186 RealType m_MaxDistance{};
187 IdentifierType m_PixelCount{};
188
190
191 RealType m_DirectedHausdorffDistance{};
192 RealType m_AverageHausdorffDistance{};
193 bool m_UseImageSpacing{ true };
194
195 std::mutex m_Mutex{};
196}; // end of class
197} // end namespace itk
198
199#ifndef ITK_MANUAL_INSTANTIATION
200# include "itkDirectedHausdorffDistanceImageFilter.hxx"
201#endif
202
203#endif
Base class for all data objects in ITK.
Computes the directed Hausdorff distance between the set of non-zero pixels of two images.
void EnlargeOutputRequestedRegion(DataObject *data) override
void PrintSelf(std::ostream &os, Indent indent) const override
const InputImage1Type * GetInput1()
void SetInput1(const InputImage1Type *image)
void SetInput2(const InputImage2Type *image)
typename NumericTraits< InputImage1PixelType >::RealType RealType
void DynamicThreadedGenerateData(const RegionType &outputRegionForThread) override
~DirectedHausdorffDistanceImageFilter() override=default
const InputImage2Type * GetInput2()
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Definition: itkImage.h:89
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Define additional traits for native types such as int or float.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition: itkIntTypes.h:87