Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitk::OclDataSet Class Reference

Class implementing processing of arbitrary data sets for GPU Image Processing. More...

#include <mitkOclDataSet.h>

Inheritance diagram for mitk::OclDataSet:
Collaboration diagram for mitk::OclDataSet:

Public Member Functions

 mitkClassMacro (OclDataSet, OclBaseData)
 
Pointer Clone () const
 
virtual int TransferDataToGPU (cl_command_queue)
 Copies the RAM-stored data to GMEM. More...
 
virtual void * TransferDataToCPU (cl_command_queue)
 Copies the in GMEM stored data to RAM. More...
 
void * GetData ()
 Returns the pointer to the referenced data. More...
 
cl_mem GetGPUBuffer ()
 
cl_mem CreateGPUBuffer ()
 
bool IsModified (int _type)
 Returns the status of the image buffer. More...
 
void Modified (int _type)
 Set the modified flag for one of the buffers. More...
 
void SetData (void *data)
 Initialze the OclDataSet with data. More...
 
vcl_size_t GetBufferSize () const
 returns the amount of elements in the DataSet More...
 
short GetBytesPerElement () const
 
void SetBufferSize (vcl_size_t size)
 Set the amount of elements in buffer. More...
 
void SetBpE (unsigned short BpE)
 Set the DataSet memory Size per Element in Bytes. More...
 
- Public Member Functions inherited from mitk::OclBaseData
 mitkClassMacroItkParent (OclBaseData, itk::Object)
 
void GPUModified ()
 Set the modified flag for one of the GPU buffer. More...
 
void CPUModified ()
 Set the modified flag for one of the CPU buffer. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 OclDataSet ()
 Constructor. More...
 
virtual ~OclDataSet ()
 Destructor. More...
 
- Protected Member Functions inherited from mitk::OclBaseData
 OclBaseData ()
 Default constructor. More...
 
virtual ~OclBaseData ()
 Default destructor. More...
 

Protected Attributes

cl_mem m_gpuBuffer
 
cl_context m_context
 

Detailed Description

Class implementing processing of arbitrary data sets for GPU Image Processing.

The class holds a pointer to the data stored in RAM and performs an on-demand-copy to the graphics memory. It is the basic data structure for all mitk::oclDataSetToDataSetFilter classes

Definition at line 36 of file mitkOclDataSet.h.

Constructor & Destructor Documentation

◆ OclDataSet()

mitk::OclDataSet::OclDataSet ( )
protected

Constructor.

Definition at line 23 of file mitkOclDataSet.cpp.

◆ ~OclDataSet()

mitk::OclDataSet::~OclDataSet ( )
protectedvirtual

Destructor.

Definition at line 28 of file mitkOclDataSet.cpp.

References m_gpuBuffer, and MITK_DEBUG.

Member Function Documentation

◆ Clone()

Pointer mitk::OclDataSet::Clone ( ) const

◆ CreateGPUBuffer()

cl_mem mitk::OclDataSet::CreateGPUBuffer ( )

◆ GetBufferSize()

vcl_size_t mitk::OclDataSet::GetBufferSize ( ) const
inline

returns the amount of elements in the DataSet

Definition at line 86 of file mitkOclDataSet.h.

◆ GetBytesPerElement()

short mitk::OclDataSet::GetBytesPerElement ( ) const
inline

Definition at line 91 of file mitkOclDataSet.h.

◆ GetData()

void* mitk::OclDataSet::GetData ( )
inline

Returns the pointer to the referenced data.

Definition at line 50 of file mitkOclDataSet.h.

◆ GetGPUBuffer()

cl_mem mitk::OclDataSet::GetGPUBuffer ( )
virtual

Returns the pointer to the GPU buffer

Reimplemented from mitk::OclBaseData.

Definition at line 115 of file mitkOclDataSet.cpp.

References CHECK_OCL_ERR, m_gpuBuffer, and MITK_DEBUG.

◆ IsModified()

bool mitk::OclDataSet::IsModified ( int  _type)

Returns the status of the image buffer.

Parameters
_typeThe flag to specify the buffer type ( GPU / CPU )

Definition at line 63 of file mitkOclDataSet.cpp.

◆ mitkClassMacro()

mitk::OclDataSet::mitkClassMacro ( OclDataSet  ,
OclBaseData   
)

◆ Modified()

void mitk::OclDataSet::Modified ( int  _type)

Set the modified flag for one of the buffers.

Parameters
_typeThe flag to specify the buffer type ( GPU / CPU )

Definition at line 69 of file mitkOclDataSet.cpp.

◆ New()

static Pointer mitk::OclDataSet::New ( )
static

◆ SetBpE()

void mitk::OclDataSet::SetBpE ( unsigned short  BpE)

Set the DataSet memory Size per Element in Bytes.

Definition at line 169 of file mitkOclDataSet.cpp.

◆ SetBufferSize()

void mitk::OclDataSet::SetBufferSize ( vcl_size_t  size)

Set the amount of elements in buffer.

Definition at line 164 of file mitkOclDataSet.cpp.

◆ SetData()

void mitk::OclDataSet::SetData ( void *  data)
inline

Initialze the OclDataSet with data.

Definition at line 78 of file mitkOclDataSet.h.

◆ TransferDataToCPU()

void * mitk::OclDataSet::TransferDataToCPU ( cl_command_queue  gpuComQueue)
virtual

Copies the in GMEM stored data to RAM.

Implements mitk::OclBaseData.

Definition at line 133 of file mitkOclDataSet.cpp.

References CHECK_OCL_ERR, m_gpuBuffer, MITK_ERROR, mitkThrow, and oclPrintMemObjectInfo().

◆ TransferDataToGPU()

int mitk::OclDataSet::TransferDataToGPU ( cl_command_queue  gpuComQueue)
virtual

Copies the RAM-stored data to GMEM.

Implements mitk::OclBaseData.

Definition at line 76 of file mitkOclDataSet.cpp.

References CHECK_OCL_ERR, CreateGPUBuffer(), m_gpuBuffer, MITK_DEBUG, MITK_ERROR, and mitkThrow.

Member Data Documentation

◆ m_context

cl_context mitk::OclDataSet::m_context
protected

GPU Context the Buffer was created in, needed for access

Definition at line 113 of file mitkOclDataSet.h.

Referenced by CreateGPUBuffer().

◆ m_gpuBuffer

cl_mem mitk::OclDataSet::m_gpuBuffer
protected

GMEM Image buffer

Definition at line 110 of file mitkOclDataSet.h.

Referenced by CreateGPUBuffer(), GetGPUBuffer(), TransferDataToCPU(), TransferDataToGPU(), and ~OclDataSet().


The documentation for this class was generated from the following files: