ITK  6.0.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  * 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 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 
82  itkOverrideGetNameOfClassMacro(PointSetToPointSetMetricv4);
83 
85  using typename Superclass::MeasureType;
86 
88  using typename Superclass::ParametersType;
89  using typename Superclass::ParametersValueType;
90  using typename Superclass::NumberOfParametersType;
91 
93  using typename Superclass::DerivativeType;
94 
96  using typename Superclass::FixedTransformType;
97  using typename Superclass::FixedTransformPointer;
98  using typename Superclass::FixedInputPointType;
99  using typename Superclass::FixedOutputPointType;
100  using typename Superclass::FixedTransformParametersType;
101 
102  using typename Superclass::MovingTransformType;
103  using typename Superclass::MovingTransformPointer;
104  using typename Superclass::MovingInputPointType;
105  using typename Superclass::MovingOutputPointType;
106  using typename Superclass::MovingTransformParametersType;
107 
108  using typename Superclass::JacobianType;
109  using typename Superclass::FixedTransformJacobianType;
110  using typename Superclass::MovingTransformJacobianType;
111 
112  using DisplacementFieldTransformType = typename Superclass::MovingDisplacementFieldTransformType;
113 
115  using 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 
141  using typename Superclass::PointType;
142  using typename Superclass::PixelType;
143  using CoordinateType = typename PointType::CoordinateType;
144 #ifndef ITK_FUTURE_LEGACY_REMOVE
145  using CoordRepType ITK_FUTURE_DEPRECATED(
146  "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
147 #endif
149  using PointsConstIterator = typename PointsContainer::ConstIterator;
150  using typename Superclass::PointIdentifier;
151 
153  using typename Superclass::PointsLocatorType;
155 
156  using typename Superclass::FixedTransformedPointSetType;
157  using typename Superclass::MovingTransformedPointSetType;
158 
159  using typename Superclass::DerivativeValueType;
160  using typename Superclass::LocalDerivativeType;
161 
163  using VirtualImageType = typename Superclass::VirtualImageType;
164  using typename Superclass::VirtualImagePointer;
165  using typename Superclass::VirtualPixelType;
166  using typename Superclass::VirtualRegionType;
167  using typename Superclass::VirtualSizeType;
168  using typename Superclass::VirtualSpacingType;
169  using VirtualOriginType = typename Superclass::VirtualPointType;
170  using typename Superclass::VirtualPointType;
171  using typename Superclass::VirtualDirectionType;
172  using VirtualRadiusType = typename Superclass::VirtualSizeType;
173  using typename Superclass::VirtualIndexType;
174  using typename Superclass::VirtualPointSetType;
175  using typename Superclass::VirtualPointSetPointer;
176 
182  virtual MeasureType
183  GetLocalNeighborhoodValue(const PointType &, const PixelType & pixel) const = 0;
184 
192  virtual LocalDerivativeType
193  GetLocalNeighborhoodDerivative(const PointType &, const PixelType & pixel) const;
194 
199  virtual void
200  GetLocalNeighborhoodValueAndDerivative(const PointType &,
201  MeasureType &,
203  const PixelType & pixel) const = 0;
204 
205 
206 protected:
207  PointSetToPointSetMetricv4() = default;
208  ~PointSetToPointSetMetricv4() override = default;
209 
210 private:
213  const PointType & point,
214  const PixelType & pixel) const override
215  {
216  return this->GetLocalNeighborhoodValue(point, pixel);
217  }
218 
219  LocalDerivativeType
221  const PointType & point,
222  const PixelType & pixel) const override
223  {
224  return this->GetLocalNeighborhoodDerivative(point, pixel);
225  }
226 
227  void
229  const PointType & point,
230  MeasureType & measure,
231  LocalDerivativeType & derivative,
232  const PixelType & pixel) const override
233  {
234  this->GetLocalNeighborhoodValueAndDerivative(point, measure, derivative, pixel);
235  }
236 };
237 } // end namespace itk
238 
239 #ifndef ITK_MANUAL_INSTANTIATION
240 # include "itkPointSetToPointSetMetricv4.hxx"
241 #endif
242 
243 #endif
itk::PointsLocator::NeighborsIdentifierType
typename TreeType::InstanceIdentifierVectorType NeighborsIdentifierType
Definition: itkPointsLocator.h:82
itk::PointSetToPointSetMetricWithIndexv4< TPointSet, TPointSet, TInternalComputationValueType >::PixelType
FixedPixelType PixelType
Definition: itkPointSetToPointSetMetricWithIndexv4.h:153
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::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:212
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::FixedPointsContainer
typename TPointSet ::PointsContainer FixedPointsContainer
Definition: itkPointSetToPointSetMetricv4.h:121
itk::SmartPointer< Self >
itk::PointSetToPointSetMetricv4::GetLocalNeighborhoodValueAndDerivativeWithIndex
void GetLocalNeighborhoodValueAndDerivativeWithIndex(const PointIdentifier &, const PointType &point, MeasureType &measure, LocalDerivativeType &derivative, const PixelType &pixel) const override
Definition: itkPointSetToPointSetMetricv4.h:228
itk::PointSetToPointSetMetricWithIndexv4
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetricWithIndexv4.h:72
itk::SingleValuedCostFunctionv4Template::MeasureType
TInternalComputationValueType MeasureType
Definition: itkSingleValuedCostFunctionv4.h:67
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::PointsContainer
FixedPointsContainer PointsContainer
Definition: itkPointSetToPointSetMetricv4.h:148
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::FixedPointSetType
TPointSet FixedPointSetType
Definition: itkPointSetToPointSetMetricv4.h:118
itk::ObjectToObjectMetric< TPointSet ::PointDimension, TPointSet ::PointDimension, Image< TInternalComputationValueType, TPointSet ::PointDimension >, TInternalComputationValueType >::VirtualOriginType
typename VirtualImageType::PointType VirtualOriginType
Definition: itkObjectToObjectMetric.h:144
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::MovingPointsContainer
typename TPointSet ::PointsContainer MovingPointsContainer
Definition: itkPointSetToPointSetMetricv4.h:129
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::CoordinateType
typename PointType::CoordinateType CoordinateType
Definition: itkPointSetToPointSetMetricv4.h:143
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::FixedPixelType
typename TPointSet ::PixelType FixedPixelType
Definition: itkPointSetToPointSetMetricv4.h:120
itk::FixedArray
Simulate a standard C array with copy semantics.
Definition: itkFixedArray.h:53
itk::PointSetToPointSetMetricv4::GetLocalNeighborhoodDerivativeWithIndex
LocalDerivativeType GetLocalNeighborhoodDerivativeWithIndex(const PointIdentifier &, const PointType &point, const PixelType &pixel) const override
Definition: itkPointSetToPointSetMetricv4.h:220
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::MovingPointType
typename TPointSet ::PointType MovingPointType
Definition: itkPointSetToPointSetMetricv4.h:127
itk::PointSetToPointSetMetricv4< TPointSet, TPointSet, TInternalComputationValueType >::PointsConstIterator
typename PointsContainer::ConstIterator PointsConstIterator
Definition: itkPointSetToPointSetMetricv4.h:149
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itkPointSetToPointSetMetricWithIndexv4.h
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
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:154
itk::PointSetToPointSetMetricWithIndexv4< TPointSet, TPointSet, TInternalComputationValueType >::PointIdentifier
typename PointsContainer::ElementIdentifier PointIdentifier
Definition: itkPointSetToPointSetMetricWithIndexv4.h:161
itk::PointSetToPointSetMetricWithIndexv4< TPointSet, TPointSet, TInternalComputationValueType >::PointType
FixedPointType PointType
Definition: itkPointSetToPointSetMetricWithIndexv4.h:152
itk::PointSetToPointSetMetricv4
Computes similarity between two point sets.
Definition: itkPointSetToPointSetMetricv4.h:68