Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
Class implementing the image format for GPU Image Processing. More...
#include <mitkOclImage.h>
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... | |
![]() | |
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... | |
![]() | |
OclBaseData () | |
Default constructor. More... | |
virtual | ~OclBaseData () |
Default destructor. More... | |
Protected Attributes | |
cl_mem | m_gpuImage |
cl_context | m_context |
unsigned int | m_bufferSize |
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
This | class may throw an ImageTypeIsNotSupportedByGPU, if the image format is supported by the GPU. |
Definition at line 45 of file mitkOclImage.h.
|
protected |
Constructor.
Definition at line 23 of file mitkOclImage.cpp.
|
protectedvirtual |
Pointer mitk::OclImage::Clone | ( | ) | const |
cl_mem mitk::OclImage::CreateGPUImage | ( | unsigned int | _wi, |
unsigned int | _he, | ||
unsigned int | _de, | ||
unsigned int | _bpp | ||
) |
Create the GPU buffer for image
Definition at line 37 of file mitkOclImage.cpp.
References CHECK_OCL_ERR, OclResourceService::GetContext(), us::GetModuleContext(), ModuleContext::GetService(), ModuleContext::GetServiceReference(), m_bufferSize, m_gpuImage, MAX_DIMS, and MITK_INFO.
|
inline |
Definition at line 124 of file mitkOclImage.h.
int mitk::OclImage::GetDimension | ( | int | idx | ) | const |
returns the specified image dimension size
Definition at line 306 of file mitkOclImage.cpp.
References MITK_WARN.
|
inline |
returns the dimensionality of the image
Definition at line 106 of file mitkOclImage.h.
|
inline |
returns the pointer to the array of image sizes
Definition at line 112 of file mitkOclImage.h.
|
inlinevirtual |
Returns the pointer to the GPU buffer
Reimplemented from mitk::OclBaseData.
Definition at line 72 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 200 of file mitkOclImage.cpp.
References CHECK_OCL_ERR, m_gpuImage, MITK_INFO, and MITK_WARN.
|
inline |
Returns the pointer to the referenced mitk::Image.
Definition at line 59 of file mitkOclImage.h.
void mitk::OclImage::GetOffset | ( | float * | _imOffset | ) | const |
Returns the image offset (needed for WorldToIndex Transform.
Definition at line 349 of file mitkOclImage.cpp.
|
inline |
Get the currently used pixel type.
Definition at line 133 of file mitkOclImage.h.
float mitk::OclImage::GetSpacing | ( | int | idx | ) |
returns the spacing of the image for specified dimension
Definition at line 329 of file mitkOclImage.cpp.
References MITK_WARN.
void mitk::OclImage::InitializeByMitkImage | ( | mitk::Image::Pointer | _image | ) |
Initialze the OclImage with an mitkImage.
Definition at line 68 of file mitkOclImage.cpp.
References m_bufferSize, m_gpuImage, and MITK_INFO.
void mitk::OclImage::InitializeMITKImage | ( | ) |
Initialize the internal variable of type mitk::Image.
Definition at line 344 of file mitkOclImage.cpp.
References mitk::Image::New().
bool mitk::OclImage::IsModified | ( | int | _type | ) |
Returns the status of the image buffer.
_type | The flag to specify the buffer type ( GPU / CPU ) |
Definition at line 92 of file mitkOclImage.cpp.
mitk::OclImage::mitkClassMacro | ( | OclImage | , |
OclBaseData | |||
) |
void mitk::OclImage::Modified | ( | int | _type | ) |
Set the modified flag for one of the buffers.
_type | The flag to specify the buffer type ( GPU / CPU ) |
Definition at line 98 of file mitkOclImage.cpp.
|
static |
Referenced by mitk::OclImageToImageFilter::OclImageToImageFilter(), and mitk::OclImageFilter::SetInput().
void mitk::OclImage::SetDimension | ( | unsigned short | dim | ) |
Set the dimensionality of the image.
Definition at line 324 of file mitkOclImage.cpp.
void mitk::OclImage::SetDimensions | ( | unsigned int * | Dims | ) |
Set the image dimensions through an unsigned int array.
Definition at line 319 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 241 of file mitkOclImage.cpp.
|
virtual |
Copies the in GMEM stored data to RAM.
Implements mitk::OclBaseData.
Definition at line 247 of file mitkOclImage.cpp.
References CHECK_OCL_ERR, m_bufferSize, m_gpuImage, MITK_INFO, mitk::Image::New(), and oclPrintMemObjectInfo().
|
virtual |
Copies the RAM-stored data to GMEM.
Implements mitk::OclBaseData.
Definition at line 105 of file mitkOclImage.cpp.
References CHECK_OCL_ERR, OclResourceService::GetContext(), mitk::ImageAccessorBase::GetData(), us::GetModuleContext(), ModuleContext::GetService(), ModuleContext::GetServiceReference(), m_gpuImage, MITK_ERROR, and mitkThrowException.
|
protected |
GMEM Buffer Size
Definition at line 158 of file mitkOclImage.h.
Referenced by CreateGPUImage(), InitializeByMitkImage(), and TransferDataToCPU().
|
protected |
GPU Context the Image Buffer was created in, needed for access
Definition at line 155 of file mitkOclImage.h.
|
protected |
GMEM Image buffer
Definition at line 152 of file mitkOclImage.h.
Referenced by CreateGPUImage(), GetGPUImage(), InitializeByMitkImage(), TransferDataToCPU(), TransferDataToGPU(), and ~OclImage().