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);
99 operator[](
const IndexType & index)
const;
112 GetBufferPointer()
override;
115 GetBufferPointer()
const override;
121 m_DataManager->SetGPUBufferDirty();
122 return Superclass::GetPixelAccessor();
130 m_DataManager->UpdateCPUBuffer();
131 return Superclass::GetPixelAccessor();
136 NeighborhoodAccessorFunctorType
139 m_DataManager->SetGPUBufferDirty();
146 const NeighborhoodAccessorFunctorType
149 m_DataManager->UpdateCPUBuffer();
156 SetPixelContainer(PixelContainer * container);
162 m_DataManager->SetGPUBufferDirty();
163 return Superclass::GetPixelContainer();
167 const PixelContainer *
170 m_DataManager->UpdateCPUBuffer();
171 return Superclass::GetPixelContainer();
177 m_DataManager->SetCurrentCommandQueue(queueid);
183 return m_DataManager->GetCurrentCommandQueueID();
200 Superclass::DataHasBeenGenerated();
201 if (m_DataManager->IsCPUBufferDirty())
203 m_DataManager->Modified();
209 Graft(
const Self * data);
216 using Superclass::Graft;
241 return "A Factory for GPUImage";
246 itkFactorylessNewMacro(
Self);
261 #define OverrideImageTypeMacro(pt, dm) \
262 this->RegisterOverride(typeid(itk::Image<pt, dm>).name(), \
263 typeid(itk::GPUImage<pt, dm>).name(), \
264 "GPU Image Override", \
266 itk::CreateObjectFunction<GPUImage<pt, dm>>::New())
297 template <
typename T>
304 template <
typename TPixelType,
unsigned int VDimension>
313 #ifndef ITK_MANUAL_INSTANTIATION
314 # include "itkGPUImage.hxx"