ITK  6.0.0
Insight Toolkit
itkHausdorffDistanceImageFilter.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 itkHausdorffDistanceImageFilter_h
19 #define itkHausdorffDistanceImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkNumericTraits.h"
23 
24 namespace itk
25 {
62 template <typename TInputImage1, typename TInputImage2>
63 class ITK_TEMPLATE_EXPORT HausdorffDistanceImageFilter : public ImageToImageFilter<TInputImage1, TInputImage1>
64 {
65 public:
66  ITK_DISALLOW_COPY_AND_MOVE(HausdorffDistanceImageFilter);
67 
73 
75  itkNewMacro(Self);
76 
78  itkOverrideGetNameOfClassMacro(HausdorffDistanceImageFilter);
79 
81  using InputImage1Type = TInputImage1;
82  using InputImage2Type = TInputImage2;
87 
89  using SizeType = typename TInputImage1::SizeType;
91 
92  using InputImage1PixelType = typename TInputImage1::PixelType;
93  using InputImage2PixelType = typename TInputImage2::PixelType;
94 
96  static constexpr unsigned int ImageDimension = TInputImage1::ImageDimension;
97 
100 
102  void
103  SetInput1(const InputImage1Type * image);
104 
106  void
107  SetInput2(const InputImage2Type * image);
108 
110  const InputImage1Type *
111  GetInput1();
112 
114  const InputImage2Type *
115  GetInput2();
116 
118  itkSetMacro(UseImageSpacing, bool);
119  itkGetConstMacro(UseImageSpacing, bool);
123  itkGetConstMacro(HausdorffDistance, RealType);
124  itkGetConstMacro(AverageHausdorffDistance, RealType);
127 #ifdef ITK_USE_CONCEPT_CHECKING
128  // Begin concept checking
130  // End concept checking
131 #endif
132 
133 protected:
135  ~HausdorffDistanceImageFilter() override = default;
136  void
137  PrintSelf(std::ostream & os, Indent indent) const override;
138 
140  void
141  GenerateData() override;
142 
143  // Override since the filter needs all the data for the algorithm
144  void
145  GenerateInputRequestedRegion() override;
146 
147  // Override since the filter produces all of its output
148  void
149  EnlargeOutputRequestedRegion(DataObject * data) override;
150 
151 private:
152  RealType m_HausdorffDistance{};
153  RealType m_AverageHausdorffDistance{};
154  bool m_UseImageSpacing{ true };
155 }; // end of class
156 } // end namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 # include "itkHausdorffDistanceImageFilter.hxx"
160 #endif
161 
162 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::HausdorffDistanceImageFilter::IndexType
typename TInputImage1::IndexType IndexType
Definition: itkHausdorffDistanceImageFilter.h:90
itk::Concept::HasNumericTraits
Definition: itkConceptChecking.h:717
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::HausdorffDistanceImageFilter::InputImage1Type
TInputImage1 InputImage1Type
Definition: itkHausdorffDistanceImageFilter.h:81
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::HausdorffDistanceImageFilter
Computes the Hausdorff distance between the set of non-zero pixels of two images.
Definition: itkHausdorffDistanceImageFilter.h:63
itk::HausdorffDistanceImageFilter::InputImage1Pointer
typename TInputImage1::Pointer InputImage1Pointer
Definition: itkHausdorffDistanceImageFilter.h:83
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::HausdorffDistanceImageFilter::InputImage1PixelType
typename TInputImage1::PixelType InputImage1PixelType
Definition: itkHausdorffDistanceImageFilter.h:92
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::HausdorffDistanceImageFilter::InputImage2PixelType
typename TInputImage2::PixelType InputImage2PixelType
Definition: itkHausdorffDistanceImageFilter.h:93
itk::HausdorffDistanceImageFilter::InputImage2Type
TInputImage2 InputImage2Type
Definition: itkHausdorffDistanceImageFilter.h:82
itkImageToImageFilter.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:60
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::HausdorffDistanceImageFilter::InputImage1ConstPointer
typename TInputImage1::ConstPointer InputImage1ConstPointer
Definition: itkHausdorffDistanceImageFilter.h:85
itk::HausdorffDistanceImageFilter::InputImage2Pointer
typename TInputImage2::Pointer InputImage2Pointer
Definition: itkHausdorffDistanceImageFilter.h:84
itk::HausdorffDistanceImageFilter::RegionType
typename TInputImage1::RegionType RegionType
Definition: itkHausdorffDistanceImageFilter.h:88
itkNumericTraits.h
itk::HausdorffDistanceImageFilter::InputImage2ConstPointer
typename TInputImage2::ConstPointer InputImage2ConstPointer
Definition: itkHausdorffDistanceImageFilter.h:86
itk::HausdorffDistanceImageFilter::SizeType
typename TInputImage1::SizeType SizeType
Definition: itkHausdorffDistanceImageFilter.h:89
itk::HausdorffDistanceImageFilter::RealType
typename NumericTraits< InputImage1PixelType >::RealType RealType
Definition: itkHausdorffDistanceImageFilter.h:99
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293