ITK  5.2.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  * http://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  itkTypeMacro(EuclideanDistancePointMetric, Object);
65 
67  using TransformType = typename Superclass::TransformType;
68  using TransformPointer = typename Superclass::TransformPointer;
69  using TransformParametersType = typename Superclass::TransformParametersType;
70  using TransformJacobianType = typename Superclass::TransformJacobianType;
71 
72  using MeasureType = typename Superclass::MeasureType;
73  using DerivativeType = typename Superclass::DerivativeType;
74  using FixedPointSetType = typename Superclass::FixedPointSetType;
75  using MovingPointSetType = typename Superclass::MovingPointSetType;
76  using FixedPointSetConstPointer = typename Superclass::FixedPointSetConstPointer;
77  using MovingPointSetConstPointer = typename Superclass::MovingPointSetConstPointer;
78 
79  using FixedPointIterator = typename Superclass::FixedPointIterator;
80  using FixedPointDataIterator = typename Superclass::FixedPointDataIterator;
81 
82  using MovingPointIterator = typename Superclass::MovingPointIterator;
83  using MovingPointDataIterator = typename Superclass::MovingPointDataIterator;
84 
85  using DistanceMapType = TDistanceMap;
86  using DistanceMapPointer = typename DistanceMapType::ConstPointer;
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);
110 
115  itkSetMacro(ComputeSquaredDistance, bool);
116  itkGetConstMacro(ComputeSquaredDistance, bool);
117  itkBooleanMacro(ComputeSquaredDistance);
119 
120 protected:
122  ~EuclideanDistancePointMetric() override = default;
123 
124  void
125  PrintSelf(std::ostream & os, Indent indent) const override;
126 
127 private:
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
itk::EuclideanDistancePointMetric::FixedPointSetType
typename Superclass::FixedPointSetType FixedPointSetType
Definition: itkEuclideanDistancePointMetric.h:74
itk::EuclideanDistancePointMetric::MovingPointDataIterator
typename Superclass::MovingPointDataIterator MovingPointDataIterator
Definition: itkEuclideanDistancePointMetric.h:83
itk::EuclideanDistancePointMetric::m_DistanceMap
DistanceMapPointer m_DistanceMap
Definition: itkEuclideanDistancePointMetric.h:128
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::EuclideanDistancePointMetric::FixedPointDataIterator
typename Superclass::FixedPointDataIterator FixedPointDataIterator
Definition: itkEuclideanDistancePointMetric.h:80
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::EuclideanDistancePointMetric::MovingPointIterator
typename Superclass::MovingPointIterator MovingPointIterator
Definition: itkEuclideanDistancePointMetric.h:82
itk::EuclideanDistancePointMetric::FixedPointIterator
typename Superclass::FixedPointIterator FixedPointIterator
Definition: itkEuclideanDistancePointMetric.h:79
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::EuclideanDistancePointMetric::TransformParametersType
typename Superclass::TransformParametersType TransformParametersType
Definition: itkEuclideanDistancePointMetric.h:69
itk::EuclideanDistancePointMetric::MovingPointSetType
typename Superclass::MovingPointSetType MovingPointSetType
Definition: itkEuclideanDistancePointMetric.h:75
itk::EuclideanDistancePointMetric::MovingPointSetConstPointer
typename Superclass::MovingPointSetConstPointer MovingPointSetConstPointer
Definition: itkEuclideanDistancePointMetric.h:77
itk::EuclideanDistancePointMetric::FixedPointSetConstPointer
typename Superclass::FixedPointSetConstPointer FixedPointSetConstPointer
Definition: itkEuclideanDistancePointMetric.h:76
itk::EuclideanDistancePointMetric::TransformJacobianType
typename Superclass::TransformJacobianType TransformJacobianType
Definition: itkEuclideanDistancePointMetric.h:70
itk::EuclideanDistancePointMetric::TransformPointer
typename Superclass::TransformPointer TransformPointer
Definition: itkEuclideanDistancePointMetric.h:68
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Array< double >
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itkPointSet.h
itk::Array2D
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:45
itkPointSetToPointSetMetric.h
itk::EuclideanDistancePointMetric::TransformType
typename Superclass::TransformType TransformType
Definition: itkEuclideanDistancePointMetric.h:67