ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkGPUFiniteDifferenceFunction.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 __itkGPUFiniteDifferenceFunction_h
19 #define __itkGPUFiniteDifferenceFunction_h
20 
22 #include "itkLightObject.h"
24 #include "itkVector.h"
25 
26 #include "itkGPUDataManager.h"
27 #include "itkGPUKernelManager.h"
28 
29 namespace itk
30 {
46 template< typename TImageType >
48 {
49 public:
50 
57 
60 
62  typedef typename Superclass::ImageType ImageType;
63  typedef typename Superclass::PixelType PixelType;
65 
67  itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
68 
71 
75 
78 
81 
85 
86  virtual void InitializeIteration() {}
87 
88 #if !defined( CABLE_CONFIGURATION )
89 
90  virtual PixelType ComputeUpdate( const NeighborhoodType & itkNotUsed(neighborhood),
91  void *itkNotUsed(globalData),
92  const FloatOffsetType & itkNotUsed(offset = FloatOffsetType(0.0)) )
93  {
95  return pix;
96  }
97 #endif
98 
99 
101  virtual void GPUComputeUpdate( const typename TImageType::Pointer output,
102  typename TImageType::Pointer update,
103  void *gd) = 0;
104 
107  virtual void GPUAllocateMetricData(unsigned int itkNotUsed(numPixels)) {}
108 
111  virtual void GPUReleaseMetricData() {}
112 
113 protected:
116  }
118  }
119 
120  void PrintSelf(std::ostream & os, Indent indent) const
121  {
122  Superclass::PrintSelf(os, indent);
123  }
124 
127 
130 
131 private:
132  GPUFiniteDifferenceFunction(const Self &); //purposely not implemented
133  void operator=(const Self &); //purposely not implemented
134 
135 };
136 } // end namespace itk
137 
138 #endif
virtual PixelType ComputeUpdate(const NeighborhoodType &, void *, const FloatOffsetType &)
Light weight base class for most itk classes.
ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType > NeighborhoodType
virtual void GPUComputeUpdate(const typename TImageType::Pointer output, typename TImageType::Pointer update, void *gd)=0
void PrintSelf(std::ostream &os, Indent indent) const
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
static Pointer New()
Superclass::NeighborhoodType NeighborhoodType
Vector< float, itkGetStaticConstMacro(ImageDimension) > FloatOffsetType
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
FiniteDifferenceFunction< TImageType > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
Superclass::DefaultBoundaryConditionType DefaultBoundaryConditionType
ZeroFluxNeumannBoundaryCondition< ImageType > DefaultBoundaryConditionType