18 #ifndef itkGPUDemonsRegistrationFunction_h
19 #define itkGPUDemonsRegistrationFunction_h
57 template <
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;
127 itkGetOpenCLSourceFromKernelMacro(GPUDemonsRegistrationFunctionKernel);
133 m_MovingImageInterpolator = ptr;
140 return m_MovingImageInterpolator;
157 global->m_SumOfSquaredDifference = 0.0;
158 global->m_NumberOfPixelsProcessed = 0L;
159 global->m_SumOfSquaredChange = 0;
168 ReleaseGlobalDataPointer(
void * GlobalData)
const override;
173 GPUAllocateMetricData(
unsigned int numPixels)
override;
177 GPUReleaseMetricData()
override;
181 InitializeIteration()
override;
188 ComputeUpdate(
const NeighborhoodType & neighborhood,
190 const FloatOffsetType & offset = FloatOffsetType(0.0))
override;
194 GPUComputeUpdate(
const DisplacementFieldTypePointer output, DisplacementFieldTypePointer update,
void * gd)
override;
220 m_UseMovingImageGradient = flag;
225 return m_UseMovingImageGradient;
234 SetIntensityDifferenceThreshold(
double);
237 GetIntensityDifferenceThreshold()
const;
244 PrintSelf(std::ostream & os,
Indent indent)
const override;
259 int m_ComputeUpdateGPUKernelHandle{};
266 double m_Normalizer{};
273 bool m_UseMovingImageGradient{};
279 TimeStepType m_TimeStep{};
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"