18#ifndef itkPCAMetric2_h
19#define itkPCAMetric2_h
23#include "itkSmoothingRecursiveGaussianImageFilter.h"
25#include "itkNearestNeighborInterpolateImageFunction.h"
26#include "itkExtractImageFilter.h"
30template <
typename TFixedImage,
typename TMovingImage>
42 using typename Superclass::FixedImageRegionType;
52 itkSetMacro(NumAdditionalSamplesFixed,
unsigned int);
53 itkSetMacro(ReducedDimensionIndex,
unsigned int);
54 itkSetMacro(UseZeroAverageDisplacementConstraint,
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::TransformJacobianType;
70 using typename Superclass::InterpolatorType;
71 using typename Superclass::InterpolatorPointer;
72 using typename Superclass::RealType;
73 using typename Superclass::GradientPixelType;
74 using typename Superclass::GradientImageType;
75 using typename Superclass::GradientImagePointer;
80 using typename Superclass::MeasureType;
81 using typename Superclass::DerivativeType;
82 using typename Superclass::ParametersType;
104 GetValue(
const ParametersType & parameters)
const override;
108 GetDerivative(
const ParametersType & parameters, DerivativeType & derivative)
const override;
114 DerivativeType & Derivative)
const override;
127 PrintSelf(std::ostream & os, Indent indent)
const override;
137 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
151 DerivativeType & imageJacobian)
const override;
156 SampleRandom(
const int n,
const int m, std::vector<int> & numbers)
const;
174#ifndef ITK_MANUAL_INSTANTIATION
175# include "itkPCAMetric2.hxx"
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename MovingImageType::RegionType MovingImageRegionType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
typename FixedImageType::PixelType FixedImagePixelType
typename DerivativeType::ValueType DerivativeValueType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
typename FixedImageType::IndexType FixedImageIndexType
SmartPointer< MovingImageMaskType > MovingImageMaskPointer
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
AdvancedImageToImageMetric()
ImageSamplerBase< FixedImageType > ImageSamplerType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
FixedImageSizeType m_GridSize
SmartPointer< Self > Pointer
AdvancedImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType > Superclass
typename FixedImageRegionType::SizeType FixedImageSizeType
unsigned int m_NumAdditionalSamplesFixed
void PrintSelf(std::ostream &os, Indent indent) const override
MeasureType GetValue(const ParametersType ¶meters) const override
void SampleRandom(const int n, const int m, std::vector< int > &numbers) const
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
bool m_TransformIsStackTransform
unsigned int m_ReducedDimensionIndex
void GetDerivative(const ParametersType ¶meters, DerivativeType &derivative) const override
~PCAMetric2() override=default
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
SmartPointer< const Self > ConstPointer
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
void GetValueAndDerivative(const ParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const override
ITK_DISALLOW_COPY_AND_MOVE(PCAMetric2)
itkOverrideGetNameOfClassMacro(PCAMetric2)
void Initialize() override
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override
bool m_UseZeroAverageDisplacementConstraint