23#include "itkSmoothingRecursiveGaussianImageFilter.h"
25#include "itkNearestNeighborInterpolateImageFunction.h"
26#include "itkExtractImageFilter.h"
31template <
typename TFixedImage,
typename TMovingImage>
43 using typename Superclass::FixedImageRegionType;
53 itkSetMacro(UseZeroAverageDisplacementConstraint,
bool);
55 itkSetMacro(TransformIsStackTransform,
bool);
56 itkSetMacro(NumEigenValues,
unsigned int);
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;
111 GetValue(
const ParametersType & parameters)
const override;
115 GetDerivative(
const ParametersType & parameters, DerivativeType & derivative)
const override;
121 DerivativeType & Derivative)
const;
126 DerivativeType & Derivative)
const override;
139 PrintSelf(std::ostream & os, Indent indent)
const override;
149 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
162 DerivativeType & imageJacobian)
const override;
179 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
182 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
212 itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, PCAMetricGetSamplesPerThreadStruct, PaddedPCAMetricGetSamplesPerThreadStruct);
215 PaddedPCAMetricGetSamplesPerThreadStruct,
216 AlignedPCAMetricGetSamplesPerThreadStruct);
246#ifndef ITK_MANUAL_INSTANTIATION
247# include "itkPCAMetric.hxx"
typename TransformType::OutputPointType MovingImagePointType
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
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
MultiThreaderBase::WorkUnitInfo ThreadInfoType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
void GetDerivative(const ParametersType ¶meters, DerivativeType &derivative) const override
unsigned int m_NumEigenValues
void InitializeThreadingParameters() const override
void AfterThreadedGetSamples(MeasureType &value) const
void PrintSelf(std::ostream &os, Indent indent) const override
ITK_DISALLOW_COPY_AND_MOVE(PCAMetric)
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
std::vector< unsigned int > m_PixelStartIndex
unsigned int m_LastDimIndex
void GetValueAndDerivativeSingleThreaded(const ParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const
AdvancedImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType > Superclass
PCAMetricMultiThreaderParameterType m_PCAMetricThreaderParameters
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedPCAMetricGetSamplesPerThreadStruct, AlignedPCAMetricGetSamplesPerThreadStruct)
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override
DerivativeMatrixType m_Sv
itkOverrideGetNameOfClassMacro(PCAMetric)
FixedImageSizeType m_GridSize
SmartPointer< Self > Pointer
bool m_TransformIsStackTransform
DerivativeMatrixType m_vSAtmm
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
typename FixedImageRegionType::SizeType FixedImageSizeType
SmartPointer< const Self > ConstPointer
bool m_UseZeroAverageDisplacementConstraint
DerivativeMatrixType m_CSv
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
vnl_matrix< RealType > MatrixType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
void LaunchComputeDerivativeThreaderCallback() const
void Initialize() override
void GetValueAndDerivative(const ParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const override
void ThreadedComputeDerivative(ThreadIdType threadID)
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION GetSamplesThreaderCallback(void *arg)
std::vector< AlignedPCAMetricGetSamplesPerThreadStruct > m_PCAMetricGetSamplesPerThreadVariables
void AfterThreadedComputeDerivative(DerivativeType &derivative) const
void LaunchGetSamplesThreaderCallback() const
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ComputeDerivativeThreaderCallback(void *arg)
~PCAMetric() override=default
vnl_matrix< DerivativeValueType > DerivativeMatrixType
void ThreadedGetSamples(ThreadIdType threadID)
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, PCAMetricGetSamplesPerThreadStruct, PaddedPCAMetricGetSamplesPerThreadStruct)
MeasureType GetValue(const ParametersType ¶meters) const override
DerivativeMatrixType m_vdSdmu_part1
SizeValueType st_NumberOfPixelsCounted
DerivativeType st_Derivative
std::vector< FixedImagePointType > st_ApprovedSamples