ITK  5.2.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  * http://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>
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_MOVE(GPUFiniteDifferenceFunction);
51 
58 
61 
63  using ImageType = typename Superclass::ImageType;
64  using PixelType = typename Superclass::PixelType;
66 
68  static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
69 
72 
76 
79 
82 
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  {
95  return pix;
96  }
97 #endif
98 
99 
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 
122 
125 };
126 } // end namespace itk
127 
128 #endif
itk::FiniteDifferenceFunction< TDisplacementField >::RadiusType
typename ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itk::GPUFiniteDifferenceFunction::m_ComputeUpdateGPUKernelHandle
int m_ComputeUpdateGPUKernelHandle
Definition: itkGPUFiniteDifferenceFunction.h:124
itkConstNeighborhoodIterator.h
itk::FiniteDifferenceFunction::FloatOffsetType
Vector< float, Self::ImageDimension > FloatOffsetType
Definition: itkFiniteDifferenceFunction.h:109
itk::GPUFiniteDifferenceFunction::~GPUFiniteDifferenceFunction
~GPUFiniteDifferenceFunction() override=default
itk::FiniteDifferenceFunction::DefaultBoundaryConditionType
ZeroFluxNeumannBoundaryCondition< ImageType > DefaultBoundaryConditionType
Definition: itkFiniteDifferenceFunction.h:94
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::FiniteDifferenceFunction< TDisplacementField >::PixelRealType
double PixelRealType
Definition: itkFiniteDifferenceFunction.h:84
itk::GPUFiniteDifferenceFunction::GPUFiniteDifferenceFunction
GPUFiniteDifferenceFunction()
Definition: itkGPUFiniteDifferenceFunction.h:117
itk::SmartPointer< Self >
itkGPUKernelManager.h
itk::FiniteDifferenceFunction< TDisplacementField >::ImageType
TDisplacementField ImageType
Definition: itkFiniteDifferenceFunction.h:82
itk::GPUFiniteDifferenceFunction::GPUComputeUpdate
virtual void GPUComputeUpdate(const typename TImageType::Pointer output, typename TImageType::Pointer update, void *gd)=0
itk::GPUFiniteDifferenceFunction::ImageDimension
static constexpr unsigned int ImageDimension
Definition: itkGPUFiniteDifferenceFunction.h:68
itk::GPUFiniteDifferenceFunction::m_GPUKernelManager
GPUKernelManager::Pointer m_GPUKernelManager
Definition: itkGPUFiniteDifferenceFunction.h:121
itkFiniteDifferenceFunction.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
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::FiniteDifferenceFunction::NeighborhoodType
ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType > NeighborhoodType
Definition: itkFiniteDifferenceFunction.h:101
itk::GPUFiniteDifferenceFunction::GPUReleaseMetricData
virtual void GPUReleaseMetricData()
Definition: itkGPUFiniteDifferenceFunction.h:113
itk::NumericTraits::ZeroValue
static T ZeroValue()
Definition: itkNumericTraits.h:148
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itkVector.h
itk::GPUFiniteDifferenceFunction::Superclass
FiniteDifferenceFunction< TImageType > Superclass
Definition: itkGPUFiniteDifferenceFunction.h:54
itk::FiniteDifferenceFunction
Definition: itkFiniteDifferenceFunction.h:66
itk::ZeroFluxNeumannBoundaryCondition< ImageType >
itk::GPUFiniteDifferenceFunction::ComputeUpdate
PixelType ComputeUpdate(const NeighborhoodType &, void *, const FloatOffsetType &) override
Definition: itkGPUFiniteDifferenceFunction.h:90
itk::GPUFiniteDifferenceFunction::FloatOffsetType
typename Superclass::FloatOffsetType FloatOffsetType
Definition: itkGPUFiniteDifferenceFunction.h:85
itkLightObject.h
itkGPUDataManager.h
itk::FiniteDifferenceFunction< TDisplacementField >::TimeStepType
double TimeStepType
Definition: itkFiniteDifferenceFunction.h:90