ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkEuclideanDistancePointMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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, typename TMovingPointSet,
45  typename TDistanceMap =
47 class ITK_TEMPLATE_EXPORT EuclideanDistancePointMetric:
48  public PointSetToPointSetMetric< TFixedPointSet, TMovingPointSet >
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_ASSIGN(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 GetNumberOfValues() const override;
90 
92  void GetDerivative(const TransformParametersType & parameters,
93  DerivativeType & Derivative) const override;
94 
96  MeasureType GetValue(const TransformParametersType & parameters) const override;
97 
99  void GetValueAndDerivative(const TransformParametersType & parameters,
100  MeasureType & Value, DerivativeType & Derivative) const;
101 
103  itkSetConstObjectMacro(DistanceMap, DistanceMapType);
104  itkGetConstObjectMacro(DistanceMap, DistanceMapType);
106 
111  itkSetMacro(ComputeSquaredDistance, bool);
112  itkGetConstMacro(ComputeSquaredDistance, bool);
113  itkBooleanMacro(ComputeSquaredDistance);
115 
116 protected:
118  ~EuclideanDistancePointMetric() override = default;
119 
120  void PrintSelf(std::ostream & os, Indent indent) const override;
121 
122 private:
124  bool m_ComputeSquaredDistance{ false };
125 };
126 } // end namespace itk
127 
128 #ifndef ITK_MANUAL_INSTANTIATION
129 #include "itkEuclideanDistancePointMetric.hxx"
130 #endif
131 
132 #endif
typename Superclass::TransformType TransformType
typename Superclass::MovingPointDataIterator MovingPointDataIterator
typename Superclass::FixedPointSetConstPointer FixedPointSetConstPointer
Light weight base class for most itk classes.
typename Superclass::FixedPointDataIterator FixedPointDataIterator
typename Superclass::TransformJacobianType TransformJacobianType
Computes similarity between two point sets.
typename Superclass::FixedPointSetType FixedPointSetType
typename Superclass::MovingPointIterator MovingPointIterator
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:45
Computes the minimum distance between a moving point-set and a fixed point-set. A vector of minimum c...
typename Superclass::TransformPointer TransformPointer
typename Superclass::TransformParametersType TransformParametersType
typename Superclass::MovingPointSetConstPointer MovingPointSetConstPointer
typename DistanceMapType::ConstPointer DistanceMapPointer
typename Superclass::MovingPointSetType MovingPointSetType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60
typename Superclass::FixedPointIterator FixedPointIterator
Templated n-dimensional image class.
Definition: itkImage.h:75