ITK  6.0.0
Insight Toolkit
itkPointSetToPointSetMetric.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 itkPointSetToPointSetMetric_h
19#define itkPointSetToPointSetMetric_h
20
21#include "itkImageBase.h"
22#include "itkTransform.h"
24#include "itkMacro.h"
26
27namespace itk
28{
44template <typename TFixedPointSet, typename TMovingPointSet>
45class ITK_TEMPLATE_EXPORT PointSetToPointSetMetric : public MultipleValuedCostFunction
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(PointSetToPointSetMetric);
49
55
57 using CoordinateRepresentationType = Superclass::ParametersValueType;
58
60 itkOverrideGetNameOfClassMacro(PointSetToPointSetMetric);
61
63 using MovingPointSetType = TMovingPointSet;
64 using MovingPointSetPixelType = typename TMovingPointSet::PixelType;
66
68 using FixedPointSetType = TFixedPointSet;
70
72 static constexpr unsigned int MovingPointSetDimension = TMovingPointSet::PointDimension;
73 static constexpr unsigned int FixedPointSetDimension = TFixedPointSet::PointDimension;
74
75 using FixedPointIterator = typename FixedPointSetType::PointsContainer::ConstIterator;
76 using FixedPointDataIterator = typename FixedPointSetType::PointDataContainer::ConstIterator;
77
78 using MovingPointIterator = typename MovingPointSetType::PointsContainer::ConstIterator;
79 using MovingPointDataIterator = typename MovingPointSetType::PointDataContainer::ConstIterator;
80
84
90
92 using MeasureType = Superclass::MeasureType;
93
95 using DerivativeType = Superclass::DerivativeType;
96
98 using ParametersType = Superclass::ParametersType;
99
101 itkSetConstObjectMacro(FixedPointSet, FixedPointSetType);
102 itkGetConstObjectMacro(FixedPointSet, FixedPointSetType);
106 itkSetConstObjectMacro(MovingPointSet, MovingPointSetType);
107 itkGetConstObjectMacro(MovingPointSet, MovingPointSetType);
111 itkSetObjectMacro(Transform, TransformType);
112
114 itkGetModifiableObjectMacro(Transform, TransformType);
115
117 void
118 SetTransformParameters(const ParametersType & parameters) const;
119
121 unsigned int
122 GetNumberOfParameters() const override
123 {
124 return m_Transform->GetNumberOfParameters();
125 }
126
128 virtual void
130
131protected:
133 ~PointSetToPointSetMetric() override = default;
134 void
135 PrintSelf(std::ostream & os, Indent indent) const override;
136
137 FixedPointSetConstPointer m_FixedPointSet{};
138
139 MovingPointSetConstPointer m_MovingPointSet{};
140
141 mutable TransformPointer m_Transform{};
142};
143} // end namespace itk
144
145#ifndef ITK_MANUAL_INSTANTIATION
146# include "itkPointSetToPointSetMetric.hxx"
147#endif
148
149#endif
Array2D class representing a 2D array.
Definition: itkArray2D.h:43
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
This class is a base for the CostFunctions returning a multiple values.
Class to hold and manage different parameter types used during optimization.
Computes similarity between two point sets.
typename MovingPointSetType::ConstPointer MovingPointSetConstPointer
typename MovingPointSetType::PointDataContainer::ConstIterator MovingPointDataIterator
typename FixedPointSetType::PointsContainer::ConstIterator FixedPointIterator
typename TransformType::InputPointType InputPointType
typename FixedPointSetType::ConstPointer FixedPointSetConstPointer
void SetTransformParameters(const ParametersType &parameters) const
void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::ParametersValueType CoordinateRepresentationType
typename TransformType::Pointer TransformPointer
~PointSetToPointSetMetric() override=default
typename TransformType::JacobianType TransformJacobianType
typename MovingPointSetType::PointsContainer::ConstIterator MovingPointIterator
typename FixedPointSetType::PointDataContainer::ConstIterator FixedPointDataIterator
unsigned int GetNumberOfParameters() const override
typename TMovingPointSet::PixelType MovingPointSetPixelType
typename TransformType::ParametersType TransformParametersType
typename TransformType::OutputPointType OutputPointType
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:54
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:84
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....