ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkObjectToObjectMetric.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 itkObjectToObjectMetric_h
19#define itkObjectToObjectMetric_h
20
21
23
25#include "itkImage.h"
26#include "itkObject.h"
27#include "itkPointSet.h"
28#include "itkTransform.h"
29
30namespace itk
31{
32
88template <unsigned int TFixedDimension,
89 unsigned int TMovingDimension,
90 typename TVirtualImage = Image<double, TFixedDimension>,
91 typename TParametersValueType = double>
92class ITK_TEMPLATE_EXPORT ObjectToObjectMetric : public ObjectToObjectMetricBaseTemplate<TParametersValueType>
93{
94public:
95 ITK_DISALLOW_COPY_AND_MOVE(ObjectToObjectMetric);
96
102
104 itkOverrideGetNameOfClassMacro(ObjectToObjectMetric);
105
107 using CoordinateRepresentationType = TParametersValueType;
108
110 using InternalComputationValueType = TParametersValueType;
111
113 using typename Superclass::MeasureType;
114
117
119 using typename Superclass::DerivativeType;
120 using typename Superclass::DerivativeValueType;
121
123 using typename Superclass::ParametersType;
125
126 using typename Superclass::GradientSourceEnum;
127
130
132 static constexpr DimensionType FixedDimension = TFixedDimension;
133 static constexpr DimensionType MovingDimension = TMovingDimension;
134 static constexpr DimensionType VirtualDimension = TVirtualImage::ImageDimension;
135
137 using VirtualImageType = TVirtualImage;
138 using VirtualImagePointer = typename VirtualImageType::Pointer;
139 using VirtualImageConstPointer = typename VirtualImageType::ConstPointer;
140 using VirtualPixelType = typename VirtualImageType::PixelType;
141 using VirtualRegionType = typename VirtualImageType::RegionType;
142 using VirtualSizeType = typename VirtualRegionType::SizeType;
143 using VirtualSpacingType = typename VirtualImageType::SpacingType;
144 using VirtualOriginType = typename VirtualImageType::PointType;
145 using VirtualPointType = typename VirtualImageType::PointType;
146 using VirtualDirectionType = typename VirtualImageType::DirectionType;
147 using VirtualRadiusType = typename VirtualImageType::SizeType;
148 using VirtualIndexType = typename VirtualImageType::IndexType;
149
153
157
162
167
172
176
177 void
178 Initialize() override;
179
181 GetNumberOfParameters() const override;
184 void
185 SetParameters(ParametersType & params) override;
186 const ParametersType &
187 GetParameters() const override;
188 bool
189 HasLocalSupport() const override;
190 void
191 UpdateTransformParameters(const DerivativeType & derivative, TParametersValueType factor) override;
192
194 itkSetObjectMacro(FixedTransform, FixedTransformType);
195
197 itkGetModifiableObjectMacro(FixedTransform, FixedTransformType);
198
200 itkSetObjectMacro(MovingTransform, MovingTransformType);
201
203 itkGetModifiableObjectMacro(MovingTransform, MovingTransformType);
204
207 void
209
211 const MovingTransformType *
213
216 itkGetConstMacro(NumberOfValidPoints, SizeValueType);
217
234 void
236 const VirtualOriginType & origin,
237 const VirtualDirectionType & direction,
238 const VirtualRegionType & region);
239
242 void
244
249 virtual bool
251
257 virtual const TimeStamp &
259
264
269
274
277 const VirtualRegionType &
279
280 itkGetModifiableObjectMacro(VirtualImage, VirtualImageType);
281
293 const NumberOfParametersType & numberOfLocalParameters) const;
294
306 const NumberOfParametersType & numberOfLocalParameters) const;
307
312 bool
314 bool
317
319
322 GetMetricCategory() const override
323 {
324 return MetricCategoryType::OBJECT_METRIC;
325 }
326
327protected:
329 ~ObjectToObjectMetric() override = default;
330
331 void
332 PrintSelf(std::ostream & os, Indent indent) const override;
333
336 virtual void
338
339 bool
341 void
343
350
357 bool
359
363
365
369
374};
375} // end namespace itk
376
377#ifndef ITK_MANUAL_INSTANTIATION
378# include "itkObjectToObjectMetric.hxx"
379#endif
380
381#endif
OptimizerParameters< TInternalComputationValueType > ParametersType
Provides local/dense/high-dimensionality transformation via a a displacement field.
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
itk::ObjectToObjectMetricBaseTemplateEnums::MetricCategory MetricCategoryEnum
itk::ObjectToObjectMetricBaseTemplateEnums::GradientSource GradientSourceEnum
VirtualDirectionType GetVirtualDirection() const
bool IsInsideVirtualDomain(const VirtualIndexType &index) const
typename VirtualImageType::ConstPointer VirtualImageConstPointer
DisplacementFieldTransform< CoordinateRepresentationType, Self::MovingDimension > MovingDisplacementFieldTransformType
typename VirtualRegionType::SizeType VirtualSizeType
void Initialize() override
const ParametersType & GetParameters() const override
typename MovingTransformType::OutputPointType MovingOutputPointType
typename VirtualImageType::DirectionType VirtualDirectionType
ObjectToObjectMetricBaseTemplate< TParametersValueType > Superclass
TParametersValueType CoordinateRepresentationType
typename VirtualImageType::IndexType VirtualIndexType
typename FixedTransformType::JacobianType JacobianType
typename MovingTransformType::ParametersType MovingTransformParametersType
typename Superclass::Object ObjectType
typename VirtualImageType::PointType VirtualOriginType
TParametersValueType InternalComputationValueType
MetricCategoryType GetMetricCategory() const override
void UpdateTransformParameters(const DerivativeType &derivative, TParametersValueType factor) override
typename MovingTransformType::Pointer MovingTransformPointer
typename MovingTransformType::JacobianType MovingTransformJacobianType
bool VerifyNumberOfValidPoints(MeasureType &value, DerivativeType &derivative) const
typename FixedTransformType::OutputPointType FixedOutputPointType
void SetParameters(ParametersType &params) override
const MovingTransformType * GetTransform()
const MovingDisplacementFieldTransformType * GetMovingDisplacementFieldTransform() const
void PrintSelf(std::ostream &os, Indent indent) const override
typename VirtualImageType::PixelType VirtualPixelType
virtual bool SupportsArbitraryVirtualDomainSamples() const =0
typename FixedTransformType::ParametersType FixedTransformParametersType
OffsetValueType ComputeParameterOffsetFromVirtualIndex(const VirtualIndexType &index, const NumberOfParametersType &numberOfLocalParameters) const
Transform< TParametersValueType, TVirtualImage::ImageDimension, TMovingDimension > MovingTransformType
typename MovingTransformType::InputPointType MovingInputPointType
const VirtualRegionType & GetVirtualRegion() const
typename VirtualImageType::Pointer VirtualImagePointer
void SetVirtualDomainFromImage(const VirtualImageType *virtualImage)
PointSet< VirtualPixelType, Self::VirtualDimension > VirtualPointSetType
typename VirtualPointSetType::Pointer VirtualPointSetPointer
void SetVirtualDomain(const VirtualSpacingType &spacing, const VirtualOriginType &origin, const VirtualDirectionType &direction, const VirtualRegionType &region)
typename FixedTransformType::InputPointType FixedInputPointType
typename VirtualImageType::PointType VirtualPointType
typename Superclass::MetricCategoryEnum MetricCategoryType
VirtualOriginType GetVirtualOrigin() const
virtual const TimeStamp & GetVirtualDomainTimeStamp() const
void SetTransform(MovingTransformType *transform)
SmartPointer< const Self > ConstPointer
typename FixedTransformType::Pointer FixedTransformPointer
Transform< TParametersValueType, TVirtualImage::ImageDimension, TFixedDimension > FixedTransformType
NumberOfParametersType GetNumberOfLocalParameters() const override
bool HasLocalSupport() const override
typename VirtualImageType::RegionType VirtualRegionType
typename VirtualImageType::SizeType VirtualRadiusType
bool IsInsideVirtualDomain(const VirtualPointType &point) const
virtual void VerifyDisplacementFieldSizeAndPhysicalSpace()
typename VirtualImageType::SpacingType VirtualSpacingType
typename FixedTransformType::JacobianType FixedTransformJacobianType
OffsetValueType ComputeParameterOffsetFromVirtualPoint(const VirtualPointType &point, const NumberOfParametersType &numberOfLocalParameters) const
bool TransformPhysicalPointToVirtualIndex(const VirtualPointType &, VirtualIndexType &) const
void TransformVirtualIndexToPhysicalPoint(const VirtualIndexType &, VirtualPointType &) const
~ObjectToObjectMetric() override=default
VirtualSpacingType GetVirtualSpacing() const
NumberOfParametersType GetNumberOfParameters() const override
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition itkPointSet.h:82
OptimizerParameters< TInternalComputationValueType > ParametersType
Implements transparent reference counting.
Generate a unique, increasing time value.
Transform points and vectors from an input space to an output space.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86
*par Constraints *The filter 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
long OffsetValueType
Definition itkIntTypes.h:97