18#ifndef itkAdvancedMeanSquaresImageToImageMetric_h
19#define itkAdvancedMeanSquaresImageToImageMetric_h
23#include "itkSmoothingRecursiveGaussianImageFilter.h"
25#include "itkNearestNeighborInterpolateImageFunction.h"
55template <
class TFixedImage,
class TMovingImage>
75 using typename Superclass::CoordinateRepresentationType;
76 using typename Superclass::MovingImageType;
77 using typename Superclass::MovingImagePixelType;
78 using typename Superclass::MovingImageConstPointer;
79 using typename Superclass::FixedImageType;
80 using typename Superclass::FixedImageConstPointer;
81 using typename Superclass::FixedImageRegionType;
82 using typename Superclass::TransformType;
83 using typename Superclass::TransformPointer;
84 using typename Superclass::InputPointType;
85 using typename Superclass::OutputPointType;
86 using typename Superclass::TransformParametersType;
87 using typename Superclass::TransformJacobianType;
89 using typename Superclass::InterpolatorType;
90 using typename Superclass::InterpolatorPointer;
91 using typename Superclass::RealType;
92 using typename Superclass::GradientPixelType;
93 using typename Superclass::GradientImageType;
94 using typename Superclass::GradientImagePointer;
95 using typename Superclass::GradientImageFilterType;
96 using typename Superclass::GradientImageFilterPointer;
97 using typename Superclass::FixedImageMaskType;
98 using typename Superclass::FixedImageMaskPointer;
99 using typename Superclass::MovingImageMaskType;
100 using typename Superclass::MovingImageMaskPointer;
101 using typename Superclass::MeasureType;
102 using typename Superclass::DerivativeType;
104 using typename Superclass::ParametersType;
135 GetValue(
const TransformParametersType & parameters)
const override;
139 GetDerivative(
const TransformParametersType & parameters, DerivativeType & derivative)
const override;
145 DerivativeType & derivative)
const;
150 DerivativeType & derivative)
const override;
157 itkSetMacro(SelfHessianSmoothingSigma,
double);
158 itkGetConstMacro(SelfHessianSmoothingSigma,
double);
161 itkSetMacro(SelfHessianNoiseRange,
double);
162 itkGetConstMacro(SelfHessianNoiseRange,
double);
165 itkSetMacro(NumberOfSamplesForSelfHessian,
unsigned int);
166 itkGetConstMacro(NumberOfSamplesForSelfHessian,
unsigned int);
182 itkSetMacro(UseNormalization,
bool);
183 itkGetConstMacro(UseNormalization,
bool);
190 itkSetMacro(UseOpenMP,
bool);
197 PrintSelf(std::ostream & os, Indent indent)
const override;
214 using SmootherType = SmoothingRecursiveGaussianImageFilter<FixedImageType, FixedImageType>;
217 NearestNeighborInterpolateImageFunction<FixedImageType, CoordinateRepresentationType>;
226 const RealType movingImageValue,
227 const DerivativeType & imageJacobian,
229 MeasureType & measure,
230 DerivativeType & deriv)
const;
264#ifndef ITK_MANUAL_INSTANTIATION
265# include "itkAdvancedMeanSquaresImageToImageMetric.hxx"
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
typename FixedImageType::PixelType FixedImagePixelType
typename DerivativeType::ValueType DerivativeValueType
typename DerivativeType::ValueType HessianValueType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename ThreaderType::WorkUnitInfo ThreadInfoType
itk::PlatformMultiThreader ThreaderType
typename FixedImageType::IndexType FixedImageIndexType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskSpatialObject2Type
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
vnl_sparse_matrix< HessianValueType > HessianType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskSpatialObject2Type
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
typename AdvancedTransformType::NumberOfParametersType NumberOfParametersType
Compute Mean square difference between two images, based on AdvancedImageToImageMetric....
void ThreadedGetValueAndDerivative(ThreadIdType threadID) override
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
double m_SelfHessianNoiseRange
BSplineInterpolateImageFunction< FixedImageType, CoordinateRepresentationType > FixedImageInterpolatorType
void AfterThreadedGetValue(MeasureType &value) const override
unsigned int m_NumberOfSamplesForSelfHessian
void GetDerivative(const TransformParametersType ¶meters, DerivativeType &derivative) const override
void UpdateSelfHessianTerms(const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, HessianType &H) const
SmoothingRecursiveGaussianImageFilter< FixedImageType, FixedImageType > SmootherType
void ThreadedGetValue(ThreadIdType threadID) override
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const override
~AdvancedMeanSquaresImageToImageMetric() override=default
virtual MeasureType GetValueSingleThreaded(const TransformParametersType ¶meters) const
AdvancedMeanSquaresImageToImageMetric()
void Initialize() override
void GetSelfHessian(const TransformParametersType ¶meters, HessianType &H) const override
NearestNeighborInterpolateImageFunction< FixedImageType, CoordinateRepresentationType > DummyFixedImageInterpolatorType
double m_NormalizationFactor
void GetValueAndDerivative(const TransformParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const override
ITK_DISALLOW_COPY_AND_MOVE(AdvancedMeanSquaresImageToImageMetric)
void PrintSelf(std::ostream &os, Indent indent) const override
vnl_sparse_matrix< HessianValueType > HessianType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
double m_SelfHessianSmoothingSigma
void UpdateValueAndDerivativeTerms(const RealType fixedImageValue, const RealType movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, MeasureType &measure, DerivativeType &deriv) const
void GetValueAndDerivativeSingleThreaded(const TransformParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const
SmartPointer< const Self > ConstPointer
MeasureType GetValue(const TransformParametersType ¶meters) const override
Samples image voxels on a regular grid.
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.