35 #ifndef __itkGPUImage_h 36 #define __itkGPUImage_h 40 #include "itkVersion.h" 41 #include "itkObjectFactoryBase.h" 62 template<
typename TPixel,
unsigned int VImageDimension = 2 >
77 itkStaticConstMacro( ImageDimension,
unsigned int, VImageDimension );
86 typedef typename Superclass::SizeType
SizeType;
99 virtual void Allocate(
bool initialize =
false ) ITK_OVERRIDE;
101 void AllocateGPU(
void );
103 virtual
void Initialize(
void );
105 void FillBuffer( const TPixel & value );
107 void SetPixel( const IndexType & index, const TPixel & value );
109 const TPixel & GetPixel( const IndexType & index ) const;
111 TPixel & GetPixel( const IndexType & index );
113 const TPixel & operator[]( const IndexType & index ) const;
115 TPixel & operator[]( const IndexType & index );
118 void UpdateBuffers(
void );
121 void UpdateCPUBuffer(
void );
123 void UpdateGPUBuffer(
void );
126 TPixel * GetBufferPointer(
void );
128 const TPixel * GetBufferPointer(
void ) const;
131 AccessorType GetPixelAccessor(
void )
133 m_DataManager->SetGPUBufferDirty();
134 return Superclass::GetPixelAccessor();
141 m_DataManager->UpdateCPUBuffer();
142 return Superclass::GetPixelAccessor();
149 m_DataManager->SetGPUBufferDirty();
150 return NeighborhoodAccessorFunctorType();
157 m_DataManager->UpdateCPUBuffer();
158 return NeighborhoodAccessorFunctorType();
162 void SetPixelContainer( PixelContainer * container );
167 m_DataManager->SetGPUBufferDirty();
return Superclass::GetPixelContainer();
173 m_DataManager->UpdateCPUBuffer();
174 return Superclass::GetPixelContainer();
180 m_DataManager->SetCurrentCommandQueue( queueid );
186 return m_DataManager->GetCurrentCommandQueueId();
201 Superclass::DataHasBeenGenerated();
203 if( m_DataManager->IsCPUBufferDirty() )
205 m_DataManager->Modified();
212 virtual void Graft(
const DataObject * data );
214 void GraftITKImage(
const DataObject * data );
217 virtual void Modified(
void )
const;
221 itkGetConstReferenceMacro( IndexToPhysicalPoint, DirectionType );
222 itkGetConstReferenceMacro( PhysicalPointToIndex, DirectionType );
229 virtual void PrintSelf( std::ostream & os, Indent indent )
const;
234 void operator=(
const Self & );
242 template<
typename T >
250 template<
typename TPixelType,
unsigned int NDimension >
260 #ifndef ITK_MANUAL_INSTANTIATION 261 #include "itkGPUImage.hxx"
PixelContainer::ConstPointer PixelContainerConstPointer
Superclass::IOPixelType IOPixelType
DefaultPixelAccessorFunctor< Self > AccessorFunctorType
void SetCurrentCommandQueue(int queueid)
NeighborhoodAccessorFunctor< Self > NeighborhoodAccessorFunctorType
void DataHasBeenGenerated(void)
Superclass::InternalPixelType InternalPixelType
Superclass::PixelType PixelType
Superclass::DirectionType DirectionType
Templated n-dimensional image class for the GPU.
WeakPointer< const Self > ConstWeakPointer
Superclass::AccessorType AccessorType
const NeighborhoodAccessorFunctorType GetNeighborhoodAccessor(void) const
Superclass::PixelContainer PixelContainer
Image< TPixel, VImageDimension > Superclass
GPUImageDataManager< GPUImage >::Pointer m_DataManager
int GetCurrentCommandQueueId(void)
Superclass::SpacingType SpacingType
Superclass::OffsetType OffsetType
Superclass::ValueType ValueType
Superclass::RegionType RegionType
SmartPointer< const Self > ConstPointer
const PixelContainer * GetPixelContainer(void) const
PixelContainer * GetPixelContainer(void)
NeighborhoodAccessorFunctorType GetNeighborhoodAccessor(void)
Superclass::SizeType SizeType
Superclass::IndexType IndexType
SmartPointer< Self > Pointer
GPUImage< TPixelType, NDimension > Type
const AccessorType GetPixelAccessor(void) const
PixelContainer::Pointer PixelContainerPointer