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;
123 itkGetOpenCLSourceFromKernelMacro(GPUDemonsRegistrationFunctionKernel);
129 m_MovingImageInterpolator = ptr;
136 return m_MovingImageInterpolator;
153 global->m_SumOfSquaredDifference = 0.0;
154 global->m_NumberOfPixelsProcessed = 0L;
155 global->m_SumOfSquaredChange = 0;
164 ReleaseGlobalDataPointer(
void * GlobalData)
const override;
169 GPUAllocateMetricData(
unsigned int numPixels)
override;
173 GPUReleaseMetricData()
override;
177 InitializeIteration()
override;
184 ComputeUpdate(
const NeighborhoodType & neighborhood,
186 const FloatOffsetType & offset = FloatOffsetType(0.0))
override;
190 GPUComputeUpdate(
const DisplacementFieldTypePointer output, DisplacementFieldTypePointer update,
void * gd)
override;
216 m_UseMovingImageGradient = flag;
221 return m_UseMovingImageGradient;
230 SetIntensityDifferenceThreshold(
double);
233 GetIntensityDifferenceThreshold()
const;
240 PrintSelf(std::ostream & os,
Indent indent)
const override;
255 int m_ComputeUpdateGPUKernelHandle{};
262 double m_Normalizer{};
269 bool m_UseMovingImageGradient{};
275 TimeStepType m_TimeStep{};
278 double m_DenominatorThreshold{};
281 double m_IntensityDifferenceThreshold{};
286 mutable double m_Metric{};
287 mutable double m_SumOfSquaredDifference{};
289 mutable double m_RMSChange{};
290 mutable double m_SumOfSquaredChange{};
297 mutable std::mutex m_MetricCalculationMutex{};
301 #ifndef ITK_MANUAL_INSTANTIATION
302 # include "itkGPUDemonsRegistrationFunction.hxx"