Loading...
Searching...
No Matches
itkParzenWindowMutualInformationImageToImageMetric.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkParzenWindowMutualInformationImageToImageMetric_h
#define itkParzenWindowMutualInformationImageToImageMetric_h
#include "itkParzenWindowHistogramImageToImageMetric.h"
#include "itkArray2D.h"
namespace itk
{
template <class TFixedImage, class TMovingImage>
class ITK_TEMPLATE_EXPORT ParzenWindowMutualInformationImageToImageMetric
: public ParzenWindowHistogramImageToImageMetric<TFixedImage, TMovingImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ParzenWindowMutualInformationImageToImageMetric);
using Self = ParzenWindowMutualInformationImageToImageMetric;
using Superclass = ParzenWindowHistogramImageToImageMetric<TFixedImage, TMovingImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ParzenWindowMutualInformationImageToImageMetric, ParzenWindowHistogramImageToImageMetric);
using typename Superclass::CoordinateRepresentationType;
using typename Superclass::MovingImageType;
using typename Superclass::MovingImagePixelType;
using typename Superclass::MovingImageConstPointer;
using typename Superclass::FixedImageType;
using typename Superclass::FixedImageConstPointer;
using typename Superclass::FixedImageRegionType;
using typename Superclass::TransformType;
using typename Superclass::TransformPointer;
using typename Superclass::InputPointType;
using typename Superclass::OutputPointType;
using typename Superclass::TransformParametersType;
using typename Superclass::TransformJacobianType;
using typename Superclass::NumberOfParametersType;
using typename Superclass::InterpolatorType;
using typename Superclass::InterpolatorPointer;
using typename Superclass::RealType;
using typename Superclass::GradientPixelType;
using typename Superclass::GradientImageType;
using typename Superclass::GradientImagePointer;
using typename Superclass::FixedImageMaskType;
using typename Superclass::FixedImageMaskPointer;
using typename Superclass::MovingImageMaskType;
using typename Superclass::MovingImageMaskPointer;
using typename Superclass::MeasureType;
using typename Superclass::DerivativeType;
using typename Superclass::DerivativeValueType;
using typename Superclass::ParametersType;
using typename Superclass::FixedImagePixelType;
using typename Superclass::MovingImageRegionType;
using typename Superclass::ImageSamplerType;
using typename Superclass::ImageSamplerPointer;
using typename Superclass::ImageSampleContainerType;
using typename Superclass::ImageSampleContainerPointer;
using typename Superclass::FixedImageLimiterType;
using typename Superclass::MovingImageLimiterType;
using typename Superclass::FixedImageLimiterOutputType;
using typename Superclass::MovingImageLimiterOutputType;
using typename Superclass::MovingImageDerivativeScalesType;
using typename Superclass::ThreadInfoType;
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension);
MeasureType
GetValue(const ParametersType & parameters) const override;
itkGetConstMacro(UseJacobianPreconditioning, bool);
itkSetMacro(UseJacobianPreconditioning, bool);
protected:
ParzenWindowMutualInformationImageToImageMetric();
~ParzenWindowMutualInformationImageToImageMetric() override = default;
using typename Superclass::FixedImageIndexType;
using typename Superclass::FixedImageIndexValueType;
using typename Superclass::MovingImageIndexType;
using typename Superclass::FixedImagePointType;
using typename Superclass::MovingImagePointType;
using typename Superclass::MovingImageContinuousIndexType;
using typename Superclass::BSplineInterpolatorType;
using typename Superclass::MovingImageDerivativeType;
using typename Superclass::PDFValueType;
using typename Superclass::PDFDerivativeValueType;
using typename Superclass::MarginalPDFType;
using typename Superclass::JointPDFType;
using typename Superclass::JointPDFDerivativesType;
using typename Superclass::IncrementalMarginalPDFType;
using typename Superclass::JointPDFIndexType;
using typename Superclass::JointPDFRegionType;
using typename Superclass::JointPDFSizeType;
using typename Superclass::JointPDFDerivativesIndexType;
using typename Superclass::JointPDFDerivativesRegionType;
using typename Superclass::JointPDFDerivativesSizeType;
using typename Superclass::ParzenValueContainerType;
using typename Superclass::KernelFunctionType;
using typename Superclass::NonZeroJacobianIndicesType;
void
GetValueAndAnalyticDerivative(const ParametersType & parameters,
MeasureType & value,
DerivativeType & derivative) const override;
virtual void
GetValueAndAnalyticDerivativeLowMemory(const ParametersType & parameters,
MeasureType & value,
DerivativeType & derivative) const;
void
GetValueAndFiniteDifferenceDerivative(const ParametersType & parameters,
MeasureType & value,
DerivativeType & derivative) const override;
virtual void
ComputeJacobianPreconditioner(const TransformJacobianType & jac,
const NonZeroJacobianIndicesType & nzji,
DerivativeType & preconditioner,
DerivativeType & divisor) const;
void
InitializeHistograms() override;
struct ParzenWindowMutualInformationMultiThreaderParameterType
{
Self * m_Metric;
};
ParzenWindowMutualInformationMultiThreaderParameterType m_ParzenWindowMutualInformationThreaderParameters{};
void
ThreadedComputeDerivativeLowMemory(ThreadIdType threadId);
void
AfterThreadedComputeDerivativeLowMemory(DerivativeType & derivative) const;
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
ComputeDerivativeLowMemoryThreaderCallback(void * arg);
void
LaunchComputeDerivativeLowMemoryThreaderCallback() const;
private:
using PRatioType = double;
using PRatioArrayType = vnl_matrix<PRatioType>;
mutable PRatioArrayType m_PRatioArray{};
bool m_UseJacobianPreconditioning{ false };
void
ComputeDerivativeLowMemorySingleThreaded(DerivativeType & derivative) const;
void
ComputeDerivativeLowMemory(DerivativeType & derivative) const;
void
UpdateDerivativeLowMemory(const RealType fixedImageValue,
const RealType movingImageValue,
const DerivativeType & imageJacobian,
const NonZeroJacobianIndicesType & nzji,
DerivativeType & derivative) const;
void
ComputeValueAndPRatioArray(double & MI) const;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkParzenWindowMutualInformationImageToImageMetric.hxx"
#endif
#endif // end #ifndef itkParzenWindowMutualInformationImageToImageMetric_h
double
itk::AdvancedImageToImageMetric::NumberOfParametersType
typename AdvancedTransformType::NumberOfParametersType NumberOfParametersType
Definition itkAdvancedImageToImageMetric.h:158
itk::ParzenWindowHistogramImageToImageMetric::ParzenValueContainerType
Array< PDFValueType > ParzenValueContainerType
Definition itkParzenWindowHistogramImageToImageMetric.h:259
itk::ParzenWindowHistogramImageToImageMetric::JointPDFSizeType
JointPDFType::SizeType JointPDFSizeType
Definition itkParzenWindowHistogramImageToImageMetric.h:252
itk::ParzenWindowHistogramImageToImageMetric::JointPDFDerivativesIndexType
JointPDFDerivativesType::IndexType JointPDFDerivativesIndexType
Definition itkParzenWindowHistogramImageToImageMetric.h:253
itk::ParzenWindowHistogramImageToImageMetric::MovingImagePointType
typename TransformType::OutputPointType MovingImagePointType
Definition itkAdvancedImageToImageMetric.h:338
itk::ParzenWindowHistogramImageToImageMetric::ImageSampleContainerPointer
typename ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
Definition itkAdvancedImageToImageMetric.h:145
itk::ParzenWindowHistogramImageToImageMetric::ParzenWindowHistogramImageToImageMetric
ParzenWindowHistogramImageToImageMetric()
itk::ParzenWindowHistogramImageToImageMetric::MovingImageRegionType
typename MovingImageType::RegionType MovingImageRegionType
Definition itkAdvancedImageToImageMetric.h:138
itk::ParzenWindowHistogramImageToImageMetric::NonZeroJacobianIndicesType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Definition itkAdvancedImageToImageMetric.h:356
itk::ParzenWindowHistogramImageToImageMetric::MovingImageDerivativeScalesType
FixedArray< double, Self::MovingImageDimension > MovingImageDerivativeScalesType
Definition itkAdvancedImageToImageMetric.h:139
itk::ParzenWindowHistogramImageToImageMetric::FixedImagePixelType
typename FixedImageType::PixelType FixedImagePixelType
Definition itkAdvancedImageToImageMetric.h:137
itk::ParzenWindowHistogramImageToImageMetric::DerivativeValueType
typename DerivativeType::ValueType DerivativeValueType
Definition itkAdvancedImageToImageMetric.h:133
itk::ParzenWindowHistogramImageToImageMetric::IncrementalMarginalPDFType
Image< PDFValueType, 2 > IncrementalMarginalPDFType
Definition itkParzenWindowHistogramImageToImageMetric.h:248
itk::ParzenWindowHistogramImageToImageMetric::PDFDerivativeValueType
float PDFDerivativeValueType
Definition itkParzenWindowHistogramImageToImageMetric.h:242
itk::ParzenWindowHistogramImageToImageMetric::FixedImageIndexValueType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
Definition itkAdvancedImageToImageMetric.h:335
itk::ParzenWindowHistogramImageToImageMetric::MovingImageIndexType
typename MovingImageType::IndexType MovingImageIndexType
Definition itkAdvancedImageToImageMetric.h:336
itk::ParzenWindowHistogramImageToImageMetric::ImageSampleContainerType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
Definition itkAdvancedImageToImageMetric.h:144
itk::ParzenWindowHistogramImageToImageMetric::FixedImageMaskType
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
Definition itkAdvancedImageToImageMetric.h:124
itk::ParzenWindowHistogramImageToImageMetric::JointPDFDerivativesSizeType
JointPDFDerivativesType::SizeType JointPDFDerivativesSizeType
Definition itkParzenWindowHistogramImageToImageMetric.h:255
itk::ParzenWindowHistogramImageToImageMetric::JointPDFDerivativesType
Image< PDFDerivativeValueType, 3 > JointPDFDerivativesType
Definition itkParzenWindowHistogramImageToImageMetric.h:246
itk::ParzenWindowHistogramImageToImageMetric::FixedImageIndexType
typename FixedImageType::IndexType FixedImageIndexType
Definition itkAdvancedImageToImageMetric.h:334
itk::ParzenWindowHistogramImageToImageMetric::MovingImageMaskPointer
SmartPointer< MovingImageMaskType > MovingImageMaskPointer
Definition itkAdvancedImageToImageMetric.h:128
itk::ParzenWindowHistogramImageToImageMetric::FixedImageLimiterType
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
Definition itkAdvancedImageToImageMetric.h:148
itk::ParzenWindowHistogramImageToImageMetric::ImageSamplerType
ImageSamplerBase< FixedImageType > ImageSamplerType
Definition itkAdvancedImageToImageMetric.h:142
itk::ParzenWindowHistogramImageToImageMetric::ThreadInfoType
MultiThreaderBase::WorkUnitInfo ThreadInfoType
Definition itkAdvancedImageToImageMetric.h:170
itk::ParzenWindowHistogramImageToImageMetric::MovingImageDerivativeType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
Definition itkAdvancedImageToImageMetric.h:353
itk::ParzenWindowHistogramImageToImageMetric::JointPDFType
Image< PDFValueType, 2 > JointPDFType
Definition itkParzenWindowHistogramImageToImageMetric.h:244
itk::ParzenWindowHistogramImageToImageMetric::PDFValueType
double PDFValueType
Definition itkParzenWindowHistogramImageToImageMetric.h:241
itk::ParzenWindowHistogramImageToImageMetric::JointPDFRegionType
JointPDFType::RegionType JointPDFRegionType
Definition itkParzenWindowHistogramImageToImageMetric.h:251
itk::ParzenWindowHistogramImageToImageMetric::JointPDFIndexType
JointPDFType::IndexType JointPDFIndexType
Definition itkParzenWindowHistogramImageToImageMetric.h:250
itk::ParzenWindowHistogramImageToImageMetric::MovingImageLimiterType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
Definition itkAdvancedImageToImageMetric.h:151
itk::ParzenWindowHistogramImageToImageMetric::MovingImageLimiterOutputType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
Definition itkAdvancedImageToImageMetric.h:153
itk::ParzenWindowHistogramImageToImageMetric::FixedImagePointType
typename TransformType::InputPointType FixedImagePointType
Definition itkAdvancedImageToImageMetric.h:337
itk::ParzenWindowHistogramImageToImageMetric::FixedImageLimiterOutputType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
Definition itkAdvancedImageToImageMetric.h:150
itk::ParzenWindowHistogramImageToImageMetric::FixedImageMaskPointer
SmartPointer< FixedImageMaskType > FixedImageMaskPointer
Definition itkAdvancedImageToImageMetric.h:125
itk::ParzenWindowHistogramImageToImageMetric::BSplineInterpolatorType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
Definition itkAdvancedImageToImageMetric.h:342
itk::ParzenWindowHistogramImageToImageMetric::JointPDFDerivativesRegionType
JointPDFDerivativesType::RegionType JointPDFDerivativesRegionType
Definition itkParzenWindowHistogramImageToImageMetric.h:254
itk::ParzenWindowHistogramImageToImageMetric::MarginalPDFType
Array< PDFValueType > MarginalPDFType
Definition itkParzenWindowHistogramImageToImageMetric.h:243
itk::ParzenWindowHistogramImageToImageMetric::ImageSamplerPointer
typename ImageSamplerType::Pointer ImageSamplerPointer
Definition itkAdvancedImageToImageMetric.h:143
itk::ParzenWindowHistogramImageToImageMetric::MovingImageContinuousIndexType
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
Definition itkAdvancedImageToImageMetric.h:339
itk::ParzenWindowHistogramImageToImageMetric::KernelFunctionType
KernelFunctionBase2< PDFValueType > KernelFunctionType
Definition itkParzenWindowHistogramImageToImageMetric.h:262
itk::ParzenWindowHistogramImageToImageMetric::MovingImageMaskType
ImageMaskSpatialObject< Self::MovingImageDimension > MovingImageMaskType
Definition itkAdvancedImageToImageMetric.h:127
itk::ParzenWindowMutualInformationImageToImageMetric::~ParzenWindowMutualInformationImageToImageMetric
~ParzenWindowMutualInformationImageToImageMetric() override=default
itk::ParzenWindowMutualInformationImageToImageMetric::ComputeJacobianPreconditioner
virtual void ComputeJacobianPreconditioner(const TransformJacobianType &jac, const NonZeroJacobianIndicesType &nzji, DerivativeType &preconditioner, DerivativeType &divisor) const
itk::ParzenWindowMutualInformationImageToImageMetric::ComputeDerivativeLowMemorySingleThreaded
void ComputeDerivativeLowMemorySingleThreaded(DerivativeType &derivative) const
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::PRatioType
double PRatioType
Definition itkParzenWindowMutualInformationImageToImageMetric.h:255
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::NonZeroJacobianIndicesType
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
itk::ParzenWindowMutualInformationImageToImageMetric::GetValueAndAnalyticDerivative
void GetValueAndAnalyticDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkParzenWindowMutualInformationImageToImageMetric.h:85
itk::ParzenWindowMutualInformationImageToImageMetric::ParzenWindowMutualInformationImageToImageMetric
ParzenWindowMutualInformationImageToImageMetric()
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Pointer
SmartPointer< Self > Pointer
Definition itkParzenWindowMutualInformationImageToImageMetric.h:84
itk::ParzenWindowMutualInformationImageToImageMetric::LaunchComputeDerivativeLowMemoryThreaderCallback
void LaunchComputeDerivativeLowMemoryThreaderCallback() const
itk::ParzenWindowMutualInformationImageToImageMetric::itkStaticConstMacro
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
itk::ParzenWindowMutualInformationImageToImageMetric::InitializeHistograms
void InitializeHistograms() override
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::PRatioArrayType
vnl_matrix< PRatioType > PRatioArrayType
Definition itkParzenWindowMutualInformationImageToImageMetric.h:256
itk::ParzenWindowMutualInformationImageToImageMetric::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(ParzenWindowMutualInformationImageToImageMetric)
itk::ParzenWindowMutualInformationImageToImageMetric::ThreadedComputeDerivativeLowMemory
void ThreadedComputeDerivativeLowMemory(ThreadIdType threadId)
itk::ParzenWindowMutualInformationImageToImageMetric::GetValueAndFiniteDifferenceDerivative
void GetValueAndFiniteDifferenceDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
itk::ParzenWindowMutualInformationImageToImageMetric::ComputeValueAndPRatioArray
void ComputeValueAndPRatioArray(double &MI) const
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_PRatioArray
PRatioArrayType m_PRatioArray
Definition itkParzenWindowMutualInformationImageToImageMetric.h:257
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_UseJacobianPreconditioning
bool m_UseJacobianPreconditioning
Definition itkParzenWindowMutualInformationImageToImageMetric.h:260
itk::ParzenWindowMutualInformationImageToImageMetric::UpdateDerivativeLowMemory
void UpdateDerivativeLowMemory(const RealType fixedImageValue, const RealType movingImageValue, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &derivative) const
itk::ParzenWindowMutualInformationImageToImageMetric::ComputeDerivativeLowMemory
void ComputeDerivativeLowMemory(DerivativeType &derivative) const
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Superclass
ParzenWindowHistogramImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType > Superclass
Definition itkParzenWindowMutualInformationImageToImageMetric.h:83
itk::ParzenWindowMutualInformationImageToImageMetric::GetValue
MeasureType GetValue(const ParametersType &parameters) const override
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::m_ParzenWindowMutualInformationThreaderParameters
ParzenWindowMutualInformationMultiThreaderParameterType m_ParzenWindowMutualInformationThreaderParameters
Definition itkParzenWindowMutualInformationImageToImageMetric.h:235
itk::ParzenWindowMutualInformationImageToImageMetric< typename MetricBase< TElastix >::FixedImageType, typename MetricBase< TElastix >::MovingImageType >::Self
ParzenWindowMutualInformationImageToImageMetric Self
Definition itkParzenWindowMutualInformationImageToImageMetric.h:82
itk::ParzenWindowMutualInformationImageToImageMetric::itkStaticConstMacro
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
itk::ParzenWindowMutualInformationImageToImageMetric::GetValueAndAnalyticDerivativeLowMemory
virtual void GetValueAndAnalyticDerivativeLowMemory(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
itk::ParzenWindowMutualInformationImageToImageMetric::ComputeDerivativeLowMemoryThreaderCallback
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ComputeDerivativeLowMemoryThreaderCallback(void *arg)
itk::ParzenWindowMutualInformationImageToImageMetric::AfterThreadedComputeDerivativeLowMemory
void AfterThreadedComputeDerivativeLowMemory(DerivativeType &derivative) const
itkParzenWindowHistogramImageToImageMetric.h
itk
Definition itkAdvancedImageToImageMetric.h:43
itk::ParzenWindowMutualInformationImageToImageMetric::ParzenWindowMutualInformationMultiThreaderParameterType
Definition itkParzenWindowMutualInformationImageToImageMetric.h:232
itk::ParzenWindowMutualInformationImageToImageMetric::ParzenWindowMutualInformationMultiThreaderParameterType::m_Metric
Self * m_Metric
Definition itkParzenWindowMutualInformationImageToImageMetric.h:233

Generated on 1768596610 for elastix by 1.15.0 |