ITK  4.13.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 
62  typedef TParentImageFilter CPUSuperclass;
65 
68 
71  typedef typename GPUSuperclass::OutputImageType OutputImageType;
72  typedef typename GPUSuperclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType;
73 
76  itkStaticConstMacro(ImageDimension, unsigned int, GPUSuperclass::ImageDimension);
77 
80  typedef typename GPUSuperclass::PixelType PixelType;
81 
83  typedef typename GPUSuperclass::TimeStepType TimeStepType;
84 
87 
88 #ifdef ITK_USE_CONCEPT_CHECKING
89  // Begin concept checking
90  itkConceptMacro( OutputTimesDoubleCheck,
92  itkConceptMacro( OutputAdditiveOperatorsCheck,
94  itkConceptMacro( InputConvertibleToOutputCheck,
96  // End concept checking
97 #endif
98 
100  itkGetOpenCLSourceFromKernelMacro(GPUDenseFiniteDifferenceImageFilterKernel);
101 
102 protected:
105  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
106 
109  virtual void ApplyUpdate(const TimeStepType& dt) ITK_OVERRIDE;
110 
111  virtual void GPUApplyUpdate(const TimeStepType& dt) ITK_OVERRIDE;
112 
115  virtual TimeStepType GPUCalculateChange() ITK_OVERRIDE;
116 
120  virtual void CopyInputToOutput() ITK_OVERRIDE;
121 
124  virtual UpdateBufferType * GetUpdateBuffer() ITK_OVERRIDE {
125  return CPUSuperclass::GetUpdateBuffer();
126  }
127 
130  virtual void AllocateUpdateBuffer() ITK_OVERRIDE;
131 
132  /* GPU kernel handle for GPUApplyUpdate */
133  int m_ApplyUpdateGPUKernelHandle;
134 
135 private:
136  ITK_DISALLOW_COPY_AND_ASSIGN(GPUDenseFiniteDifferenceImageFilter);
137 
138 };
139 } // end namespace itk
140 
141 #ifndef ITK_MANUAL_INSTANTIATION
142 #include "itkGPUDenseFiniteDifferenceImageFilter.hxx"
143 #endif
144 
145 #endif
Base class for GPU Finite Difference Image Filters.
itkGPUKernelClassMacro(GPUImageOpsKernel)
GPUFiniteDifferenceImageFilter< TInputImage, TOutputImage, TParentImageFilter > GPUSuperclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
GPUSuperclass::FiniteDifferenceFunctionType FiniteDifferenceFunctionType
#define itkConceptMacro(name, concept)