ITK  5.3.0
Insight Toolkit
itkPointSetToPointSetMetricv4.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 itkPointSetToPointSetMetricv4_h
19 #define itkPointSetToPointSetMetricv4_h
20 
22 
23 namespace itk
24 {
65 template <typename TFixedPointSet,
66  typename TMovingPointSet = TFixedPointSet,
67  class TInternalComputationValueType = double>
68 class ITK_TEMPLATE_EXPORT PointSetToPointSetMetricv4
69  : public PointSetToPointSetMetricWithIndexv4<TFixedPointSet, TMovingPointSet, TInternalComputationValueType>
70 {
71 public:
72  ITK_DISALLOW_COPY_AND_MOVE(PointSetToPointSetMetricv4);
73 
76  using Superclass =
80 
83 
85  using MeasureType = typename Superclass::MeasureType;
86 
88  using ParametersType = typename Superclass::ParametersType;
89  using ParametersValueType = typename Superclass::ParametersValueType;
90  using NumberOfParametersType = typename Superclass::NumberOfParametersType;
91 
93  using DerivativeType = typename Superclass::DerivativeType;
94 
96  using FixedTransformType = typename Superclass::FixedTransformType;
97  using FixedTransformPointer = typename Superclass::FixedTransformPointer;
98  using FixedInputPointType = typename Superclass::FixedInputPointType;
99  using FixedOutputPointType = typename Superclass::FixedOutputPointType;
100  using FixedTransformParametersType = typename Superclass::FixedTransformParametersType;
101 
102  using MovingTransformType = typename Superclass::MovingTransformType;
103  using MovingTransformPointer = typename Superclass::MovingTransformPointer;
104  using MovingInputPointType = typename Superclass::MovingInputPointType;
105  using MovingOutputPointType = typename Superclass::MovingOutputPointType;
106  using MovingTransformParametersType = typename Superclass::MovingTransformParametersType;
107 
108  using JacobianType = typename Superclass::JacobianType;
109  using FixedTransformJacobianType = typename Superclass::FixedTransformJacobianType;
110  using MovingTransformJacobianType = typename Superclass::MovingTransformJacobianType;
111 
112  using DisplacementFieldTransformType = typename Superclass::MovingDisplacementFieldTransformType;
113 
115  using DimensionType = typename Superclass::DimensionType;
116 
118  using FixedPointSetType = TFixedPointSet;
120  using FixedPixelType = typename TFixedPointSet::PixelType;
121  using FixedPointsContainer = typename TFixedPointSet::PointsContainer;
122 
123  static constexpr DimensionType FixedPointDimension = Superclass::FixedPointDimension;
124 
126  using MovingPointSetType = TMovingPointSet;
128  using MovingPixelType = typename TMovingPointSet::PixelType;
129  using MovingPointsContainer = typename TMovingPointSet::PointsContainer;
130 
131  static constexpr DimensionType MovingPointDimension = Superclass::MovingPointDimension;
132 
139  static constexpr DimensionType PointDimension = Superclass::PointDimension;
140 
142  using PixelType = typename Superclass::PixelType;
143  using CoordRepType = typename PointType::CoordRepType;
145  using PointsConstIterator = typename PointsContainer::ConstIterator;
146  using PointIdentifier = typename Superclass::PointIdentifier;
147 
149  using PointsLocatorType = typename Superclass::PointsLocatorType;
150  using NeighborsIdentifierType = typename PointsLocatorType::NeighborsIdentifierType;
151 
152  using FixedTransformedPointSetType = typename Superclass::FixedTransformedPointSetType;
153  using MovingTransformedPointSetType = typename Superclass::MovingTransformedPointSetType;
154 
155  using DerivativeValueType = typename Superclass::DerivativeValueType;
156  using LocalDerivativeType = typename Superclass::LocalDerivativeType;
157 
159  using VirtualImageType = typename Superclass::VirtualImageType;
160  using VirtualImagePointer = typename Superclass::VirtualImagePointer;
161  using VirtualPixelType = typename Superclass::VirtualPixelType;
162  using VirtualRegionType = typename Superclass::VirtualRegionType;
163  using VirtualSizeType = typename Superclass::VirtualSizeType;
164  using VirtualSpacingType = typename Superclass::VirtualSpacingType;
165  using VirtualOriginType = typename Superclass::VirtualPointType;
166  using VirtualPointType = typename Superclass::VirtualPointType;
167  using VirtualDirectionType = typename Superclass::VirtualDirectionType;
168  using VirtualRadiusType = typename Superclass::VirtualSizeType;
169  using VirtualIndexType = typename Superclass::VirtualIndexType;
170  using VirtualPointSetType = typename Superclass::VirtualPointSetType;
171  using VirtualPointSetPointer = typename Superclass::VirtualPointSetPointer;
172 
178  virtual MeasureType
179  GetLocalNeighborhoodValue(const PointType &, const PixelType & pixel) const = 0;
180 
188  virtual LocalDerivativeType
189  GetLocalNeighborhoodDerivative(const PointType &, const PixelType & pixel) const;
190 
195  virtual void
196  GetLocalNeighborhoodValueAndDerivative(const PointType &,
197  MeasureType &,
199  const PixelType & pixel) const = 0;
200 
201 
202 protected:
203  PointSetToPointSetMetricv4() = default;
204  ~PointSetToPointSetMetricv4() override = default;
205 
206 private:
209  const PointType & point,
210  const PixelType & pixel) const override
211  {
212  return this->GetLocalNeighborhoodValue(point, pixel);
213  };
214 
215  LocalDerivativeType
217  const PointType & point,
218  const PixelType & pixel) const override
219  {
220  return this->GetLocalNeighborhoodDerivative(point, pixel);
221  };
222 
223  void
225  const PointType & point,
226  MeasureType & measure,
227  LocalDerivativeType & derivative,
228  const PixelType & pixel) const override
229  {
230  this->GetLocalNeighborhoodValueAndDerivative(point, measure, derivative, pixel);
231  };
232 };
233 } // end namespace itk
234 
235 #ifndef ITK_MANUAL_INSTANTIATION
236 # include "itkPointSetToPointSetMetricv4.hxx"
237 #endif
238 
239 #endif
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::LocalDerivativeType
typename Superclass::LocalDerivativeType LocalDerivativeType
Definition: itkPointSetToPointSetMetricv4.h:156
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::MovingTransformPointer
typename MovingTransformType::Pointer MovingTransformPointer
Definition: itkObjectToObjectMetric.h:163
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::DimensionType
SizeValueType DimensionType
Definition: itkObjectToObjectMetric.h:129
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::FixedPointType
typename TPointSet ::PointType FixedPointType
Definition: itkPointSetToPointSetMetricv4.h:119
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualRadiusType
typename VirtualImageType::SizeType VirtualRadiusType
Definition: itkObjectToObjectMetric.h:147
itk::OptimizerParameters< TInternalComputationValueType >
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::CoordRepType
typename PointType::CoordRepType CoordRepType
Definition: itkPointSetToPointSetMetricv4.h:143
itk::PointSet
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:82
itk::ObjectToObjectMetricBaseTemplate::NumberOfParametersType
unsigned int NumberOfParametersType
Definition: itkObjectToObjectMetricBase.h:176
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::MovingPixelType
typename TPointSet ::PixelType MovingPixelType
Definition: itkPointSetToPointSetMetricv4.h:128
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::DisplacementFieldTransformType
typename Superclass::MovingDisplacementFieldTransformType DisplacementFieldTransformType
Definition: itkPointSetToPointSetMetricv4.h:112
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::PointSetToPointSetMetricv4::GetLocalNeighborhoodValueWithIndex
MeasureType GetLocalNeighborhoodValueWithIndex(const PointIdentifier &, const PointType &point, const PixelType &pixel) const override
Definition: itkPointSetToPointSetMetricv4.h:208
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::MovingTransformedPointSetType
typename Superclass::MovingTransformedPointSetType MovingTransformedPointSetType
Definition: itkPointSetToPointSetMetricv4.h:153
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::FixedOutputPointType
typename FixedTransformType::OutputPointType FixedOutputPointType
Definition: itkObjectToObjectMetric.h:160
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::FixedPointsContainer
typename TPointSet ::PointsContainer FixedPointsContainer
Definition: itkPointSetToPointSetMetricv4.h:121
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::PixelType
typename Superclass::PixelType PixelType
Definition: itkPointSetToPointSetMetricv4.h:142
itk::SmartPointer< Self >
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::FixedInputPointType
typename FixedTransformType::InputPointType FixedInputPointType
Definition: itkObjectToObjectMetric.h:159
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::PointsLocatorType
typename Superclass::PointsLocatorType PointsLocatorType
Definition: itkPointSetToPointSetMetricv4.h:149
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::MovingOutputPointType
typename MovingTransformType::OutputPointType MovingOutputPointType
Definition: itkObjectToObjectMetric.h:165
itk::PointSetToPointSetMetricv4::GetLocalNeighborhoodValueAndDerivativeWithIndex
void GetLocalNeighborhoodValueAndDerivativeWithIndex(const PointIdentifier &, const PointType &point, MeasureType &measure, LocalDerivativeType &derivative, const PixelType &pixel) const override
Definition: itkPointSetToPointSetMetricv4.h:224
itk::ObjectToObjectMetricBaseTemplate::DerivativeValueType
typename DerivativeType::ValueType DerivativeValueType
Definition: itkObjectToObjectMetricBase.h:113
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualDirectionType
typename VirtualImageType::DirectionType VirtualDirectionType
Definition: itkObjectToObjectMetric.h:146
itk::PointSetToPointSetMetricWithIndexv4
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetricWithIndexv4.h:72
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualRegionType
typename VirtualImageType::RegionType VirtualRegionType
Definition: itkObjectToObjectMetric.h:141
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::FixedTransformPointer
typename FixedTransformType::Pointer FixedTransformPointer
Definition: itkObjectToObjectMetric.h:158
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::MovingInputPointType
typename MovingTransformType::InputPointType MovingInputPointType
Definition: itkObjectToObjectMetric.h:164
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualPointSetPointer
typename VirtualPointSetType::Pointer VirtualPointSetPointer
Definition: itkObjectToObjectMetric.h:152
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::PointsContainer
FixedPointsContainer PointsContainer
Definition: itkPointSetToPointSetMetricv4.h:144
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::JacobianType
typename FixedTransformType::JacobianType JacobianType
Definition: itkObjectToObjectMetric.h:169
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::FixedTransformedPointSetType
typename Superclass::FixedTransformedPointSetType FixedTransformedPointSetType
Definition: itkPointSetToPointSetMetricv4.h:152
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::FixedPointSetType
TPointSet FixedPointSetType
Definition: itkPointSetToPointSetMetricv4.h:118
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualIndexType
typename VirtualImageType::IndexType VirtualIndexType
Definition: itkObjectToObjectMetric.h:148
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::FixedTransformParametersType
typename FixedTransformType::ParametersType FixedTransformParametersType
Definition: itkObjectToObjectMetric.h:161
itk::CostFunctionTemplate::ParametersValueType
TInternalComputationValueType ParametersValueType
Definition: itkCostFunction.h:52
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::MovingTransformParametersType
typename MovingTransformType::ParametersType MovingTransformParametersType
Definition: itkObjectToObjectMetric.h:166
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualOriginType
typename VirtualImageType::PointType VirtualOriginType
Definition: itkObjectToObjectMetric.h:144
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualPointType
typename VirtualImageType::PointType VirtualPointType
Definition: itkObjectToObjectMetric.h:145
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::MovingPointsContainer
typename TPointSet ::PointsContainer MovingPointsContainer
Definition: itkPointSetToPointSetMetricv4.h:129
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::PointIdentifier
typename Superclass::PointIdentifier PointIdentifier
Definition: itkPointSetToPointSetMetricv4.h:146
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::MovingTransformJacobianType
typename MovingTransformType::JacobianType MovingTransformJacobianType
Definition: itkObjectToObjectMetric.h:171
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::FixedPixelType
typename TPointSet ::PixelType FixedPixelType
Definition: itkPointSetToPointSetMetricv4.h:120
itk::PointSetToPointSetMetricv4::GetLocalNeighborhoodDerivativeWithIndex
LocalDerivativeType GetLocalNeighborhoodDerivativeWithIndex(const PointIdentifier &, const PointType &point, const PixelType &pixel) const override
Definition: itkPointSetToPointSetMetricv4.h:216
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::MovingPointType
typename TPointSet ::PointType MovingPointType
Definition: itkPointSetToPointSetMetricv4.h:127
itk::ObjectToObjectMetricBaseTemplate::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkObjectToObjectMetricBase.h:109
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::PointsConstIterator
typename PointsContainer::ConstIterator PointsConstIterator
Definition: itkPointSetToPointSetMetricv4.h:145
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualSpacingType
typename VirtualImageType::SpacingType VirtualSpacingType
Definition: itkObjectToObjectMetric.h:143
itkPointSetToPointSetMetricWithIndexv4.h
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualImagePointer
typename VirtualImageType::Pointer VirtualImagePointer
Definition: itkObjectToObjectMetric.h:138
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::MovingPointSetType
TPointSet MovingPointSetType
Definition: itkPointSetToPointSetMetricv4.h:126
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::NeighborsIdentifierType
typename PointsLocatorType::NeighborsIdentifierType NeighborsIdentifierType
Definition: itkPointSetToPointSetMetricv4.h:150
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualPixelType
typename VirtualImageType::PixelType VirtualPixelType
Definition: itkObjectToObjectMetric.h:140
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::PointType
typename Superclass::PointType PointType
Definition: itkPointSetToPointSetMetricv4.h:141
itk::ObjectToObjectMetricBaseTemplate::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkObjectToObjectMetricBase.h:112
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualSizeType
typename VirtualRegionType::SizeType VirtualSizeType
Definition: itkObjectToObjectMetric.h:142
itk::PointSetToPointSetMetricv4
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetricv4.h:68
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::FixedTransformJacobianType
typename FixedTransformType::JacobianType FixedTransformJacobianType
Definition: itkObjectToObjectMetric.h:170