18#ifndef itkGPUDemonsRegistrationFunction_h
19#define itkGPUDemonsRegistrationFunction_h
57template <
typename TFixedImage,
typename TMovingImage,
typename TDisplacementField>
77 using typename Superclass::MovingImageType;
78 using typename Superclass::MovingImagePointer;
81 using typename Superclass::FixedImageType;
82 using typename Superclass::FixedImagePointer;
88 using typename Superclass::DisplacementFieldType;
89 using typename Superclass::DisplacementFieldTypePointer;
92 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
103#ifndef ITK_FUTURE_LEGACY_REMOVE
104 using CoordRepType ITK_FUTURE_DEPRECATED(
105 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") =
CoordinateType;
133 m_MovingImageInterpolator = ptr;
140 return m_MovingImageInterpolator;
157 global->m_SumOfSquaredDifference = 0.0;
158 global->m_NumberOfPixelsProcessed = 0L;
159 global->m_SumOfSquaredChange = 0;
220 m_UseMovingImageGradient = flag;
225 return m_UseMovingImageGradient;
259 int m_ComputeUpdateGPUKernelHandle{};
266 double m_Normalizer{};
273 bool m_UseMovingImageGradient{};
282 double m_DenominatorThreshold{};
285 double m_IntensityDifferenceThreshold{};
290 mutable double m_Metric{};
291 mutable double m_SumOfSquaredDifference{};
293 mutable double m_RMSChange{};
294 mutable double m_SumOfSquaredChange{};
301 mutable std::mutex m_MetricCalculationMutex{};
305#ifndef ITK_MANUAL_INSTANTIATION
306# include "itkGPUDemonsRegistrationFunction.hxx"
Calculate the derivative by central differencing.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
A templated class holding a n-Dimensional covariant vector.
typename ImageType::PixelType PixelType
typename ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
SmartPointer< Self > Pointer
void PrintSelf(std::ostream &os, Indent indent) const override
typename FixedImageType::IndexType IndexType
void * GetGlobalDataPointer() const override
virtual bool GetUseMovingImageGradient() const
PixelType ComputeUpdate(const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
typename FixedImageType::SpacingType SpacingType
typename InterpolatorType::Pointer InterpolatorPointer
void InitializeIteration() override
typename InterpolatorType::PointType PointType
virtual double GetRMSChange() const
void GPUAllocateMetricData(unsigned int numPixels) override
InterpolatorType * GetMovingImageInterpolator()
typename MovingImageGradientCalculatorType::Pointer MovingImageGradientCalculatorPointer
void ReleaseGlobalDataPointer(void *GlobalData) const override
void GPUReleaseMetricData() override
typename FixedImageType::SizeType SizeType
itkGetOpenCLSourceFromKernelMacro(GPUDemonsRegistrationFunctionKernel)
void GPUComputeUpdate(const DisplacementFieldTypePointer output, DisplacementFieldTypePointer update, void *gd) override
~GPUDemonsRegistrationFunction() override=default
virtual double GetMetric() const
GPUDemonsRegistrationFunction()
virtual void SetIntensityDifferenceThreshold(double)
virtual double GetIntensityDifferenceThreshold() const
void SetMovingImageInterpolator(InterpolatorType *ptr)
virtual void SetUseMovingImageGradient(bool flag)
typename GradientCalculatorType::Pointer GradientCalculatorPointer
TimeStepType ComputeGlobalTimeStep(void *) const override
Control indentation during Print() invocation.
Base class for all image interpolators.
Light weight base class for most itk classes.
Linearly interpolate an image at specified positions.
A templated class holding a n-Dimensional vector.
SmartPointer< Self > Pointer
ImageBaseType::IndexType IndexType
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
itkGPUKernelClassMacro(GPUImageOpsKernel)
unsigned long SizeValueType
double m_SumOfSquaredChange
double m_SumOfSquaredDifference
SizeValueType m_NumberOfPixelsProcessed