39 template <
typename TPixel,
unsigned int VImageDimension = 2>
40 class ITK_TEMPLATE_EXPORT
GPUImage :
public Image<TPixel,VImageDimension>
53 itkStaticConstMacro(ImageDimension,
unsigned int, VImageDimension);
79 virtual void Allocate(
bool initialize=
false) ITK_OVERRIDE;
81 virtual
void Initialize() ITK_OVERRIDE;
83 void FillBuffer(const TPixel & value);
85 void SetPixel(const
IndexType & index, const TPixel & value);
87 const TPixel & GetPixel(const
IndexType & index) const;
89 TPixel & GetPixel(const
IndexType & index);
91 const TPixel & operator[](const
IndexType & index) const;
93 TPixel & operator[](const
IndexType & index);
101 TPixel* GetBufferPointer() ITK_OVERRIDE;
103 const TPixel * GetBufferPointer() const ITK_OVERRIDE;
108 m_DataManager->SetGPUBufferDirty();
109 return Superclass::GetPixelAccessor();
116 m_DataManager->UpdateCPUBuffer();
117 return Superclass::GetPixelAccessor();
124 m_DataManager->SetGPUBufferDirty();
133 m_DataManager->UpdateCPUBuffer();
139 void SetPixelContainer(PixelContainer *container);
144 m_DataManager->SetGPUBufferDirty();
return Superclass::GetPixelContainer();
149 m_DataManager->UpdateCPUBuffer();
150 return Superclass::GetPixelContainer();
155 m_DataManager->SetCurrentCommandQueue( queueid );
159 return m_DataManager->GetCurrentCommandQueueID();
174 Superclass::DataHasBeenGenerated();
175 if( m_DataManager->IsCPUBufferDirty() )
177 m_DataManager->Modified();
182 virtual void Graft(
const Self *data);
185 virtual void Graft(
const DataObject *data) ITK_OVERRIDE;
188 using Superclass::Graft;
208 return "A Factory for GPUImage";
213 itkFactorylessNewMacro(Self);
229 #define OverrideImageTypeMacro(pt,dm) this->RegisterOverride( \
230 typeid(itk::Image<pt,dm>).name(), \
231 typeid(itk::GPUImage<pt,dm>).name(), \
232 "GPU Image Override", \
234 itk::CreateObjectFunction<GPUImage<pt,dm> >::New() )
266 template <
typename T>
273 template <
typename TPixelType,
unsigned int NDimension>
282 #ifndef ITK_MANUAL_INSTANTIATION
283 #include "itkGPUImage.hxx"
void DataHasBeenGenerated() override
PixelContainer::ConstPointer PixelContainerConstPointer
#define ITK_SOURCE_VERSION
SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
Superclass::IOPixelType IOPixelType
const char * GetDescription() const override
Create instances of classes using an object factory.
Implements a weak reference to an object.
DefaultPixelAccessorFunctor< Self > AccessorFunctorType
void SetCurrentCommandQueue(int queueid)
NeighborhoodAccessorFunctor< Self > NeighborhoodAccessorFunctorType
GPU memory manager implemented using OpenCL. Required by GPUImage class.
Superclass::InternalPixelType InternalPixelType
Superclass::PixelType PixelType
ImageBaseType::DirectionType DirectionType
PixelContainer * GetPixelContainer()
Superclass::DirectionType DirectionType
Templated n-dimensional image class for the GPU.
Superclass::AccessorType AccessorType
WeakPointer< const Self > ConstWeakPointer
Provides accessor interfaces to Get pixels and is meant to be used on pointers contained within Neigh...
Superclass::PixelContainer PixelContainer
const PixelContainer * GetPixelContainer() const
virtual const char * GetITKSourceVersion() const override
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
Image< TPixel, VImageDimension > Superclass
Provides a common API for pixel accessors for Image and VectorImage.
itk::ObjectFactoryBase Superclass
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
Superclass::SpacingType SpacingType
#define OverrideImageTypeMacro(pt, dm)
SmartPointer< const Self > ConstPointer
Superclass::OffsetType OffsetType
Superclass::ValueType ValueType
Superclass::RegionType RegionType
GPUImage< TPixelType, NDimension > Type
int GetCurrentCommandQueueID()
static bool RegisterFactory(ObjectFactoryBase *, InsertionPositionType where=INSERT_AT_BACK, vcl_size_t position=0)
itk::SmartPointer< Self > Pointer
static void RegisterOneFactory(void)
ImageBaseType::SizeType SizeType
Give access to partial aspects a type.
Superclass::SizeType SizeType
Superclass::IndexType IndexType
Base class for all data objects in ITK.
Templated n-dimensional image class.
const AccessorType GetPixelAccessor(void) const
ImageBaseType::IndexType IndexType
Defines an itk::Image front-end to a standard C-array.
PixelContainer::Pointer PixelContainerPointer