18#ifndef itkAdvancedKappaStatisticImageToImageMetric_h
19#define itkAdvancedKappaStatisticImageToImageMetric_h
56template <
class TFixedImage,
class TMovingImage>
76 using typename Superclass::CoordinateRepresentationType;
77 using typename Superclass::MovingImageType;
78 using typename Superclass::MovingImagePixelType;
79 using typename Superclass::MovingImageConstPointer;
80 using typename Superclass::FixedImageType;
81 using typename Superclass::FixedImageConstPointer;
82 using typename Superclass::FixedImageRegionType;
83 using typename Superclass::TransformType;
84 using typename Superclass::TransformPointer;
85 using typename Superclass::InputPointType;
86 using typename Superclass::OutputPointType;
87 using typename Superclass::TransformParametersType;
88 using typename Superclass::TransformJacobianType;
90 using typename Superclass::InterpolatorType;
91 using typename Superclass::InterpolatorPointer;
92 using typename Superclass::RealType;
93 using typename Superclass::GradientPixelType;
94 using typename Superclass::GradientImageType;
95 using typename Superclass::GradientImagePointer;
96 using typename Superclass::GradientImageFilterType;
97 using typename Superclass::GradientImageFilterPointer;
98 using typename Superclass::FixedImageMaskType;
99 using typename Superclass::FixedImageMaskPointer;
100 using typename Superclass::MovingImageMaskType;
101 using typename Superclass::MovingImageMaskPointer;
102 using typename Superclass::MeasureType;
103 using typename Superclass::DerivativeType;
105 using typename Superclass::ParametersType;
128 GetValue(
const TransformParametersType & parameters)
const override;
132 GetDerivative(
const TransformParametersType & parameters, DerivativeType & derivative)
const override;
138 DerivativeType & Derivative)
const;
143 DerivativeType & Derivative)
const override;
150 itkSetMacro(ForegroundValue, RealType);
151 itkGetConstReferenceMacro(ForegroundValue, RealType);
157 itkSetMacro(UseForegroundValue,
bool);
164 itkSetMacro(Complement,
bool);
165 itkGetConstReferenceMacro(Complement,
bool);
166 itkBooleanMacro(Complement);
169 itkSetMacro(Epsilon, RealType);
170 itkGetConstReferenceMacro(Epsilon, RealType);
178 PrintSelf(std::ostream & os, Indent indent)
const override;
199 const RealType & movingImageValue,
200 std::size_t & fixedForegroundArea,
201 std::size_t & movingForegroundArea,
202 std::size_t & intersection,
203 const DerivativeType & imageJacobian,
205 DerivativeType & sum1,
206 DerivativeType & sum2)
const;
224 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
257 PaddedKappaGetValueAndDerivativePerThreadStruct);
259 PaddedKappaGetValueAndDerivativePerThreadStruct,
260 AlignedKappaGetValueAndDerivativePerThreadStruct);
266#ifndef ITK_MANUAL_INSTANTIATION
267# include "itkAdvancedKappaStatisticImageToImageMetric.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
GradientImageFilter< MovingImageType, RealType, RealType > CentralDifferenceGradientFilterType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
typename MovingImageType::IndexType MovingImageIndexType
typename ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
BSplineInterpolateImageFunction< MovingImageType, CoordinateRepresentationType, double > BSplineInterpolatorType
typename ThreaderType::WorkUnitInfo ThreadInfoType
itk::PlatformMultiThreader ThreaderType
typename FixedImageType::IndexType FixedImageIndexType
typename BSplineInterpolatorType::CovariantVectorType MovingImageDerivativeType
typename MovingImageLimiterType::OutputType MovingImageLimiterOutputType
typename TransformType::InputPointType FixedImagePointType
typename FixedImageLimiterType::OutputType FixedImageLimiterOutputType
typename ImageSamplerType::Pointer ImageSamplerPointer
typename InterpolatorType::ContinuousIndexType MovingImageContinuousIndexType
typename AdvancedTransformType::NumberOfParametersType NumberOfParametersType
Computes similarity between two objects to be registered.
void UpdateValueAndDerivativeTerms(const RealType &fixedImageValue, const RealType &movingImageValue, std::vcl_size_t &fixedForegroundArea, std::vcl_size_t &movingForegroundArea, std::vcl_size_t &intersection, const DerivativeType &imageJacobian, const NonZeroJacobianIndicesType &nzji, DerivativeType &sum1, DerivativeType &sum2) const
bool m_UseForegroundValue
typename AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
RealType m_ForegroundValue
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, KappaGetValueAndDerivativePerThreadStruct, PaddedKappaGetValueAndDerivativePerThreadStruct)
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
typename DerivativeType::ValueType DerivativeValueType
void AfterThreadedGetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const override
void PrintSelf(std::ostream &os, Indent indent) const override
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION AccumulateDerivativesThreaderCallback(void *arg)
ITK_DISALLOW_COPY_AND_MOVE(AdvancedKappaStatisticImageToImageMetric)
void ComputeGradient() override
SmartPointer< const Self > ConstPointer
AdvancedKappaStatisticImageToImageMetric()
void GetDerivative(const TransformParametersType ¶meters, DerivativeType &derivative) const override
void ThreadedGetValueAndDerivative(ThreadIdType threadID) override
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
virtual void GetValueAndDerivativeSingleThreaded(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const
void InitializeThreadingParameters() const override
void GetValueAndDerivative(const TransformParametersType ¶meters, MeasureType &Value, DerivativeType &Derivative) const override
~AdvancedKappaStatisticImageToImageMetric() override=default
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedKappaGetValueAndDerivativePerThreadStruct, AlignedKappaGetValueAndDerivativePerThreadStruct)
std::vector< AlignedKappaGetValueAndDerivativePerThreadStruct > m_KappaGetValueAndDerivativePerThreadVariables
MeasureType GetValue(const TransformParametersType ¶meters) const override
This class is a base class for any image sampler.
Base class for all ITK limiter function objects.
SizeValueType st_NumberOfPixelsCounted
DerivativeType st_DerivativeSum1
SizeValueType st_AreaIntersection
DerivativeType st_DerivativeSum2
AdvancedKappaStatisticImageToImageMetric * st_Metric
MeasureType st_Coefficient1
MeasureType st_Coefficient2
DerivativeValueType * st_DerivativePointer