39 template <
typename TPixel,
unsigned int VImageDimension = 2>
40 class ITK_TEMPLATE_EXPORT
GPUImage :
public Image<TPixel,VImageDimension>
43 ITK_DISALLOW_COPY_AND_ASSIGN(
GPUImage);
55 static constexpr
unsigned int ImageDimension = VImageDimension;
80 void Allocate(
bool initialize=
false)
override;
82 void Initialize()
override;
84 void FillBuffer(
const TPixel & value);
86 void SetPixel(
const IndexType & index,
const TPixel & value);
88 const TPixel & GetPixel(
const IndexType & index)
const;
90 TPixel & GetPixel(
const IndexType & index);
92 const TPixel & operator[](
const IndexType & index)
const;
94 TPixel & operator[](
const IndexType & index);
102 TPixel* GetBufferPointer()
override;
104 const TPixel * GetBufferPointer()
const override;
109 m_DataManager->SetGPUBufferDirty();
110 return Superclass::GetPixelAccessor();
117 m_DataManager->UpdateCPUBuffer();
118 return Superclass::GetPixelAccessor();
125 m_DataManager->SetGPUBufferDirty();
134 m_DataManager->UpdateCPUBuffer();
140 void SetPixelContainer(PixelContainer *container);
145 m_DataManager->SetGPUBufferDirty();
return Superclass::GetPixelContainer();
150 m_DataManager->UpdateCPUBuffer();
151 return Superclass::GetPixelContainer();
156 m_DataManager->SetCurrentCommandQueue( queueid );
160 return m_DataManager->GetCurrentCommandQueueID();
175 Superclass::DataHasBeenGenerated();
176 if( m_DataManager->IsCPUBufferDirty() )
178 m_DataManager->Modified();
183 virtual void Graft(
const Self *data);
189 using Superclass::Graft;
210 return "A Factory for GPUImage";
215 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"
static void RegisterOneFactory()
void DataHasBeenGenerated() override
Light weight base class for most itk classes.
#define ITK_SOURCE_VERSION
const char * GetDescription() const override
Create instances of classes using an object factory.
Implements a weak reference to an object.
void SetCurrentCommandQueue(int queueid)
GPU memory manager implemented using OpenCL. Required by GPUImage class.
const AccessorType GetPixelAccessor() const
PixelContainer * GetPixelContainer()
Templated n-dimensional image class for the GPU.
AccessorType GetPixelAccessor()
ImageBaseType::SizeType SizeType
Provides accessor interfaces to Get pixels and is meant to be used on pointers contained within Neigh...
ImageBaseType::DirectionType DirectionType
ImageBaseType::IndexType IndexType
const PixelContainer * GetPixelContainer() const
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
typename Superclass::RegionType RegionType
typename Superclass::SizeType SizeType
typename Superclass::SpacingType SpacingType
GPUImageDataManager< GPUImage >::Pointer m_DataManager
Provides a common API for pixel accessors for Image and VectorImage.
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
typename Superclass::IndexType IndexType
#define OverrideImageTypeMacro(pt, dm)
int GetCurrentCommandQueueID()
static bool RegisterFactory(ObjectFactoryBase *, InsertionPositionType where=INSERT_AT_BACK, vcl_size_t position=0)
typename Superclass::DirectionType DirectionType
typename PixelContainer::Pointer PixelContainerPointer
typename PixelContainer::ConstPointer PixelContainerConstPointer
const char * GetITKSourceVersion() const override
Give access to partial aspects a type.
ImageBaseType::RegionType RegionType
typename Superclass::OffsetType OffsetType
Base class for all data objects in ITK.
Templated n-dimensional image class.
Defines an itk::Image front-end to a standard C-array.