Medical Imaging Interaction Toolkit  2023.12.00
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 45 of file mitkOclImage.h.

Constructor & Destructor Documentation

◆ OclImage()

mitk::OclImage::OclImage ( )
protected

Constructor.

◆ ~OclImage()

virtual mitk::OclImage::~OclImage ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ Clone()

Pointer mitk::OclImage::Clone ( ) const

◆ CreateGPUImage()

cl_mem mitk::OclImage::CreateGPUImage ( unsigned int  ,
unsigned int  ,
unsigned int  ,
unsigned int   
)

Create the GPU buffer for image

◆ GetBytesPerPixel()

short mitk::OclImage::GetBytesPerPixel ( ) const
inline

Definition at line 124 of file mitkOclImage.h.

◆ GetDimension() [1/2]

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

returns the dimensionality of the image

Definition at line 106 of file mitkOclImage.h.

◆ GetDimension() [2/2]

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

returns the specified image dimension size

◆ GetDimensions()

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

returns the pointer to the array of image sizes

Definition at line 112 of file mitkOclImage.h.

◆ GetGPUBuffer()

cl_mem mitk::OclImage::GetGPUBuffer ( )
inlinevirtual

Returns the pointer to the GPU buffer

Reimplemented from mitk::OclBaseData.

Definition at line 72 of file mitkOclImage.h.

◆ GetGPUImage()

cl_mem mitk::OclImage::GetGPUImage ( cl_command_queue  )

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

◆ GetMITKImage()

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

Returns the pointer to the referenced mitk::Image.

Definition at line 59 of file mitkOclImage.h.

◆ GetOffset()

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

Returns the image offset (needed for WorldToIndex Transform.

◆ GetPixelType()

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

Get the currently used pixel type.

Returns
OpenCL Image Format struct

Definition at line 133 of file mitkOclImage.h.

◆ GetSpacing()

float mitk::OclImage::GetSpacing ( int  )

returns the spacing of the image for specified dimension

◆ InitializeByMitkImage()

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

Initialze the OclImage with an mitkImage.

◆ InitializeMITKImage()

void mitk::OclImage::InitializeMITKImage ( )

Initialize the internal variable of type mitk::Image.

◆ IsModified()

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

Returns the status of the image buffer.

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

◆ mitkClassMacro()

mitk::OclImage::mitkClassMacro ( OclImage  ,
OclBaseData   
)

◆ Modified()

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 )

◆ New()

static Pointer mitk::OclImage::New ( )
static

◆ SetDimension()

void mitk::OclImage::SetDimension ( unsigned short  dim)

Set the dimensionality of the image.

◆ SetDimensions()

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

Set the image dimensions through an unsigned int array.

◆ SetPixelType()

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

Set the pixel type for the image to be used.

◆ TransferDataToCPU()

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

Copies the in GMEM stored data to RAM.

Implements mitk::OclBaseData.

◆ TransferDataToGPU()

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

Copies the RAM-stored data to GMEM.

Implements mitk::OclBaseData.

Member Data Documentation

◆ m_bufferSize

unsigned int mitk::OclImage::m_bufferSize
protected

GMEM Buffer Size

Definition at line 158 of file mitkOclImage.h.

◆ m_context

cl_context mitk::OclImage::m_context
protected

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

Definition at line 155 of file mitkOclImage.h.

◆ m_gpuImage

cl_mem mitk::OclImage::m_gpuImage
protected

GMEM Image buffer

Definition at line 152 of file mitkOclImage.h.


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