ITK  6.0.0
Insight Toolkit
itkGPUDenseFiniteDifferenceImageFilter.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 itkGPUDenseFiniteDifferenceImageFilter_h
19 #define itkGPUDenseFiniteDifferenceImageFilter_h
20 
23 
24 namespace itk
25 {
27 class ITKGPUFiniteDifference_EXPORT itkGPUKernelMacro(GPUDenseFiniteDifferenceImageFilterKernel);
28 
52 template <typename TInputImage,
53  typename TOutputImage,
54  typename TParentImageFilter = DenseFiniteDifferenceImageFilter<TInputImage, TOutputImage>>
55 class ITK_TEMPLATE_EXPORT GPUDenseFiniteDifferenceImageFilter
56  : public GPUFiniteDifferenceImageFilter<TInputImage, TOutputImage, TParentImageFilter>
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(GPUDenseFiniteDifferenceImageFilter);
60 
64  using CPUSuperclass = TParentImageFilter;
67 
69  itkOverrideGetNameOfClassMacro(GPUDenseFiniteDifferenceImageFilter);
70 
73  using OutputImageType = typename GPUSuperclass::OutputImageType;
74  using FiniteDifferenceFunctionType = typename GPUSuperclass::FiniteDifferenceFunctionType;
75 
78  static constexpr unsigned int ImageDimension = GPUSuperclass::ImageDimension;
79 
82  using PixelType = typename GPUSuperclass::PixelType;
83 
85  using TimeStepType = typename GPUSuperclass::TimeStepType;
86 
89 
90 #ifdef ITK_USE_CONCEPT_CHECKING
91  // Begin concept checking
93  itkConceptMacro(OutputAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType>));
95  // End concept checking
96 #endif
97 
99  itkGetOpenCLSourceFromKernelMacro(GPUDenseFiniteDifferenceImageFilterKernel);
100 
101 protected:
103  ~GPUDenseFiniteDifferenceImageFilter() override = default;
104  void
105  PrintSelf(std::ostream & os, Indent indent) const override;
106 
109  void
110  ApplyUpdate(const TimeStepType & dt) override;
111 
112  void
113  GPUApplyUpdate(const TimeStepType & dt) override;
114 
118  GPUCalculateChange() override;
119 
123  void
124  CopyInputToOutput() override;
125 
129  GetUpdateBuffer() override
130  {
131  return CPUSuperclass::GetUpdateBuffer();
132  }
133 
136  void
137  AllocateUpdateBuffer() override;
138 
139  /* GPU kernel handle for GPUApplyUpdate */
140  int m_ApplyUpdateGPUKernelHandle{};
141 };
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 # include "itkGPUDenseFiniteDifferenceImageFilter.hxx"
146 #endif
147 
148 #endif
itk::GPUInPlaceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::OutputImageType
typename GPUSuperclass::OutputImageType OutputImageType
Definition: itkGPUInPlaceImageFilter.h:56
itk::itkGPUKernelMacro
class ITKGPUFiniteDifference_EXPORT itkGPUKernelMacro(GPUDenseFiniteDifferenceImageFilterKernel)
itk::GPUDenseFiniteDifferenceImageFilter::GetUpdateBuffer
UpdateBufferType * GetUpdateBuffer() override
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:129
itk::GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::TimeStepType
typename GPUSuperclass::TimeStepType TimeStepType
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:85
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::FiniteDifferenceFunctionType
typename GPUSuperclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:74
itk::GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::UpdateBufferType
OutputImageType UpdateBufferType
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:88
itk::GPUFiniteDifferenceImageFilter
Base class for GPU Finite Difference Image Filters.
Definition: itkGPUFiniteDifferenceImageFilter.h:40
itk::GPUImageToImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::InputImageType
TDisplacementField InputImageType
Definition: itkGPUImageToImageFilter.h:63
itk::GPUImageToImageFilter
class to abstract the behaviour of the GPU filters.
Definition: itkGPUImageToImageFilter.h:41
itkGPUFiniteDifferenceImageFilter.h
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:422
itkDenseFiniteDifferenceImageFilter.h
itk::GPUDenseFiniteDifferenceImageFilter
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:55
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:361
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Concept::Convertible
Definition: itkConceptChecking.h:217
itk::GPUInPlaceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::CPUSuperclass
TParentImageFilter CPUSuperclass
Definition: itkGPUInPlaceImageFilter.h:48
itk::GPUDenseFiniteDifferenceImageFilter< TDisplacementField, TDisplacementField, TParentImageFilter >::PixelType
typename GPUSuperclass::PixelType PixelType
Definition: itkGPUDenseFiniteDifferenceImageFilter.h:82