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;
106 using typename Superclass::MeasureType;
107 using typename Superclass::DerivativeType;
109 using typename Superclass::ParametersType;
136 TFixedImage::ImageDimension,
137 DefaultStaticMeshTraits<CoordinateRepresentationType,
138 TFixedImage::ImageDimension,
139 TFixedImage::ImageDimension,
140 CoordinateRepresentationType,
141 CoordinateRepresentationType,
142 CoordinateRepresentationType>>;
144 TMovingImage::ImageDimension,
145 DefaultStaticMeshTraits<CoordinateRepresentationType,
146 TMovingImage::ImageDimension,
147 TMovingImage::ImageDimension,
148 CoordinateRepresentationType,
149 CoordinateRepresentationType,
150 CoordinateRepresentationType>>;
165 itkGetConstMacro(NumberOfMetrics,
unsigned int);
195 itkSetMacro(UseRelativeWeights,
bool);
196 itkGetConstMacro(UseRelativeWeights,
bool);
219 const DerivativeType &
262 return metric ? metric->GetTransform() :
nullptr;
266 const TransformType *
284 virtual const InterpolatorType *
292 return metric ? metric->GetInterpolator() :
nullptr;
296 const InterpolatorType *
314 virtual const FixedImageType *
318 const FixedImageType *
358 virtual const FixedImageRegionType &
362 const FixedImageRegionType &
380 virtual const MovingImageType *
384 const MovingImageType *
416 const SizeValueType &
429 GetValue(
const ParametersType & parameters)
const override;
433 GetDerivative(
const ParametersType & parameters, DerivativeType & derivative)
const override;
439 DerivativeType & derivative)
const override;
451 PrintSelf(std::ostream & os, Indent indent)
const override;
455 std::vector<SingleValuedCostFunctionPointer>
m_Metrics{};
471 using Superclass::SetFixedImageMask;
472 using Superclass::SetMovingImageMask;
473 using Superclass::SetTransform;
491#ifndef ITK_MANUAL_INSTANTIATION
492# include "itkCombinationImageToImageMetric.hxx"
typename DerivativeType::ValueType DerivativeValueType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
AdvancedTransform< ScalarType, FixedImageDimension, MovingImageDimension > AdvancedTransformType
SmartPointer< MovingImageMaskType > MovingImageMaskPointer
AdvancedImageToImageMetric()
MultiThreaderBase::WorkUnitInfo ThreadInfoType
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
SmartPointer< Self > Pointer
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
virtual const FixedImageRegionType & GetFixedImageRegion(unsigned int pos) const
double GetFinalMetricWeight(unsigned int pos) const
const FixedImageType * GetFixedImage() const override
PointSet< CoordinateRepresentationType, TFixedImage::ImageDimension, DefaultStaticMeshTraits< CoordinateRepresentationType, TFixedImage::ImageDimension, TFixedImage::ImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > FixedPointSetType
typename SingleValuedCostFunctionType::Pointer SingleValuedCostFunctionPointer
std::vector< MeasureType > m_MetricValues
virtual void SetMovingImageMask(const MovingImageMaskType *_arg, unsigned int pos)
const FixedImageMaskType * GetFixedImageMask() const override
const SizeValueType & GetNumberOfPixelsCounted() const override
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
void SetFixedImage(const FixedImageType *_arg) override
void SetFixedImageMask(const FixedImageMaskType *_arg) override
void GetDerivative(const ParametersType ¶meters, DerivativeType &derivative) const 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)
SingleValuedPointSetToPointSetMetric< FixedPointSetType, MovingPointSetType > PointSetMetricType
typename TransformType::Pointer TransformPointer
const TransformType * GetTransform() const override
std::vector< double > m_MetricDerivativesMagnitude
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
typename FixedImageType::PixelType FixedImagePixelType
void PrintSelf(std::ostream &os, Indent indent) const override
TransformType * GetTransform() override
unsigned int m_NumberOfMetrics
MeasureType GetValue(const ParametersType ¶meters) const override
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
typename MovingImageType::RegionType MovingImageRegionType
void SetMetric(SingleValuedCostFunctionType *metric, unsigned int pos)
const FixedImageRegionType & GetFixedImageRegion() const override
std::vector< SingleValuedCostFunctionPointer > m_Metrics
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
SmartPointer< Self > Pointer
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)
virtual void SetFixedImageMask(const FixedImageMaskType *_arg, unsigned int pos)
bool m_UseRelativeWeights
PointSet< CoordinateRepresentationType, TMovingImage::ImageDimension, DefaultStaticMeshTraits< CoordinateRepresentationType, TMovingImage::ImageDimension, TMovingImage::ImageDimension, CoordinateRepresentationType, CoordinateRepresentationType, CoordinateRepresentationType > > MovingPointSetType
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
void SetMovingImageMask(const MovingImageMaskType *_arg) override
bool GetUseMetric(const unsigned int pos) const
typename Superclass::AdvancedTransformType TransformType
typename ImageMetricType::Pointer ImageMetricPointer
SmartPointer< const Self > ConstPointer
Superclass ImageMetricType
const InterpolatorType * GetInterpolator() const override
void SetMovingImage(const MovingImageType *_arg) override
void SetNumberOfMetrics(unsigned int count)
std::vector< double > m_MetricRelativeWeights
FixedImageRegionType m_NullFixedImageRegion
InterpolatorType * GetInterpolator() override
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)
std::vector< bool > m_UseMetric
void Initialize() override
const MovingImageType * GetMovingImage() const override
double GetMetricComputationTime(unsigned int pos) const
CombinationImageToImageMetric Self
virtual void SetMovingImage(const MovingImageType *_arg, unsigned int pos)
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
std::vector< DerivativeType > m_MetricDerivatives
void SetMetricRelativeWeight(double weight, unsigned int pos)
Computes similarity between two point sets.