39 template <
typename TPixel,
unsigned int VImageDimension = 2>
40 class ITK_TEMPLATE_EXPORT
GPUImage :
public Image<TPixel, VImageDimension>
43 ITK_DISALLOW_COPY_AND_MOVE(
GPUImage);
53 itkOverrideGetNameOfClassMacro(
GPUImage);
55 static constexpr
unsigned int ImageDimension = VImageDimension;
57 using typename Superclass::PixelType;
58 using typename Superclass::ValueType;
59 using typename Superclass::InternalPixelType;
60 using typename Superclass::IOPixelType;
62 using typename Superclass::SpacingType;
63 using typename Superclass::PixelContainer;
66 using typename Superclass::OffsetType;
70 using typename Superclass::AccessorType;
81 Allocate(
bool initialize =
false)
override;
84 Initialize()
override;
87 FillBuffer(
const TPixel & value);
90 SetPixel(
const IndexType & index,
const TPixel & value);
98 const TPixel & operator[](
const IndexType & index)
const;
100 TPixel & operator[](
const IndexType & index);
110 GetBufferPointer()
override;
113 GetBufferPointer()
const override;
119 m_DataManager->SetGPUBufferDirty();
120 return Superclass::GetPixelAccessor();
128 m_DataManager->UpdateCPUBuffer();
129 return Superclass::GetPixelAccessor();
134 NeighborhoodAccessorFunctorType
137 m_DataManager->SetGPUBufferDirty();
144 const NeighborhoodAccessorFunctorType
147 m_DataManager->UpdateCPUBuffer();
154 SetPixelContainer(PixelContainer * container);
160 m_DataManager->SetGPUBufferDirty();
161 return Superclass::GetPixelContainer();
165 const PixelContainer *
168 m_DataManager->UpdateCPUBuffer();
169 return Superclass::GetPixelContainer();
175 m_DataManager->SetCurrentCommandQueue(queueid);
181 return m_DataManager->GetCurrentCommandQueueID();
198 Superclass::DataHasBeenGenerated();
199 if (m_DataManager->IsCPUBufferDirty())
201 m_DataManager->Modified();
207 Graft(
const Self * data);
214 using Superclass::Graft;
239 return "A Factory for GPUImage";
244 itkFactorylessNewMacro(
Self);
259 #define OverrideImageTypeMacro(pt, dm) \
260 this->RegisterOverride(typeid(itk::Image<pt, dm>).name(), \
261 typeid(itk::GPUImage<pt, dm>).name(), \
262 "GPU Image Override", \
264 itk::CreateObjectFunction<GPUImage<pt, dm>>::New())
295 template <
typename T>
302 template <
typename TPixelType,
unsigned int VDimension>
311 #ifndef ITK_MANUAL_INSTANTIATION
312 # include "itkGPUImage.hxx"