18#ifndef itkPCAMetric2_h
19#define itkPCAMetric2_h
23#include "itkSmoothingRecursiveGaussianImageFilter.h"
25#include "itkNearestNeighborInterpolateImageFunction.h"
26#include "itkExtractImageFilter.h"
30template <
class TFixedImage,
class TMovingImage>
42 using typename Superclass::FixedImageRegionType;
52 itkSetMacro(NumAdditionalSamplesFixed,
unsigned int);
53 itkSetMacro(ReducedDimensionIndex,
unsigned int);
54 itkSetMacro(SubtractMean,
bool);
56 itkSetMacro(TransformIsStackTransform,
bool);
59 using typename Superclass::CoordinateRepresentationType;
60 using typename Superclass::MovingImageType;
61 using typename Superclass::MovingImagePixelType;
62 using typename Superclass::MovingImageConstPointer;
63 using typename Superclass::FixedImageType;
64 using typename Superclass::FixedImageConstPointer;
65 using typename Superclass::TransformType;
66 using typename Superclass::TransformPointer;
67 using typename Superclass::InputPointType;
68 using typename Superclass::OutputPointType;
69 using typename Superclass::TransformParametersType;
70 using typename Superclass::TransformJacobianType;
71 using typename Superclass::InterpolatorType;
72 using typename Superclass::InterpolatorPointer;
73 using typename Superclass::RealType;
74 using typename Superclass::GradientPixelType;
75 using typename Superclass::GradientImageType;
76 using typename Superclass::GradientImagePointer;
77 using typename Superclass::GradientImageFilterType;
78 using typename Superclass::GradientImageFilterPointer;
79 using typename Superclass::FixedImageMaskType;
80 using typename Superclass::FixedImageMaskPointer;
81 using typename Superclass::MovingImageMaskType;
82 using typename Superclass::MovingImageMaskPointer;
83 using typename Superclass::MeasureType;
84 using typename Superclass::DerivativeType;
85 using typename Superclass::ParametersType;
106 GetValue(
const TransformParametersType & parameters)
const override;
110 GetDerivative(
const TransformParametersType & parameters, DerivativeType & derivative)
const override;
116 DerivativeType & Derivative)
const override;
129 PrintSelf(std::ostream & os, Indent indent)
const override;
139 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
154 DerivativeType & imageJacobian)
const override;
159 SampleRandom(
const int n,
const int m, std::vector<int> & numbers)
const;
166 bool m_SubtractMean{
false };
172 bool m_TransformIsStackTransform{
false };
177#ifndef ITK_MANUAL_INSTANTIATION
178# include "itkPCAMetric2.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.
MeasureType GetValue(const TransformParametersType ¶meters) const override
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
FixedImageSizeType m_GridSize
typename FixedImageRegionType::SizeType FixedImageSizeType
unsigned int m_NumAdditionalSamplesFixed
void PrintSelf(std::ostream &os, Indent indent) const override
void GetValueAndDerivative(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const override
void SampleRandom(const int n, const int m, std::vector< int > &numbers) const
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
unsigned int m_ReducedDimensionIndex
~PCAMetric2() override=default
SmartPointer< const Self > ConstPointer
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
ITK_DISALLOW_COPY_AND_MOVE(PCAMetric2)
void GetDerivative(const TransformParametersType ¶meters, DerivativeType &derivative) const override
void Initialize() override
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override