40#include "itkVersion.h"
41#include "itkObjectFactoryBase.h"
62template <
typename TPixel,
unsigned int VImageDimension = 2>
80 using typename Superclass::PixelType;
81 using typename Superclass::ValueType;
82 using typename Superclass::InternalPixelType;
83 using typename Superclass::IOPixelType;
84 using typename Superclass::DirectionType;
85 using typename Superclass::SpacingType;
86 using typename Superclass::PixelContainer;
87 using typename Superclass::SizeType;
88 using typename Superclass::IndexType;
89 using typename Superclass::OffsetType;
90 using typename Superclass::RegionType;
93 using typename Superclass::AccessorType;
100 template <
typename UPixelType,
unsigned int VUImageDimension = VImageDimension>
106 template <
typename UPixelType,
unsigned int VUImageDimension = VImageDimension>
124 SetPixel(
const IndexType & index,
const TPixel & value);
158 m_DataManager->SetGPUBufferDirty();
159 return Superclass::GetPixelAccessor();
167 m_DataManager->UpdateCPUBuffer();
168 return Superclass::GetPixelAccessor();
173 NeighborhoodAccessorFunctorType
176 m_DataManager->SetGPUBufferDirty();
182 const NeighborhoodAccessorFunctorType
185 m_DataManager->UpdateCPUBuffer();
197 m_DataManager->SetGPUBufferDirty();
198 return Superclass::GetPixelContainer();
202 const PixelContainer *
205 m_DataManager->UpdateCPUBuffer();
206 return Superclass::GetPixelContainer();
213 m_DataManager->SetCurrentCommandQueue(queueid);
220 return m_DataManager->GetCurrentCommandQueueId();
237 Superclass::DataHasBeenGenerated();
239 if (m_DataManager->IsCPUBufferDirty())
241 m_DataManager->Modified();
248 Graft(
const DataObject * data)
override;
259 itkGetConstReferenceMacro(IndexToPhysicalPoint, DirectionType);
260 itkGetConstReferenceMacro(PhysicalPointToIndex, DirectionType);
267 PrintSelf(std::ostream & os, Indent indent)
const override;
277class ITK_TEMPLATE_EXPORT GPUTraits
283template <
typename TPixelType,
unsigned int NDimension>
284class ITK_TEMPLATE_EXPORT GPUTraits<
Image<TPixelType, NDimension>>
287 using Type = GPUImage<TPixelType, NDimension>;
292#ifndef ITK_MANUAL_INSTANTIATION
293# include "itkGPUImage.hxx"
Templated n-dimensional image class for the GPU.
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() const
void GraftITKImage(const DataObject *data)
void Graft(const DataObject *data) override
void Modified() const override
typename PixelContainer::ConstPointer PixelContainerConstPointer
DefaultPixelAccessorFunctor< Self > AccessorFunctorType
const TPixel & GetPixel(const IndexType &index) const
NeighborhoodAccessorFunctor< Self > NeighborhoodAccessorFunctorType
TPixel * GetBufferPointer() override
const TPixel * GetBufferPointer() const override
const AccessorType GetPixelAccessor() const
const PixelContainer * GetPixelContainer() const
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor()
PixelContainer * GetPixelContainer()
SmartPointer< const Self > ConstPointer
void SetPixel(const IndexType &index, const TPixel &value)
void SetCurrentCommandQueue(int queueid)
ITK_DISALLOW_COPY_AND_MOVE(GPUImage)
void Allocate(bool initialize=false) override
TPixel & operator[](const IndexType &index)
void DataHasBeenGenerated() override
void Initialize() override
int GetCurrentCommandQueueId()
AccessorType GetPixelAccessor()
const TPixel & operator[](const IndexType &index) const
GPUDataManager::Pointer GetGPUDataManager() const
WeakPointer< const Self > ConstWeakPointer
itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension)
Image< TPixel, VImageDimension > Superclass
void SetPixelContainer(PixelContainer *container)
typename PixelContainer::Pointer PixelContainerPointer
void PrintSelf(std::ostream &os, Indent indent) const override
TPixel & GetPixel(const IndexType &index)
~GPUImage() override=default
void FillBuffer(const TPixel &value)