18#ifndef __itkParzenWindowHistogramImageToImageMetric_H__
19#define __itkParzenWindowHistogramImageToImageMetric_H__
73template<
class TFixedImage,
class TMovingImage >
134 FixedImageType::ImageDimension );
138 MovingImageType::ImageDimension );
170 itkSetClampMacro( NumberOfFixedHistogramBins,
unsigned long,
171 4, NumericTraits< unsigned long >::max() );
172 itkGetMacro( NumberOfFixedHistogramBins,
unsigned long );
180 itkSetClampMacro( NumberOfMovingHistogramBins,
unsigned long,
181 4, NumericTraits< unsigned long >::max() );
182 itkGetMacro( NumberOfMovingHistogramBins,
unsigned long );
185 itkSetClampMacro( FixedKernelBSplineOrder,
unsigned int, 0, 3 );
186 itkGetConstMacro( FixedKernelBSplineOrder,
unsigned int );
189 itkSetClampMacro( MovingKernelBSplineOrder,
unsigned int, 0, 3 );
190 itkGetConstMacro( MovingKernelBSplineOrder,
unsigned int );
195 itkSetMacro( UseExplicitPDFDerivatives,
bool );
196 itkGetConstReferenceMacro( UseExplicitPDFDerivatives,
bool );
197 itkBooleanMacro( UseExplicitPDFDerivatives );
202 itkSetMacro( UseDerivative,
bool );
203 itkGetConstMacro( UseDerivative,
bool );
208 itkSetMacro( UseFiniteDifferenceDerivative,
bool );
209 itkGetConstMacro( UseFiniteDifferenceDerivative,
bool );
215 itkSetMacro( FiniteDifferencePerturbation,
double );
216 itkGetConstMacro( FiniteDifferencePerturbation,
double );
227 void PrintSelf( std::ostream & os, Indent indent )
const override;
318 PaddedParzenWindowHistogramGetValueAndDerivativePerThreadStruct );
319 itkAlignedTypedef( ITK_CACHE_LINE_ALIGNMENT, PaddedParzenWindowHistogramGetValueAndDerivativePerThreadStruct,
320 AlignedParzenWindowHistogramGetValueAndDerivativePerThreadStruct );
403 const unsigned int & direction )
const;
505#ifndef ITK_MANUAL_INSTANTIATION
506#include "itkParzenWindowHistogramImageToImageMetric.hxx"
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
Superclass::FixedImageConstPointer FixedImageConstPointer
ThreaderType::WorkUnitInfo ThreadInfoType
Superclass::TransformParametersType TransformParametersType
Superclass::InputPointType InputPointType
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::FixedImageMaskPointer FixedImageMaskPointer
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::TransformJacobianType TransformJacobianType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
Superclass::GradientImagePointer GradientImagePointer
Superclass::DerivativeType DerivativeType
Superclass::TransformPointer TransformPointer
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::OutputPointType OutputPointType
ImageSamplerBase< FixedImageType > ImageSamplerType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
Superclass::InterpolatorPointer InterpolatorPointer
Superclass::MovingImageMaskPointer MovingImageMaskPointer
Superclass::FixedImageType FixedImageType
TransformType::InputPointType FixedImagePointType
ImageSamplerType::Pointer ImageSamplerPointer
Superclass::MovingImageMaskType MovingImageMaskType
Superclass::GradientPixelType GradientPixelType
Superclass::MeasureType MeasureType
MovingImageType::IndexType MovingImageIndexType
MovingImageType::RegionType MovingImageRegionType
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
FixedImageIndexType::IndexValueType FixedImageIndexValueType
Superclass::MovingImagePixelType MovingImagePixelType
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::GradientImageType GradientImageType
FixedImageType::PixelType FixedImagePixelType
Superclass::InterpolatorType InterpolatorType
TransformType::OutputPointType MovingImagePointType
FixedImageType::IndexType FixedImageIndexType
Superclass::TransformType TransformType
DerivativeType::ValueType DerivativeValueType
Superclass::MovingImageType MovingImageType
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
itk::PlatformMultiThreader ThreaderType
Superclass::RealType RealType
Superclass::FixedImageRegionType FixedImageRegionType
Superclass::ParametersType ParametersType
Kernel used for density estimation and nonparameteric regression.
SmartPointer< Self > Pointer
A base class for image metrics based on a joint histogram computed using Parzen Windowing.
Superclass::MovingImageMaskPointer MovingImageMaskPointer
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImagePixelType MovingImagePixelType
MarginalPDFType m_MovingImageMarginalPDF
JointPDFRegionType m_JointPDFWindow
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
Superclass::CentralDifferenceGradientFilterType CentralDifferenceGradientFilterType
Superclass::ThreadInfoType ThreadInfoType
JointPDFDerivativesPointer m_JointPDFDerivatives
Superclass::MovingImageDerivativeType MovingImageDerivativeType
void Initialize(void) override
SmartPointer< Self > Pointer
Array< PDFValueType > MarginalPDFType
void InitializeThreadingParameters(void) const override
virtual void NormalizeJointPDF(JointPDFType *pdf, const double &factor) const
unsigned long m_NumberOfMovingHistogramBins
Superclass::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
DerivativeType m_PerturbedAlphaRight
KernelFunctionPointer m_MovingKernel
unsigned int m_FixedKernelBSplineOrder
JointPDFPointer m_JointPDF
JointPDFDerivativesType::RegionType JointPDFDerivativesRegionType
virtual void ComputePDFsAndIncrementalPDFs(const ParametersType ¶meters) const
ParzenWindowHistogramImageToImageMetric()
JointPDFType::Pointer JointPDFPointer
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::FixedImageLimiterType FixedImageLimiterType
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::BSplineInterpolatorType BSplineInterpolatorType
JointPDFDerivativesPointer m_IncrementalJointPDFRight
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
Superclass::FixedImageType FixedImageType
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::FixedImageRegionType FixedImageRegionType
Superclass::FixedImageLimiterOutputType FixedImageLimiterOutputType
Superclass::ImageSamplerPointer ImageSamplerPointer
bool m_UseExplicitPDFDerivatives
IncrementalMarginalPDFPointer m_MovingIncrementalMarginalPDFLeft
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::FixedImagePointType FixedImagePointType
Superclass::MovingImageLimiterType MovingImageLimiterType
Superclass::ParametersType ParametersType
KernelFunctionBase2< PDFValueType > KernelFunctionType
std::vector< JointPDFPointer > m_ThreaderJointPDFs
Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType
float PDFDerivativeValueType
void ThreadedComputePDFs(ThreadIdType threadId)
double m_FixedParzenTermToIndexOffset
Superclass::GradientImageType GradientImageType
Superclass::MovingImageIndexType MovingImageIndexType
IncrementalMarginalPDFType::RegionType IncrementalMarginalPDFRegionType
virtual void ComputePDFsSingleThreaded(const ParametersType ¶meters) const
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, ParzenWindowHistogramGetValueAndDerivativePerThreadStruct, PaddedParzenWindowHistogramGetValueAndDerivativePerThreadStruct)
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ComputePDFsThreaderCallback(void *arg)
virtual void InitializeKernels(void)
virtual void ComputePDFsAndPDFDerivatives(const ParametersType ¶meters) const
IncrementalMarginalPDFPointer m_FixedIncrementalMarginalPDFLeft
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Superclass::GradientPixelType GradientPixelType
bool m_UseFiniteDifferenceDerivative
KernelFunctionType::Pointer KernelFunctionPointer
void GetDerivative(const ParametersType ¶meters, DerivativeType &Derivative) const override
ParzenWindowHistogramImageToImageMetric Self
Superclass::FixedImageIndexValueType FixedImageIndexValueType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
void AfterThreadedComputePDFs(void) const
Superclass::FixedImageMaskPointer FixedImageMaskPointer
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedParzenWindowHistogramGetValueAndDerivativePerThreadStruct, AlignedParzenWindowHistogramGetValueAndDerivativePerThreadStruct)
IncrementalMarginalPDFType::Pointer IncrementalMarginalPDFPointer
~ParzenWindowHistogramImageToImageMetric() override
Superclass::TransformPointer TransformPointer
JointPDFType::RegionType JointPDFRegionType
IncrementalMarginalPDFType::SizeType IncrementalMarginalPDFSizeType
Superclass::DerivativeValueType DerivativeValueType
void UpdateJointPDFDerivatives(const JointPDFIndexType &pdfIndex, double factor, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji) const
void LaunchComputePDFsThreaderCallback(void) const
Superclass::GradientImagePointer GradientImagePointer
virtual void InitializeHistograms(void)
double m_FiniteDifferencePerturbation
Superclass::MovingImageMaskType MovingImageMaskType
Superclass::TransformJacobianType TransformJacobianType
Superclass::RealType RealType
virtual void ComputeMarginalPDF(const JointPDFType *jointPDF, MarginalPDFType &marginalPDF, const unsigned int &direction) const
virtual void GetValueAndAnalyticDerivative(const ParametersType &, MeasureType &, DerivativeType &) const
Superclass::MovingImagePointType MovingImagePointType
Superclass::InputPointType InputPointType
virtual void ComputePDFs(const ParametersType ¶meters) const
JointPDFDerivativesType::SizeType JointPDFDerivativesSizeType
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
Image< PDFDerivativeValueType, 3 > JointPDFDerivativesType
Superclass::TransformType TransformType
ThreadIdType m_ParzenWindowHistogramGetValueAndDerivativePerThreadVariablesSize
JointPDFDerivativesType::Pointer JointPDFDerivativesPointer
DerivativeType m_PerturbedAlphaLeft
Superclass::ThreaderType ThreaderType
Superclass::FixedImagePixelType FixedImagePixelType
Superclass::OutputPointType OutputPointType
double m_MovingParzenTermToIndexOffset
Superclass::MovingImageRegionType MovingImageRegionType
virtual void UpdateJointPDFAndIncrementalPDFs(RealType fixedImageValue, RealType movingImageValue, RealType movingMaskValue, const DerivativeType &movingImageValuesRight, const DerivativeType &movingImageValuesLeft, const DerivativeType &movingMaskValuesRight, const DerivativeType &movingMaskValuesLeft, const NonZeroJacobianIndicesType &nzji) const
double m_MovingImageNormalizedMin
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Image< PDFValueType, 2 > JointPDFType
double m_FixedImageBinSize
JointPDFDerivativesPointer m_IncrementalJointPDFLeft
unsigned long m_NumberOfFixedHistogramBins
Superclass::MovingImageType MovingImageType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
void GetValueAndDerivative(const ParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const override
JointPDFType::IndexType JointPDFIndexType
unsigned int m_MovingKernelBSplineOrder
JointPDFDerivativesType::IndexType JointPDFDerivativesIndexType
void PrintSelf(std::ostream &os, Indent indent) const override
JointPDFType::SizeType JointPDFSizeType
double m_MovingImageBinSize
Superclass::FixedImageIndexType FixedImageIndexType
virtual void NormalizeJointPDFDerivatives(JointPDFDerivativesType *pdf, const double &factor) const
virtual void UpdateJointPDFAndDerivatives(const RealType &fixedImageValue, const RealType &movingImageValue, const DerivativeType *imageJacobian, const NonZeroJacobianIndicesType *nzji, JointPDFType *jointPDF) const
KernelFunctionPointer m_DerivativeMovingKernel
ParzenWindowHistogramMultiThreaderParameterType m_ParzenWindowHistogramThreaderParameters
SmartPointer< const Self > ConstPointer
KernelFunctionPointer m_FixedKernel
virtual void ComputeIncrementalMarginalPDFs(const JointPDFDerivativesType *incrementalPDF, IncrementalMarginalPDFType *fixedIncrementalMarginalPDF, IncrementalMarginalPDFType *movingIncrementalMarginalPDF) const
Superclass::InterpolatorPointer InterpolatorPointer
ParzenWindowHistogramImageToImageMetric(const Self &)
Superclass::MeasureType MeasureType
FixedImageType::OffsetValueType OffsetValueType
IncrementalMarginalPDFPointer m_MovingIncrementalMarginalPDFRight
Superclass::ImageSamplerType ImageSamplerType
Image< PDFValueType, 2 > IncrementalMarginalPDFType
void EvaluateParzenValues(double parzenWindowTerm, OffsetValueType parzenWindowIndex, const KernelFunctionType *kernel, ParzenValueContainerType &parzenValues) const
Superclass::ImageSampleContainerType ImageSampleContainerType
Superclass::DerivativeType DerivativeType
AlignedParzenWindowHistogramGetValueAndDerivativePerThreadStruct * m_ParzenWindowHistogramGetValueAndDerivativePerThreadVariables
double m_FixedImageNormalizedMin
IncrementalMarginalPDFPointer m_FixedIncrementalMarginalPDFRight
virtual void GetValueAndFiniteDifferenceDerivative(const ParametersType &, MeasureType &, DerivativeType &) const
IncrementalMarginalPDFType::IndexType IncrementalMarginalPDFIndexType
MarginalPDFType m_FixedImageMarginalPDF
void operator=(const Self &)
Superclass::InterpolatorType InterpolatorType
Array< PDFValueType > ParzenValueContainerType
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
SizeValueType st_NumberOfPixelsCounted
JointPDFPointer st_JointPDF