ITK  5.4.0
Insight Toolkit
itkEuclideanDistancePointMetric.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 itkEuclideanDistancePointMetric_h
19 #define itkEuclideanDistancePointMetric_h
20 
22 #include "itkCovariantVector.h"
23 #include "itkPointSet.h"
24 #include "itkImage.h"
25 
26 namespace itk
27 {
44 template <typename TFixedPointSet,
45  typename TMovingPointSet,
47 class ITK_TEMPLATE_EXPORT EuclideanDistancePointMetric
48  : public PointSetToPointSetMetric<TFixedPointSet, TMovingPointSet>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_MOVE(EuclideanDistancePointMetric);
52 
56 
59 
61  itkNewMacro(Self);
62 
64  itkOverrideGetNameOfClassMacro(EuclideanDistancePointMetric);
65 
67  using typename Superclass::TransformType;
68  using typename Superclass::TransformPointer;
69  using typename Superclass::TransformParametersType;
70  using typename Superclass::TransformJacobianType;
71 
72  using typename Superclass::MeasureType;
73  using typename Superclass::DerivativeType;
74  using typename Superclass::FixedPointSetType;
75  using typename Superclass::MovingPointSetType;
76  using typename Superclass::FixedPointSetConstPointer;
77  using typename Superclass::MovingPointSetConstPointer;
78 
79  using typename Superclass::FixedPointIterator;
80  using typename Superclass::FixedPointDataIterator;
81 
82  using typename Superclass::MovingPointIterator;
83  using typename Superclass::MovingPointDataIterator;
84 
85  using DistanceMapType = TDistanceMap;
87 
89  unsigned int
90  GetNumberOfValues() const override;
91 
93  void
94  GetDerivative(const TransformParametersType & parameters, DerivativeType & Derivative) const override;
95 
98  GetValue(const TransformParametersType & parameters) const override;
99 
101  void
102  GetValueAndDerivative(const TransformParametersType & parameters,
103  MeasureType & value,
104  DerivativeType & derivative) const;
105 
107  itkSetConstObjectMacro(DistanceMap, DistanceMapType);
108  itkGetConstObjectMacro(DistanceMap, DistanceMapType);
115  itkSetMacro(ComputeSquaredDistance, bool);
116  itkGetConstMacro(ComputeSquaredDistance, bool);
117  itkBooleanMacro(ComputeSquaredDistance);
120 protected:
122  ~EuclideanDistancePointMetric() override = default;
123 
124  void
125  PrintSelf(std::ostream & os, Indent indent) const override;
126 
127 private:
128  DistanceMapPointer m_DistanceMap{};
129  bool m_ComputeSquaredDistance{ false };
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 # include "itkEuclideanDistancePointMetric.hxx"
135 #endif
136 
137 #endif
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itkCovariantVector.h
itk::EuclideanDistancePointMetric::DistanceMapType
TDistanceMap DistanceMapType
Definition: itkEuclideanDistancePointMetric.h:85
itk::EuclideanDistancePointMetric::DistanceMapPointer
typename DistanceMapType::ConstPointer DistanceMapPointer
Definition: itkEuclideanDistancePointMetric.h:86
itk::EuclideanDistancePointMetric
Computes the minimum distance between a moving point-set and a fixed point-set. A vector of minimum c...
Definition: itkEuclideanDistancePointMetric.h:47
itk::PointSetToPointSetMetric
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetric.h:45
itkImage.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::PointSetToPointSetMetric::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkPointSetToPointSetMetric.h:88
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Array< double >
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itkPointSet.h
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itkPointSetToPointSetMetric.h