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 
27 namespace itk
28 {
44 template <typename TFixedPointSet, typename TMovingPointSet>
45 class ITK_TEMPLATE_EXPORT PointSetToPointSetMetric : public MultipleValuedCostFunction
46 {
47 public:
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 
82  using TransformType =
84 
88  using TransformParametersType = typename TransformType::ParametersType;
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
129  Initialize();
130 
131 protected:
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
itk::MultipleValuedCostFunction
This class is a base for the CostFunctions returning a multiple values.
Definition: itkMultipleValuedCostFunction.h:35
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::OptimizerParameters< TInternalComputationValueType >
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::PointSetToPointSetMetric::FixedPointSetConstPointer
typename FixedPointSetType::ConstPointer FixedPointSetConstPointer
Definition: itkPointSetToPointSetMetric.h:69
itk::PointSetToPointSetMetric::FixedPointSetType
TFixedPointSet FixedPointSetType
Definition: itkPointSetToPointSetMetric.h:68
itk::PointSetToPointSetMetric::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkPointSetToPointSetMetric.h:85
itk::PointSetToPointSetMetric
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetric.h:45
itk::PointSetToPointSetMetric::MovingPointDataIterator
typename MovingPointSetType::PointDataContainer::ConstIterator MovingPointDataIterator
Definition: itkPointSetToPointSetMetric.h:79
itk::PointSetToPointSetMetric::FixedPointDataIterator
typename FixedPointSetType::PointDataContainer::ConstIterator FixedPointDataIterator
Definition: itkPointSetToPointSetMetric.h:76
itk::PointSetToPointSetMetric::CoordinateRepresentationType
Superclass::ParametersValueType CoordinateRepresentationType
Definition: itkPointSetToPointSetMetric.h:57
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::PointSetToPointSetMetric::TransformJacobianType
typename TransformType::JacobianType TransformJacobianType
Definition: itkPointSetToPointSetMetric.h:89
itk::PointSetToPointSetMetric::FixedPointIterator
typename FixedPointSetType::PointsContainer::ConstIterator FixedPointIterator
Definition: itkPointSetToPointSetMetric.h:75
itkGradientRecursiveGaussianImageFilter.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkMacro.h
itk::PointSetToPointSetMetric::OutputPointType
typename TransformType::OutputPointType OutputPointType
Definition: itkPointSetToPointSetMetric.h:87
itk::PointSetToPointSetMetric::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkPointSetToPointSetMetric.h:88
itk::PointSetToPointSetMetric::MovingPointSetPixelType
typename TMovingPointSet::PixelType MovingPointSetPixelType
Definition: itkPointSetToPointSetMetric.h:64
itk::PointSetToPointSetMetric::MovingPointIterator
typename MovingPointSetType::PointsContainer::ConstIterator MovingPointIterator
Definition: itkPointSetToPointSetMetric.h:78
itkMultipleValuedCostFunction.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::PointSetToPointSetMetric::GetNumberOfParameters
unsigned int GetNumberOfParameters() const override
Definition: itkPointSetToPointSetMetric.h:122
itk::Array< double >
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::PointSetToPointSetMetric::MovingPointSetType
TMovingPointSet MovingPointSetType
Definition: itkPointSetToPointSetMetric.h:63
itk::PointSetToPointSetMetric::InputPointType
typename TransformType::InputPointType InputPointType
Definition: itkPointSetToPointSetMetric.h:86
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
itkTransform.h
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itk::PointSetToPointSetMetric::MovingPointSetConstPointer
typename MovingPointSetType::ConstPointer MovingPointSetConstPointer
Definition: itkPointSetToPointSetMetric.h:65
itkImageBase.h