ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGPUDenseFiniteDifferenceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkGPUDenseFiniteDifferenceImageFilter_h
19 #define itkGPUDenseFiniteDifferenceImageFilter_h
20 
23 
24 namespace itk
25 {
27 itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel);
28 
52 template< typename TInputImage, typename TOutputImage, typename TParentImageFilter =
53  DenseFiniteDifferenceImageFilter< TInputImage, TOutputImage > >
54 class ITK_TEMPLATE_EXPORT GPUDenseFiniteDifferenceImageFilter :
55  public GPUFiniteDifferenceImageFilter< TInputImage, TOutputImage, TParentImageFilter >
56 {
57 public:
58  ITK_DISALLOW_COPY_AND_ASSIGN(GPUDenseFiniteDifferenceImageFilter);
59 
63  using CPUSuperclass = TParentImageFilter;
66 
69 
72  using OutputImageType = typename GPUSuperclass::OutputImageType;
73  using FiniteDifferenceFunctionType = typename GPUSuperclass::FiniteDifferenceFunctionType;
74 
77  static constexpr unsigned int ImageDimension = GPUSuperclass::ImageDimension;
78 
81  using PixelType = typename GPUSuperclass::PixelType;
82 
84  using TimeStepType = typename GPUSuperclass::TimeStepType;
85 
88 
89 #ifdef ITK_USE_CONCEPT_CHECKING
90  // Begin concept checking
91  itkConceptMacro( OutputTimesDoubleCheck,
93  itkConceptMacro( OutputAdditiveOperatorsCheck,
95  itkConceptMacro( InputConvertibleToOutputCheck,
97  // End concept checking
98 #endif
99 
101  itkGetOpenCLSourceFromKernelMacro(GPUDenseFiniteDifferenceImageFilterKernel);
102 
103 protected:
106  void PrintSelf(std::ostream & os, Indent indent) const override;
107 
110  void ApplyUpdate(const TimeStepType& dt) override;
111 
112  void GPUApplyUpdate(const TimeStepType& dt) override;
113 
116  TimeStepType GPUCalculateChange() override;
117 
121  void CopyInputToOutput() override;
122 
126  return CPUSuperclass::GetUpdateBuffer();
127  }
128 
131  void AllocateUpdateBuffer() override;
132 
133  /* GPU kernel handle for GPUApplyUpdate */
135 };
136 } // end namespace itk
137 
138 #ifndef ITK_MANUAL_INSTANTIATION
139 #include "itkGPUDenseFiniteDifferenceImageFilter.hxx"
140 #endif
141 
142 #endif
class to abstract the behaviour of the GPU filters.
Base class for GPU Finite Difference Image Filters.
itkGPUKernelClassMacro(GPUImageOpsKernel)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)