18 #ifndef __itkParzenWindowHistogramImageToImageMetric_H__ 19 #define __itkParzenWindowHistogramImageToImageMetric_H__ 22 #include "itkBSplineKernelFunction.h" 72 template<
class TFixedImage,
class TMovingImage >
133 FixedImageType::ImageDimension );
137 MovingImageType::ImageDimension );
145 void Initialize(
void ) throw ( ExceptionObject );
152 const ParametersType & parameters,
153 DerivativeType & Derivative ) const;
161 MeasureType & value, DerivativeType & derivative ) const;
169 itkSetClampMacro( NumberOfFixedHistogramBins,
unsigned long,
170 4, NumericTraits<
unsigned long >::
max() );
171 itkGetMacro( NumberOfFixedHistogramBins,
unsigned long );
179 itkSetClampMacro( NumberOfMovingHistogramBins,
unsigned long,
180 4, NumericTraits<
unsigned long >::max() );
181 itkGetMacro( NumberOfMovingHistogramBins,
unsigned long );
184 itkSetClampMacro( FixedKernelBSplineOrder,
unsigned int, 0, 3 );
185 itkGetConstMacro( FixedKernelBSplineOrder,
unsigned int );
188 itkSetClampMacro( MovingKernelBSplineOrder,
unsigned int, 0, 3 );
189 itkGetConstMacro( MovingKernelBSplineOrder,
unsigned int );
194 itkSetMacro( UseExplicitPDFDerivatives,
bool );
195 itkGetConstReferenceMacro( UseExplicitPDFDerivatives,
bool );
196 itkBooleanMacro( UseExplicitPDFDerivatives );
201 itkSetMacro( UseDerivative,
bool );
202 itkGetConstMacro( UseDerivative,
bool );
207 itkSetMacro( UseFiniteDifferenceDerivative,
bool );
208 itkGetConstMacro( UseFiniteDifferenceDerivative,
bool );
214 itkSetMacro( FiniteDifferencePerturbation,
double );
215 itkGetConstMacro( FiniteDifferencePerturbation,
double );
223 virtual ~ParzenWindowHistogramImageToImageMetric();
226 void PrintSelf(
std::ostream & os, Indent indent ) const;
317 PaddedParzenWindowHistogramGetValueAndDerivativePerThreadStruct );
318 itkAlignedTypedef( ITK_CACHE_LINE_ALIGNMENT, PaddedParzenWindowHistogramGetValueAndDerivativePerThreadStruct,
319 AlignedParzenWindowHistogramGetValueAndDerivativePerThreadStruct );
353 const RealType & fixedImageValue,
354 const RealType & movingImageValue,
355 const DerivativeType * imageJacobian,
370 RealType fixedImageValue, RealType movingImageValue, RealType movingMaskValue,
371 const DerivativeType & movingImageValuesRight,
372 const DerivativeType & movingImageValuesLeft,
373 const DerivativeType & movingMaskValuesRight,
374 const DerivativeType & movingMaskValuesLeft,
384 const DerivativeType & imageJacobian,
402 const unsigned int & direction )
const;
458 virtual void ComputePDFs(
const ParametersType & parameters )
const;
470 const ParametersType & itkNotUsed( parameters ),
471 MeasureType & itkNotUsed( value ),
472 DerivativeType & itkNotUsed( derivative ) )
const {}
479 const ParametersType & itkNotUsed( parameters ),
480 MeasureType & itkNotUsed( value ),
481 DerivativeType & itkNotUsed( derivative ) )
const {}
504 #ifndef ITK_MANUAL_INSTANTIATION 505 #include "itkParzenWindowHistogramImageToImageMetric.hxx" 508 #endif // end #ifndef __itkParzenWindowHistogramImageToImageMetric_H__ Superclass::MeasureType MeasureType
IncrementalMarginalPDFPointer m_MovingIncrementalMarginalPDFRight
FixedImageType::OffsetValueType OffsetValueType
double m_MovingImageNormalizedMin
Superclass::FixedImageLimiterType FixedImageLimiterType
JointPDFDerivativesType::IndexType JointPDFDerivativesIndexType
JointPDFDerivativesType::SizeType JointPDFDerivativesSizeType
virtual void InitializeKernels(void)
Superclass::ThreaderType ThreaderType
virtual void GetValueAndFiniteDifferenceDerivative(const ParametersType &, MeasureType &, DerivativeType &) const
Superclass::MovingImageDerivativeScalesType MovingImageDerivativeScalesType
ParzenWindowHistogramImageToImageMetric Self
virtual void ComputeIncrementalMarginalPDFs(const JointPDFDerivativesType *incrementalPDF, IncrementalMarginalPDFType *fixedIncrementalMarginalPDF, IncrementalMarginalPDFType *movingIncrementalMarginalPDF) const
bool m_UseExplicitPDFDerivatives
JointPDFType::Pointer JointPDFPointer
Superclass::InputPointType InputPointType
double m_MovingParzenTermToIndexOffset
Superclass::FixedImageType FixedImageType
virtual void NormalizeJointPDFDerivatives(JointPDFDerivativesType *pdf, const double &factor) const
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
void EvaluateParzenValues(double parzenWindowTerm, OffsetValueType parzenWindowIndex, const KernelFunctionType *kernel, ParzenValueContainerType &parzenValues) const
Superclass::InterpolatorType InterpolatorType
Superclass::TransformParametersType TransformParametersType
Superclass::GradientImageType GradientImageType
SizeValueType st_NumberOfPixelsCounted
Superclass::MovingImageType MovingImageType
Superclass::FixedImageRegionType FixedImageRegionType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
Superclass::OutputPointType OutputPointType
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
Superclass::MovingImageMaskType MovingImageMaskType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientPixelType GradientPixelType
Superclass::GradientPixelType GradientPixelType
JointPDFDerivativesPointer m_JointPDFDerivatives
IncrementalMarginalPDFPointer m_MovingIncrementalMarginalPDFLeft
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Superclass::TransformType TransformType
double m_FixedParzenTermToIndexOffset
Superclass::MovingImageConstPointer MovingImageConstPointer
JointPDFType::RegionType JointPDFRegionType
Superclass::FixedImageRegionType FixedImageRegionType
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedParzenWindowHistogramGetValueAndDerivativePerThreadStruct, AlignedParzenWindowHistogramGetValueAndDerivativePerThreadStruct)
void operator=(const Self &)
JointPDFDerivativesType::RegionType JointPDFDerivativesRegionType
ParzenWindowHistogramImageToImageMetric()
KernelFunctionType::Pointer KernelFunctionPointer
void ThreadedComputePDFs(ThreadIdType threadId)
Superclass::InputPointType InputPointType
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
JointPDFDerivativesPointer m_IncrementalJointPDFLeft
double m_FixedImageBinSize
MovingImageType::IndexType MovingImageIndexType
SmartPointer< Self > Pointer
Superclass::OutputPointType OutputPointType
itk::MultiThreader ThreaderType
void LaunchComputePDFsThreaderCallback(void) const
virtual void NormalizeJointPDF(JointPDFType *pdf, const double &factor) const
Superclass::FixedImageMaskPointer FixedImageMaskPointer
InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
TransformType::InputPointType FixedImagePointType
Superclass::TransformJacobianType TransformJacobianType
bool m_UseFiniteDifferenceDerivative
KernelFunctionPointer m_MovingKernel
Superclass::ParametersType ParametersType
Superclass::RealType RealType
Superclass::MovingImageLimiterOutputType MovingImageLimiterOutputType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
ImageSamplerBase< FixedImageType > ImageSamplerType
virtual void ComputePDFsSingleThreaded(const ParametersType ¶meters) const
IncrementalMarginalPDFType::Pointer IncrementalMarginalPDFPointer
IncrementalMarginalPDFPointer m_FixedIncrementalMarginalPDFLeft
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
virtual void ComputePDFsAndIncrementalPDFs(const ParametersType ¶meters) const
Superclass::ParametersType ParametersType
Superclass::ImageSamplerType ImageSamplerType
Superclass::FixedImageLimiterOutputType FixedImageLimiterOutputType
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
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
Superclass::InterpolatorPointer InterpolatorPointer
Superclass::InterpolatorPointer InterpolatorPointer
FixedImageType::IndexType FixedImageIndexType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::DerivativeValueType DerivativeValueType
Superclass::FixedImageConstPointer FixedImageConstPointer
DerivativeType m_PerturbedAlphaRight
virtual void GetValueAndAnalyticDerivative(const ParametersType &, MeasureType &, DerivativeType &) const
unsigned long m_NumberOfMovingHistogramBins
void AfterThreadedComputePDFs(void) const
Superclass::MovingImageMaskPointer MovingImageMaskPointer
double m_FiniteDifferencePerturbation
virtual void InitializeThreadingParameters(void) const
KernelFunctionPointer m_DerivativeMovingKernel
FixedImageIndexType::IndexValueType FixedImageIndexValueType
SmartPointer< const Self > ConstPointer
TransformType::OutputPointType MovingImagePointType
Superclass::FixedImageType FixedImageType
Superclass::ImageSamplerPointer ImageSamplerPointer
std::vector< JointPDFPointer > m_ThreaderJointPDFs
Superclass::MovingImageMaskType MovingImageMaskType
JointPDFType::IndexType JointPDFIndexType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
unsigned int m_MovingKernelBSplineOrder
JointPDFDerivativesType::Pointer JointPDFDerivativesPointer
Superclass::GradientImageType GradientImageType
virtual void ComputePDFs(const ParametersType ¶meters) const
Superclass::TransformPointer TransformPointer
ParzenWindowHistogramMultiThreaderParameterType m_ParzenWindowHistogramThreaderParameters
A base class for image metrics based on a joint histogram computed using Parzen Windowing.
void PrintSelf(std::ostream &os, Indent indent) const
void UpdateJointPDFDerivatives(const JointPDFIndexType &pdfIndex, double factor, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji) const
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, ParzenWindowHistogramGetValueAndDerivativePerThreadStruct, PaddedParzenWindowHistogramGetValueAndDerivativePerThreadStruct)
DerivativeType m_PerturbedAlphaLeft
double m_MovingImageBinSize
Superclass::GradientImagePointer GradientImagePointer
void GetValueAndDerivative(const ParametersType ¶meters, MeasureType &value, DerivativeType &derivative) const
void GetDerivative(const ParametersType ¶meters, DerivativeType &Derivative) const
Superclass::GradientImageFilterType GradientImageFilterType
ImageSamplerType::Pointer ImageSamplerPointer
MovingImageType::RegionType MovingImageRegionType
Superclass::MeasureType MeasureType
Superclass::InterpolatorType InterpolatorType
Superclass::FixedImagePixelType FixedImagePixelType
Superclass::TransformJacobianType TransformJacobianType
static ITK_THREAD_RETURN_TYPE ComputePDFsThreaderCallback(void *arg)
IncrementalMarginalPDFPointer m_FixedIncrementalMarginalPDFRight
IncrementalMarginalPDFType::RegionType IncrementalMarginalPDFRegionType
JointPDFDerivativesPointer m_IncrementalJointPDFRight
JointPDFPointer m_JointPDF
virtual void UpdateJointPDFAndDerivatives(const RealType &fixedImageValue, const RealType &movingImageValue, const DerivativeType *imageJacobian, const NonZeroJacobianIndicesType *nzji, JointPDFType *jointPDF) const
unsigned int m_FixedKernelBSplineOrder
Superclass::MovingImageType MovingImageType
virtual void ComputeMarginalPDF(const JointPDFType *jointPDF, MarginalPDFType &marginalPDF, const unsigned int &direction) const
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImageRegionType MovingImageRegionType
Superclass::MovingImagePixelType MovingImagePixelType
Superclass::MovingImageLimiterType MovingImageLimiterType
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
JointPDFPointer st_JointPDF
Superclass::RealType RealType
JointPDFType::SizeType JointPDFSizeType
DerivativeType::ValueType DerivativeValueType
IncrementalMarginalPDFType::IndexType IncrementalMarginalPDFIndexType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
Superclass::MovingImagePixelType MovingImagePixelType
Superclass::DerivativeType DerivativeType
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
ThreaderType::ThreadInfoStruct ThreadInfoType
double m_FixedImageNormalizedMin
FixedImageType::PixelType FixedImagePixelType
virtual void ComputePDFsAndPDFDerivatives(const ParametersType ¶meters) const
Superclass::TransformType TransformType
Superclass::ImageSampleContainerType ImageSampleContainerType
MarginalPDFType m_FixedImageMarginalPDF
Superclass::ThreadInfoType ThreadInfoType
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Superclass::FixedImageMaskType FixedImageMaskType
KernelFunctionPointer m_FixedKernel
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::TransformPointer TransformPointer
ThreadIdType m_ParzenWindowHistogramGetValueAndDerivativePerThreadVariablesSize
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
IncrementalMarginalPDFType::SizeType IncrementalMarginalPDFSizeType
Superclass::FixedImageConstPointer FixedImageConstPointer
AlignedParzenWindowHistogramGetValueAndDerivativePerThreadStruct * m_ParzenWindowHistogramGetValueAndDerivativePerThreadVariables
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::DerivativeType DerivativeType
MarginalPDFType m_MovingImageMarginalPDF
unsigned long m_NumberOfFixedHistogramBins
AdvancedImageToImageMetric< TFixedImage, TMovingImage > Superclass
virtual void InitializeHistograms(void)
Superclass::GradientImageFilterPointer GradientImageFilterPointer
JointPDFRegionType m_JointPDFWindow
Superclass::GradientImagePointer GradientImagePointer