ITK  4.12.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  }
106  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
107 
110  virtual void ApplyUpdate(const TimeStepType& dt) ITK_OVERRIDE;
111 
112  virtual void GPUApplyUpdate(const TimeStepType& dt) ITK_OVERRIDE;
113 
116  virtual TimeStepType GPUCalculateChange() ITK_OVERRIDE;
117 
121  virtual void CopyInputToOutput() ITK_OVERRIDE;
122 
125  virtual UpdateBufferType * GetUpdateBuffer() ITK_OVERRIDE {
126  return CPUSuperclass::GetUpdateBuffer();
127  }
128 
131  virtual void AllocateUpdateBuffer() ITK_OVERRIDE;
132 
133  /* GPU kernel handle for GPUApplyUpdate */
134  int m_ApplyUpdateGPUKernelHandle;
135 
136 private:
137  ITK_DISALLOW_COPY_AND_ASSIGN(GPUDenseFiniteDifferenceImageFilter);
138 
139 };
140 } // end namespace itk
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 #include "itkGPUDenseFiniteDifferenceImageFilter.hxx"
144 #endif
145 
146 #endif
virtual void PrintSelf(std::ostream &os, Indent indent) const override
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)