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 
29 namespace itk
30 {
46 template <typename TImageType>
47 class ITK_TEMPLATE_EXPORT GPUFiniteDifferenceFunction : public FiniteDifferenceFunction<TImageType>
48 {
49 public:
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)
88 
89  PixelType
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
98 
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 
116 protected:
118  ~GPUFiniteDifferenceFunction() override = default;
119 
121  typename GPUKernelManager::Pointer m_GPUKernelManager{};
122 
124  int m_ComputeUpdateGPUKernelHandle{};
125 };
126 } // end namespace itk
127 
128 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itkConstNeighborhoodIterator.h
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::GPUFiniteDifferenceFunction::GPUFiniteDifferenceFunction
GPUFiniteDifferenceFunction()
Definition: itkGPUFiniteDifferenceFunction.h:117
itk::SmartPointer< Self >
itkGPUKernelManager.h
itkFiniteDifferenceFunction.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::GPUKernelManager::New
static Pointer New()
itk::GPUFiniteDifferenceFunction::GPUAllocateMetricData
virtual void GPUAllocateMetricData(unsigned int)
Definition: itkGPUFiniteDifferenceFunction.h:107
itk::GPUFiniteDifferenceFunction
Definition: itkGPUFiniteDifferenceFunction.h:47
itk::FiniteDifferenceFunction< TDisplacementField >::PixelType
typename ImageType::PixelType PixelType
Definition: itkFiniteDifferenceFunction.h:83
itk::GPUFiniteDifferenceFunction::GPUReleaseMetricData
virtual void GPUReleaseMetricData()
Definition: itkGPUFiniteDifferenceFunction.h:113
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itkVector.h
itk::GPUFiniteDifferenceFunction::ComputeUpdate
PixelType ComputeUpdate(const NeighborhoodType &, void *, const FloatOffsetType &=FloatOffsetType(0.0)) override
Definition: itkGPUFiniteDifferenceFunction.h:90
itk::FiniteDifferenceFunction
Definition: itkFiniteDifferenceFunction.h:66
itkLightObject.h
Superclass
BinaryGeneratorImageFilter< TInputImage1, TInputImage2, TOutputImage > Superclass
Definition: itkAddImageFilter.h:90
itkGPUDataManager.h