go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkSingleValuedPointSetToPointSetMetric.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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/*=========================================================================
19
20 Program: Insight Segmentation & Registration Toolkit
21 Module: $RCSfile: itkSingleValuedPointSetToPointSetMetric.h,v $
22 Date: $Date: 2009-01-26 21:45:56 $
23 Version: $Revision: 1.2 $
24
25 Copyright (c) Insight Software Consortium. All rights reserved.
26 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
27
28 This software is distributed WITHOUT ANY WARRANTY; without even
29 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
30 PURPOSE. See the above copyright notices for more information.
31
32=========================================================================*/
33#ifndef itkSingleValuedPointSetToPointSetMetric_h
34#define itkSingleValuedPointSetToPointSetMetric_h
35
36#include "itkImageBase.h"
38#include "itkSingleValuedCostFunction.h"
39#include "itkMacro.h"
40#include "itkSpatialObject.h"
41#include "itkPointSet.h"
42
43namespace itk
44{
45
60template <class TFixedPointSet, class TMovingPointSet>
61class ITK_TEMPLATE_EXPORT SingleValuedPointSetToPointSetMetric : public SingleValuedCostFunction
63public:
68 using Superclass = SingleValuedCostFunction;
69 using Pointer = SmartPointer<Self>;
70 using ConstPointer = SmartPointer<const Self>;
73 using CoordinateRepresentationType = Superclass::ParametersValueType;
76 itkTypeMacro(SingleValuedPointSetToPointSetMetric, SingleValuedCostFunction);
79 using FixedPointSetType = TFixedPointSet;
80 using FixedPointSetPixelType = typename FixedPointSetType::PixelType;
81 using FixedPointSetConstPointer = typename FixedPointSetType::ConstPointer;
82 using MovingPointSetType = TMovingPointSet;
83 using MovingPointSetPixelType = typename MovingPointSetType::PixelType;
84 using MovingPointSetConstPointer = typename MovingPointSetType::ConstPointer;
85 using PointIterator = typename FixedPointSetType::PointsContainer::ConstIterator;
86 using PointDataIterator = typename FixedPointSetType::PointDataContainer::ConstIterator;
89 itkStaticConstMacro(FixedPointSetDimension, unsigned int, TFixedPointSet::PointDimension);
90 itkStaticConstMacro(MovingPointSetDimension, unsigned int, TMovingPointSet::PointDimension);
91
96 using InputPointType = typename TransformType::InputPointType;
97 using OutputPointType = typename TransformType::OutputPointType;
98 using TransformParametersType = typename TransformType::ParametersType;
99 using TransformJacobianType = typename TransformType::JacobianType;
100
101 using FixedImageMaskType = SpatialObject<Self::FixedPointSetDimension>;
102 using FixedImageMaskPointer = typename FixedImageMaskType::Pointer;
103 using FixedImageMaskConstPointer = typename FixedImageMaskType::ConstPointer;
104 using MovingImageMaskType = SpatialObject<Self::MovingPointSetDimension>;
105 using MovingImageMaskPointer = typename MovingImageMaskType::Pointer;
106 using MovingImageMaskConstPointer = typename MovingImageMaskType::ConstPointer;
107
109 using Superclass::MeasureType;
110 using Superclass::DerivativeType;
111 using DerivativeValueType = typename DerivativeType::ValueType;
112 using Superclass::ParametersType;
113
116
118 itkSetConstObjectMacro(FixedPointSet, FixedPointSetType);
119
121 itkGetConstObjectMacro(FixedPointSet, FixedPointSetType);
122
124 itkSetConstObjectMacro(MovingPointSet, MovingPointSetType);
125
127 itkGetConstObjectMacro(MovingPointSet, MovingPointSetType);
128
130 itkSetObjectMacro(Transform, TransformType);
131
133 itkGetConstObjectMacro(Transform, TransformType);
134
136 void
137 SetTransformParameters(const ParametersType & parameters) const;
138
140 unsigned int
141 GetNumberOfParameters() const override
142 {
143 return this->m_Transform->GetNumberOfParameters();
144 }
145
149 virtual void
151
153 // \todo: currently not used
154 itkSetConstObjectMacro(FixedImageMask, FixedImageMaskType);
155
157 itkGetConstObjectMacro(FixedImageMask, FixedImageMaskType);
158
160 itkSetConstObjectMacro(MovingImageMask, MovingImageMaskType);
161
163 itkGetConstObjectMacro(MovingImageMask, MovingImageMaskType);
164
166 virtual void
168
170 itkSetMacro(UseMetricSingleThreaded, bool);
171 itkGetConstReferenceMacro(UseMetricSingleThreaded, bool);
172 itkBooleanMacro(UseMetricSingleThreaded);
173
174protected:
177
179 void
180 PrintSelf(std::ostream & os, Indent indent) const override;
181
183 FixedPointSetConstPointer m_FixedPointSet{ nullptr };
184 MovingPointSetConstPointer m_MovingPointSet{ nullptr };
185 FixedImageMaskConstPointer m_FixedImageMask{ nullptr };
186 MovingImageMaskConstPointer m_MovingImageMask{ nullptr };
187 mutable TransformPointer m_Transform{ nullptr };
188
189 mutable unsigned int m_NumberOfPointsCounted{ 0 };
190
192 bool m_UseMetricSingleThreaded{ true };
193};
194
195} // end namespace itk
196
197#ifndef ITK_MANUAL_INSTANTIATION
198# include "itkSingleValuedPointSetToPointSetMetric.hxx"
199#endif
200
201#endif
Transform maps points, vectors and covariant vectors from an input space to an output space.
SmartPointer< Self > Pointer
std::vector< unsigned long > NonZeroJacobianIndicesType
A dummy metric to generate transformed meshes each iteration.
typename MovingImageMaskType::ConstPointer MovingImageMaskConstPointer
ITK_DISALLOW_COPY_AND_MOVE(SingleValuedPointSetToPointSetMetric)
typename MovingPointSetType::PixelType MovingPointSetPixelType
itkStaticConstMacro(FixedPointSetDimension, unsigned int, TFixedPointSet::PointDimension)
typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
itkStaticConstMacro(MovingPointSetDimension, unsigned int, TMovingPointSet::PointDimension)
void PrintSelf(std::ostream &os, Indent indent) const override
typename MovingPointSetType::ConstPointer MovingPointSetConstPointer
typename FixedPointSetType::ConstPointer FixedPointSetConstPointer
~SingleValuedPointSetToPointSetMetric() override=default
virtual void BeforeThreadedGetValueAndDerivative(const TransformParametersType &parameters) const
typename TransformType::ParametersType TransformParametersType
SpatialObject< Self::MovingPointSetDimension > MovingImageMaskType
SpatialObject< Self::FixedPointSetDimension > FixedImageMaskType
void SetTransformParameters(const ParametersType &parameters) const


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo