ITK  6.0.0
Insight Toolkit
itkGPUFiniteDifferenceFunction.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkGPUFiniteDifferenceFunction_h
19#define itkGPUFiniteDifferenceFunction_h
20
22#include "itkLightObject.h"
24#include "itkVector.h"
25
26#include "itkGPUDataManager.h"
27#include "itkGPUKernelManager.h"
28
29namespace itk
30{
46template <typename TImageType>
47class ITK_TEMPLATE_EXPORT GPUFiniteDifferenceFunction : public FiniteDifferenceFunction<TImageType>
48{
49public:
50 ITK_DISALLOW_COPY_AND_MOVE(GPUFiniteDifferenceFunction);
51
58
60 itkOverrideGetNameOfClassMacro(GPUFiniteDifferenceFunction);
61
63 using typename Superclass::ImageType;
64 using typename Superclass::PixelType;
65 using typename Superclass::PixelRealType;
66
68 static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
69
71 using typename Superclass::TimeStepType;
72
75 using typename Superclass::DefaultBoundaryConditionType;
76
78 using typename Superclass::RadiusType;
79
81 using typename Superclass::NeighborhoodType;
82
85 using typename Superclass::FloatOffsetType;
86
87#if !defined(ITK_WRAPPING_PARSER)
90 ComputeUpdate(const NeighborhoodType & itkNotUsed(neighborhood),
91 void * itkNotUsed(globalData),
92 const FloatOffsetType & itkNotUsed(offset) = FloatOffsetType(0.0)) override
93 {
94 PixelType pix{};
95 return pix;
96 }
97#endif
101 virtual void
102 GPUComputeUpdate(const typename TImageType::Pointer output, typename TImageType::Pointer update, void * gd) = 0;
103
106 virtual void
107 GPUAllocateMetricData(unsigned int itkNotUsed(numPixels))
108 {}
109
112 virtual void
114 {}
115
116protected:
118 ~GPUFiniteDifferenceFunction() override = default;
119
121 typename GPUKernelManager::Pointer m_GPUKernelManager{};
122
124 int m_ComputeUpdateGPUKernelHandle{};
125};
126} // end namespace itk
127
128#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ImageType::PixelType PixelType
~GPUFiniteDifferenceFunction() override=default
PixelType ComputeUpdate(const NeighborhoodType &, void *, const FloatOffsetType &=FloatOffsetType(0.0)) override
virtual void GPUComputeUpdate(const typename TImageType::Pointer output, typename TImageType::Pointer update, void *gd)=0
static Pointer New()
Light weight base class for most itk classes.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
BinaryGeneratorImageFilter< TInputImage1, TInputImage2, TOutputImage > Superclass
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....