Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::OclImage Class Reference

Class implementing the image format for GPU Image Processing. More...

#include <mitkOclImage.h>

Inheritance diagram for mitk::OclImage:
Collaboration diagram for mitk::OclImage:

Public Member Functions

 mitkClassMacro (OclImage, 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...
 
Image::Pointer GetMITKImage ()
 Returns the pointer to the referenced mitk::Image. More...
 
cl_mem GetGPUImage (cl_command_queue)
 Checks whether gpuImage is a valid clImage object. More...
 
cl_mem GetGPUBuffer ()
 
cl_mem CreateGPUImage (unsigned int, unsigned int, unsigned int, unsigned int)
 
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 InitializeMITKImage ()
 Initialize the internal variable of type mitk::Image. More...
 
void InitializeByMitkImage (mitk::Image::Pointer _image)
 Initialze the OclImage with an mitkImage. More...
 
int GetDimension (int) const
 returns the specified image dimension size More...
 
int GetDimension () const
 returns the dimensionality of the image More...
 
unsigned int * GetDimensions ()
 returns the pointer to the array of image sizes More...
 
float GetSpacing (int)
 returns the spacing of the image for specified dimension More...
 
void GetOffset (float *) const
 Returns the image offset (needed for WorldToIndex Transform. More...
 
void SetPixelType (const cl_image_format *)
 Set the pixel type for the image to be used. More...
 
short GetBytesPerPixel () const
 
const cl_image_format * GetPixelType () const
 Get the currently used pixel type. More...
 
void SetDimensions (unsigned int *Dims)
 Set the image dimensions through an unsigned int array. More...
 
void SetDimension (unsigned short dim)
 Set the dimensionality of the image. 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

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

Protected Attributes

cl_mem m_gpuImage
 
cl_context m_context
 
unsigned int m_bufferSize
 

Detailed Description

Class implementing the image format for GPU Image Processing.

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

Exceptions
Thisclass may throw an ImageTypeIsNotSupportedByGPU, if the image format is supported by the GPU.

Definition at line 49 of file mitkOclImage.h.

Constructor & Destructor Documentation

mitk::OclImage::OclImage ( )
protected

Constructor.

Definition at line 27 of file mitkOclImage.cpp.

mitk::OclImage::~OclImage ( )
protectedvirtual

Destructor.

Definition at line 32 of file mitkOclImage.cpp.

References MITK_INFO.

Member Function Documentation

Pointer mitk::OclImage::Clone ( ) const
cl_mem mitk::OclImage::CreateGPUImage ( unsigned int  _wi,
unsigned int  _he,
unsigned int  _de,
unsigned int  _bpp 
)
short mitk::OclImage::GetBytesPerPixel ( ) const
inline

Definition at line 127 of file mitkOclImage.h.

int mitk::OclImage::GetDimension ( int  idx) const

returns the specified image dimension size

Definition at line 296 of file mitkOclImage.cpp.

References MITK_WARN.

int mitk::OclImage::GetDimension ( ) const
inline

returns the dimensionality of the image

Definition at line 109 of file mitkOclImage.h.

unsigned int* mitk::OclImage::GetDimensions ( )
inline

returns the pointer to the array of image sizes

Definition at line 115 of file mitkOclImage.h.

cl_mem mitk::OclImage::GetGPUBuffer ( )
inlinevirtual

Returns the pointer to the GPU buffer

Reimplemented from mitk::OclBaseData.

Definition at line 76 of file mitkOclImage.h.

cl_mem mitk::OclImage::GetGPUImage ( cl_command_queue  gpuComQueue)

Checks whether gpuImage is a valid clImage object.

when an oclImage gets created by an image to image filter, the output image is created by clCreateBuffer() because it is not in general possible to write to clImage directly

Definition at line 190 of file mitkOclImage.cpp.

References CHECK_OCL_ERR, MITK_INFO, and MITK_WARN.

Image::Pointer mitk::OclImage::GetMITKImage ( )
inline

Returns the pointer to the referenced mitk::Image.

Definition at line 63 of file mitkOclImage.h.

void mitk::OclImage::GetOffset ( float *  _imOffset) const

Returns the image offset (needed for WorldToIndex Transform.

Definition at line 339 of file mitkOclImage.cpp.

const cl_image_format* mitk::OclImage::GetPixelType ( ) const
inline

Get the currently used pixel type.

Returns
OpenCL Image Format struct

Definition at line 136 of file mitkOclImage.h.

float mitk::OclImage::GetSpacing ( int  idx)

returns the spacing of the image for specified dimension

Definition at line 319 of file mitkOclImage.cpp.

References MITK_WARN.

void mitk::OclImage::InitializeByMitkImage ( mitk::Image::Pointer  _image)

Initialze the OclImage with an mitkImage.

Definition at line 72 of file mitkOclImage.cpp.

References MITK_INFO.

void mitk::OclImage::InitializeMITKImage ( )

Initialize the internal variable of type mitk::Image.

Definition at line 334 of file mitkOclImage.cpp.

References mitk::Image::New().

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

Returns the status of the image buffer.

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

Definition at line 96 of file mitkOclImage.cpp.

mitk::OclImage::mitkClassMacro ( OclImage  ,
OclBaseData   
)
void mitk::OclImage::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 102 of file mitkOclImage.cpp.

static Pointer mitk::OclImage::New ( )
static
void mitk::OclImage::SetDimension ( unsigned short  dim)

Set the dimensionality of the image.

Definition at line 314 of file mitkOclImage.cpp.

void mitk::OclImage::SetDimensions ( unsigned int *  Dims)

Set the image dimensions through an unsigned int array.

Definition at line 309 of file mitkOclImage.cpp.

void mitk::OclImage::SetPixelType ( const cl_image_format *  _image)

Set the pixel type for the image to be used.

Definition at line 231 of file mitkOclImage.cpp.

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

Copies the in GMEM stored data to RAM.

Implements mitk::OclBaseData.

Definition at line 237 of file mitkOclImage.cpp.

References CHECK_OCL_ERR, MITK_INFO, mitk::Image::New(), and oclPrintMemObjectInfo().

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

Copies the RAM-stored data to GMEM.

Implements mitk::OclBaseData.

Definition at line 109 of file mitkOclImage.cpp.

References CHECK_OCL_ERR, mitk::ImageAccessorBase::GetData(), and MITK_ERROR.

Member Data Documentation

unsigned int mitk::OclImage::m_bufferSize
protected

GMEM Buffer Size

Definition at line 161 of file mitkOclImage.h.

cl_context mitk::OclImage::m_context
protected

GPU Context the Image Buffer was created in, needed for access

Definition at line 158 of file mitkOclImage.h.

cl_mem mitk::OclImage::m_gpuImage
protected

GMEM Image buffer

Definition at line 155 of file mitkOclImage.h.


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