ITK  4.4.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 {
51 itkGPUKernelClassMacro(GPUDenseFiniteDifferenceImageFilterKernel);
52 
53 template< class TInputImage, class TOutputImage, class TParentImageFilter =
54  DenseFiniteDifferenceImageFilter< TInputImage, TOutputImage > >
56  public GPUFiniteDifferenceImageFilter< TInputImage, TOutputImage, TParentImageFilter >
57 {
58 public:
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 
90  itkConceptMacro( OutputTimesDoubleCheck,
92  itkConceptMacro( OutputAdditiveOperatorsCheck,
94  itkConceptMacro( InputConvertibleToOutputCheck,
96 
98 #endif
99 
101  itkGetOpenCLSourceFromKernelMacro(GPUDenseFiniteDifferenceImageFilterKernel);
102 
103 protected:
106  }
107  void PrintSelf(std::ostream & os, Indent indent) const;
108 
111  virtual void ApplyUpdate(const TimeStepType& dt);
112 
113  virtual void GPUApplyUpdate(const TimeStepType& dt);
114 
117  virtual TimeStepType GPUCalculateChange();
118 
122  virtual void CopyInputToOutput();
123 
127  return CPUSuperclass::GetUpdateBuffer();
128  }
129 
132  virtual void AllocateUpdateBuffer();
133 
134  /* GPU kernel handle for GPUApplyUpdate */
136 
137 private:
138  GPUDenseFiniteDifferenceImageFilter(const Self &); //purposely not implemented
139  void operator=(const Self &); //purposely not implemented
140 
141 };
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 #include "itkGPUDenseFiniteDifferenceImageFilter.hxx"
146 #endif
147 
148 #endif
149