18#ifndef itkCombinationImageToImageMetric_h
19#define itkCombinationImageToImageMetric_h
58template <
class TFixedImage,
class TMovingImage>
81 using typename Superclass::CoordinateRepresentationType;
82 using typename Superclass::MovingImageType;
83 using typename Superclass::MovingImagePixelType;
85 using typename Superclass::MovingImageConstPointer;
86 using typename Superclass::FixedImageType;
88 using typename Superclass::FixedImageConstPointer;
89 using typename Superclass::FixedImageRegionType;
92 using typename Superclass::InputPointType;
93 using typename Superclass::OutputPointType;
94 using typename Superclass::TransformParametersType;
95 using typename Superclass::TransformJacobianType;
96 using typename Superclass::InterpolatorType;
97 using typename Superclass::InterpolatorPointer;
98 using typename Superclass::RealType;
99 using typename Superclass::GradientPixelType;
100 using typename Superclass::GradientImageType;
101 using typename Superclass::GradientImagePointer;
102 using typename Superclass::GradientImageFilterType;
103 using typename Superclass::GradientImageFilterPointer;
104 using typename Superclass::FixedImageMaskType;
105 using typename Superclass::FixedImageMaskPointer;
106 using typename Superclass::MovingImageMaskType;
107 using typename Superclass::MovingImageMaskPointer;
108 using typename Superclass::MeasureType;
109 using typename Superclass::DerivativeType;
111 using typename Superclass::ParametersType;
142 TFixedImage::ImageDimension,
143 DefaultStaticMeshTraits<CoordinateRepresentationType,
144 TFixedImage::ImageDimension,
145 TFixedImage::ImageDimension,
146 CoordinateRepresentationType,
147 CoordinateRepresentationType,
148 CoordinateRepresentationType>>;
150 TMovingImage::ImageDimension,
151 DefaultStaticMeshTraits<CoordinateRepresentationType,
152 TMovingImage::ImageDimension,
153 TMovingImage::ImageDimension,
154 CoordinateRepresentationType,
155 CoordinateRepresentationType,
156 CoordinateRepresentationType>>;
172 itkGetConstMacro(NumberOfMetrics,
unsigned int);
202 itkSetMacro(UseRelativeWeights,
bool);
203 itkGetConstMacro(UseRelativeWeights,
bool);
226 const DerivativeType &
268 return this->GetTransform(0);
283 virtual const InterpolatorType *
287 const InterpolatorType *
290 return this->GetInterpolator(0);
305 virtual const FixedImageType *
309 const FixedImageType *
312 return this->GetFixedImage(0);
327 virtual const FixedImageMaskType *
331 const FixedImageMaskType *
334 return this->GetFixedImageMask(0);
349 virtual const FixedImageRegionType &
353 const FixedImageRegionType &
356 return this->GetFixedImageRegion(0);
371 virtual const MovingImageType *
375 const MovingImageType *
378 return this->GetMovingImage(0);
393 virtual const MovingImageMaskType *
397 const MovingImageMaskType *
400 return this->GetMovingImageMask(0);
407 const SizeValueType &
420 GetValue(
const ParametersType & parameters)
const override;
424 GetDerivative(
const ParametersType & parameters, DerivativeType & derivative)
const override;
430 DerivativeType & derivative)
const override;
446 PrintSelf(std::ostream & os, Indent indent)
const override;
481#ifndef ITK_MANUAL_INSTANTIATION
482# include "itkCombinationImageToImageMetric.hxx"
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
typename DerivativeType::ValueType DerivativeValueType
typename DerivativeType::ValueType HessianValueType
typename ThreaderType::WorkUnitInfo ThreadInfoType
itk::PlatformMultiThreader ThreaderType
vnl_sparse_matrix< HessianValueType > HessianType
Combines multiple metrics.
virtual const FixedImageRegionType & GetFixedImageRegion(unsigned int pos) const
double GetFinalMetricWeight(unsigned int pos) const
const FixedImageType * GetFixedImage() const override
typename SingleValuedCostFunctionType::Pointer SingleValuedCostFunctionPointer
std::vector< MeasureType > m_MetricValues
const FixedImageMaskType * GetFixedImageMask() const override
const SizeValueType & GetNumberOfPixelsCounted() const override
void SetFixedImage(const FixedImageType *_arg) override
void GetDerivative(const ParametersType ¶meters, DerivativeType &derivative) const override
void SetMovingImageMask(MovingImageMaskType *_arg) override
double GetMetricRelativeWeight(unsigned int pos) const
void SetInterpolator(InterpolatorType *_arg) override
virtual const FixedImageType * GetFixedImage(unsigned int pos) const
const MovingImageMaskType * GetMovingImageMask() const override
itkStaticConstMacro(MovingImageDimension, unsigned int, TMovingImage::ImageDimension)
std::vector< double > m_MetricComputationTime
std::vector< double > m_MetricWeights
DerivativeType m_NullDerivative
void SetTransform(TransformType *_arg) override
MeasureType GetMetricValue(unsigned int pos) const
double GetMetricWeight(unsigned int pos) const
virtual const MovingImageType * GetMovingImage(unsigned int pos) const
~CombinationImageToImageMetric() override=default
ITK_DISALLOW_COPY_AND_MOVE(CombinationImageToImageMetric)
typename TransformType::Pointer TransformPointer
const TransformType * GetTransform() const override
std::vector< double > m_MetricDerivativesMagnitude
typename FixedImageType::PixelType FixedImagePixelType
void PrintSelf(std::ostream &os, Indent indent) const override
void SetFixedImageMask(FixedImageMaskType *_arg) override
PointSet< CoordinateRepresentationType, TMovingImage::ImageDimension, DefaultStaticMeshTraits< CoordinateRepresentationType, TMovingImage::ImageDimension, TMovingImage::ImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
unsigned int m_NumberOfMetrics
MeasureType GetValue(const ParametersType ¶meters) const override
typename MovingImageType::RegionType MovingImageRegionType
void SetMetric(SingleValuedCostFunctionType *metric, unsigned int pos)
const FixedImageRegionType & GetFixedImageRegion() const override
std::vector< SingleValuedCostFunctionPointer > m_Metrics
virtual void SetMovingImageMask(MovingImageMaskType *_arg, unsigned int pos)
void SetFixedImageRegion(const FixedImageRegionType _arg) override
ModifiedTimeType GetMTime() const override
virtual const MovingImageMaskType * GetMovingImageMask(unsigned int pos) const
double GetMetricDerivativeMagnitude(unsigned int pos) const
SingleValuedCostFunction SingleValuedCostFunctionType
PointSet< CoordinateRepresentationType, TFixedImage::ImageDimension, DefaultStaticMeshTraits< CoordinateRepresentationType, TFixedImage::ImageDimension, TFixedImage::ImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
void SetUseMetric(const bool use, const unsigned int pos)
virtual void SetTransform(TransformType *_arg, unsigned int pos)
const DerivativeType & GetMetricDerivative(unsigned int pos) const
virtual const InterpolatorType * GetInterpolator(unsigned int pos) const
void SetMetricWeight(double weight, unsigned int pos)
bool m_UseRelativeWeights
virtual void SetFixedImage(const FixedImageType *_arg, unsigned int pos)
void GetValueAndDerivative(const ParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const override
SingleValuedCostFunctionType * GetMetric(unsigned int count) const
bool GetUseMetric(const unsigned int pos) const
typename Superclass::AdvancedTransformType TransformType
virtual void SetFixedImageMask(FixedImageMaskType *_arg, unsigned int pos)
typename ImageMetricType::Pointer ImageMetricPointer
SmartPointer< const Self > ConstPointer
const InterpolatorType * GetInterpolator() const override
vnl_sparse_matrix< HessianValueType > HessianType
void SetMovingImage(const MovingImageType *_arg) override
void SetNumberOfMetrics(unsigned int count)
std::vector< double > m_MetricRelativeWeights
FixedImageRegionType m_NullFixedImageRegion
virtual const FixedImageMaskType * GetFixedImageMask(unsigned int pos) const
CombinationImageToImageMetric()
virtual const TransformType * GetTransform(unsigned int pos) const
virtual void SetFixedImageRegion(const FixedImageRegionType _arg, unsigned int pos)
void InitializeThreadingParameters() const override
virtual void SetInterpolator(InterpolatorType *_arg, unsigned int pos)
void GetSelfHessian(const TransformParametersType ¶meters, HessianType &H) const override
std::vector< bool > m_UseMetric
void Initialize() override
const MovingImageType * GetMovingImage() const override
double GetMetricComputationTime(unsigned int pos) const
virtual void SetMovingImage(const MovingImageType *_arg, unsigned int pos)
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
std::vector< DerivativeType > m_MetricDerivatives
void SetMetricRelativeWeight(double weight, unsigned int pos)
Computes similarity between two point sets.