19#ifndef itkVarianceOverLastDimensionImageMetric_h
20#define itkVarianceOverLastDimensionImageMetric_h
22#include "itkSmoothingRecursiveGaussianImageFilter.h"
24#include "itkNearestNeighborInterpolateImageFunction.h"
51template <
class TFixedImage,
class TMovingImage>
64 using typename Superclass::FixedImageRegionType;
74 itkSetMacro(SampleLastDimensionRandomly,
bool);
75 itkSetMacro(NumSamplesLastDimension,
unsigned int);
76 itkSetMacro(NumAdditionalSamplesFixed,
unsigned int);
77 itkSetMacro(ReducedDimensionIndex,
unsigned int);
78 itkSetMacro(SubtractMean,
bool);
80 itkSetMacro(TransformIsStackTransform,
bool);
83 itkGetConstMacro(SampleLastDimensionRandomly,
bool);
84 itkGetConstMacro(NumSamplesLastDimension,
int);
87 using typename Superclass::CoordinateRepresentationType;
88 using typename Superclass::MovingImageType;
89 using typename Superclass::MovingImagePixelType;
90 using typename Superclass::MovingImageConstPointer;
91 using typename Superclass::FixedImageType;
92 using typename Superclass::FixedImageConstPointer;
93 using typename Superclass::TransformType;
94 using typename Superclass::TransformPointer;
95 using typename Superclass::InputPointType;
96 using typename Superclass::OutputPointType;
97 using typename Superclass::TransformParametersType;
98 using typename Superclass::TransformJacobianType;
99 using typename Superclass::InterpolatorType;
100 using typename Superclass::InterpolatorPointer;
101 using typename Superclass::RealType;
102 using typename Superclass::GradientPixelType;
103 using typename Superclass::GradientImageType;
104 using typename Superclass::GradientImagePointer;
105 using typename Superclass::GradientImageFilterType;
106 using typename Superclass::GradientImageFilterPointer;
107 using typename Superclass::FixedImageMaskType;
108 using typename Superclass::FixedImageMaskPointer;
109 using typename Superclass::MovingImageMaskType;
110 using typename Superclass::MovingImageMaskPointer;
111 using typename Superclass::MeasureType;
112 using typename Superclass::DerivativeType;
113 using typename Superclass::ParametersType;
134 GetValue(
const TransformParametersType & parameters)
const override;
138 GetDerivative(
const TransformParametersType & parameters, DerivativeType & derivative)
const override;
144 DerivativeType & Derivative)
const override;
156 PrintSelf(std::ostream & os, Indent indent)
const override;
166 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
180 DerivativeType & imageJacobian)
const override;
185 SampleRandom(
const int n,
const int m, std::vector<int> & numbers)
const;
188 bool m_SampleLastDimensionRandomly{
false };
189 unsigned int m_NumSamplesLastDimension{ 10 };
194 bool m_SubtractMean{
false };
203 bool m_TransformIsStackTransform{
false };
208#ifndef ITK_MANUAL_INSTANTIATION
209# include "itkVarianceOverLastDimensionImageMetric.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
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename FixedImageType::IndexType FixedImageIndexType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.
Compute the sum of variances over the slowest varying dimension in the moving image.
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
~VarianceOverLastDimensionImageMetric() override=default
void SampleRandom(const int n, const int m, std::vector< int > &numbers) const
void PrintSelf(std::ostream &os, Indent indent) const override
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
VarianceOverLastDimensionImageMetric()
void Initialize() override
unsigned int m_NumAdditionalSamplesFixed
MeasureType GetValue(const TransformParametersType ¶meters) const override
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override
void GetDerivative(const TransformParametersType ¶meters, DerivativeType &derivative) const override
unsigned int m_ReducedDimensionIndex
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
SmartPointer< const Self > ConstPointer
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
ITK_DISALLOW_COPY_AND_MOVE(VarianceOverLastDimensionImageMetric)
void GetValueAndDerivative(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const override
FixedImageSizeType m_GridSize
typename FixedImageRegionType::SizeType FixedImageSizeType