23#include "itkSmoothingRecursiveGaussianImageFilter.h"
25#include "itkNearestNeighborInterpolateImageFunction.h"
26#include "itkExtractImageFilter.h"
31template <
class TFixedImage,
class 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::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;
81 using typename Superclass::MeasureType;
82 using typename Superclass::DerivativeType;
83 using typename Superclass::ParametersType;
112 GetValue(
const TransformParametersType & parameters)
const override;
116 GetDerivative(
const TransformParametersType & parameters, DerivativeType & derivative)
const override;
122 DerivativeType & Derivative)
const;
127 DerivativeType & Derivative)
const override;
140 PrintSelf(std::ostream & os, Indent indent)
const override;
150 typename itk::ContinuousIndex<CoordinateRepresentationType, FixedImageDimension>;
163 DerivativeType & imageJacobian)
const override;
180 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
183 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
216 PaddedPCAMetricGetSamplesPerThreadStruct,
217 AlignedPCAMetricGetSamplesPerThreadStruct);
219 mutable std::vector<AlignedPCAMetricGetSamplesPerThreadStruct> m_PCAMetricGetSamplesPerThreadVariables{};
222 unsigned int m_LastDimIndex{};
225 bool m_UseZeroAverageDisplacementConstraint{
true };
231 bool m_TransformIsStackTransform{
false };
234 unsigned int m_NumEigenValues{ 6 };
237 mutable std::vector<unsigned int> m_PixelStartIndex{};
247#ifndef ITK_MANUAL_INSTANTIATION
248# include "itkPCAMetric.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
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
MultiThreaderBase::WorkUnitInfo ThreadInfoType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
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
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.
void GetValueAndDerivativeSingleThreaded(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const
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)
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedPCAMetricGetSamplesPerThreadStruct, AlignedPCAMetricGetSamplesPerThreadStruct)
void GetValueAndDerivative(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const override
MeasureType GetValue(const TransformParametersType ¶meters) const override
void EvaluateTransformJacobianInnerProduct(const TransformJacobianType &jacobian, const MovingImageDerivativeType &movingImageDerivative, DerivativeType &imageJacobian) const override
typename itk::ContinuousIndex< CoordinateRepresentationType, FixedImageDimension > FixedImageContinuousIndexType
typename FixedImageRegionType::SizeType FixedImageSizeType
SmartPointer< const Self > ConstPointer
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
void LaunchComputeDerivativeThreaderCallback() const
void Initialize() override
void ThreadedComputeDerivative(ThreadIdType threadID)
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION GetSamplesThreaderCallback(void *arg)
void AfterThreadedComputeDerivative(DerivativeType &derivative) const
void LaunchGetSamplesThreaderCallback() const
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ComputeDerivativeThreaderCallback(void *arg)
~PCAMetric() override=default
void ThreadedGetSamples(ThreadIdType threadID)
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, PCAMetricGetSamplesPerThreadStruct, PaddedPCAMetricGetSamplesPerThreadStruct)
void GetDerivative(const TransformParametersType ¶meters, DerivativeType &derivative) const override
SizeValueType st_NumberOfPixelsCounted
DerivativeType st_Derivative
std::vector< FixedImagePointType > st_ApprovedSamples