23#include "itkSmoothingRecursiveGaussianImageFilter.h"
25#include "itkNearestNeighborInterpolateImageFunction.h"
26#include "itkExtractImageFilter.h"
32template <
class TFixedImage,
class TMovingImage>
44 using typename Superclass::FixedImageRegionType;
54 itkSetMacro(SampleLastDimensionRandomly,
bool);
55 itkSetMacro(NumSamplesLastDimension,
unsigned int);
56 itkSetMacro(NumAdditionalSamplesFixed,
unsigned int);
57 itkSetMacro(ReducedDimensionIndex,
unsigned int);
58 itkSetMacro(SubtractMean,
bool);
60 itkSetMacro(TransformIsStackTransform,
bool);
61 itkSetMacro(NumEigenValues,
unsigned int);
62 itkSetMacro(UseDerivativeOfMean,
bool);
63 itkSetMacro(DeNoise,
bool);
64 itkSetMacro(VarNoise,
double);
67 itkGetConstMacro(SampleLastDimensionRandomly,
bool);
68 itkGetConstMacro(NumSamplesLastDimension,
int);
71 using typename Superclass::CoordinateRepresentationType;
72 using typename Superclass::MovingImageType;
73 using typename Superclass::MovingImagePixelType;
74 using typename Superclass::MovingImageConstPointer;
75 using typename Superclass::FixedImageType;
76 using typename Superclass::FixedImageConstPointer;
77 using typename Superclass::TransformType;
78 using typename Superclass::TransformPointer;
79 using typename Superclass::InputPointType;
80 using typename Superclass::OutputPointType;
81 using typename Superclass::TransformParametersType;
82 using typename Superclass::TransformJacobianType;
83 using typename Superclass::InterpolatorType;
84 using typename Superclass::InterpolatorPointer;
85 using typename Superclass::RealType;
86 using typename Superclass::GradientPixelType;
87 using typename Superclass::GradientImageType;
88 using typename Superclass::GradientImagePointer;
89 using typename Superclass::GradientImageFilterType;
90 using typename Superclass::GradientImageFilterPointer;
91 using typename Superclass::FixedImageMaskType;
92 using typename Superclass::FixedImageMaskPointer;
93 using typename Superclass::MovingImageMaskType;
94 using typename Superclass::MovingImageMaskPointer;
95 using typename Superclass::MeasureType;
96 using typename Superclass::DerivativeType;
97 using typename Superclass::ParametersType;
98 using typename Superclass::FixedImagePixelType;
99 using typename Superclass::MovingImageRegionType;
100 using typename Superclass::ImageSamplerType;
101 using typename Superclass::ImageSamplerPointer;
102 using typename Superclass::ImageSampleContainerType;
103 using typename Superclass::ImageSampleContainerPointer;
104 using typename Superclass::FixedImageLimiterType;
105 using typename Superclass::MovingImageLimiterType;
106 using typename Superclass::FixedImageLimiterOutputType;
107 using typename Superclass::MovingImageLimiterOutputType;
108 using typename Superclass::MovingImageDerivativeScalesType;
118 GetValue(
const TransformParametersType & parameters)
const;
122 GetDerivative(
const TransformParametersType & parameters, DerivativeType & derivative)
const;
128 DerivativeType & Derivative)
const;
146 using typename Superclass::FixedImageIndexType;
147 using typename Superclass::FixedImageIndexValueType;
148 using typename Superclass::MovingImageIndexType;
149 using typename Superclass::FixedImagePointType;
151 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
152 using typename Superclass::MovingImagePointType;
153 using typename Superclass::MovingImageContinuousIndexType;
154 using typename Superclass::BSplineInterpolatorType;
155 using typename Superclass::CentralDifferenceGradientFilterType;
156 using typename Superclass::MovingImageDerivativeType;
157 using typename Superclass::NonZeroJacobianIndicesType;
165 DerivativeType & imageJacobian)
const;
181 SampleRandom(
const int n,
const int m, std::vector<int> & numbers)
const;
210#ifndef ITK_MANUAL_INSTANTIATION
211# include "itkPCAMetric.hxx"
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
ImageToImageMetric< TFixedImage, TMovingImage > Superclass
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
SmartPointer< const Self > ConstPointer
unsigned int m_NumSamplesLastDimension
unsigned int m_NumEigenValues
vnl_vector< double > m_normdCdmu
ITK_DISALLOW_COPY_AND_MOVE(PCAMetric)
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
void PrintSelf(std::ostream &os, Indent indent) const
vnl_vector< double > m_secondEigenVector
bool m_SampleLastDimensionRandomly
vnl_vector< double > m_firstEigenVector
FixedImageSizeType m_GridSize
vnl_vector< double > m_fourthEigenVector
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const
virtual MeasureType GetValue(const TransformParametersType ¶meters) const
bool m_TransformIsStackTransform
vnl_vector< double > m_fifthEigenVector
virtual void GetDerivative(const TransformParametersType ¶meters, DerivativeType &derivative) const
typename FixedImageRegionType::SizeType FixedImageSizeType
unsigned int m_NumAdditionalSamplesFixed
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
void SampleRandom(const int n, const int m, std::vector< int > &numbers) const
virtual void GetValueAndDerivative(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const
vnl_vector< double > m_sixthEigenVector
vnl_vector< double > m_eigenValues
virtual void Initialize()
vnl_vector< double > m_seventhEigenVector
vnl_vector< double > m_thirdEigenVector
unsigned int m_ReducedDimensionIndex
bool m_UseDerivativeOfMean