Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::OclImageToImageFilter Class Referenceabstract

The OclImageToImageFilter is the base class for all OpenCL image filter generating images. More...

#include <mitkOclImageToImageFilter.h>

Inheritance diagram for mitk::OclImageToImageFilter:
Collaboration diagram for mitk::OclImageToImageFilter:

Public Member Functions

mitk::Image::Pointer GetOutput ()
 Returns an mitk::Image::Pointer containing the filtered data. More...
 
mitk::OclImage::Pointer GetGPUOutput ()
 Returns a pointer to the graphics memory. More...
 
- Public Member Functions inherited from mitk::OclImageFilter
void SetInput (mitk::OclImage::Pointer image)
 SetInput SetInput Set the input image (as mitk::OclImage). More...
 
void SetInput (mitk::Image::Pointer image)
 SetInput Set the input image (as mitk::Image). More...
 
- Public Member Functions inherited from mitk::OclFilter
void AddSourceFile (const char *filename)
 Add a source file from the resource files to the OpenCL shader file list. Multiple files can be added to the list. More...
 
void SetCompilerFlags (const char *flags)
 Set specific compilerflags to compile the CL source. Default is set to NULL; example: "-cl-fast-relaxed-math -cl-mad-enable -cl-strict-aliasing". More...
 
virtual bool IsInitialized ()
 Returns true if the initialization was successfull. More...
 
virtual ~OclFilter ()
 Destructor. More...
 

Protected Member Functions

 OclImageToImageFilter ()
 OclImageToImageFilter Default constructor. More...
 
virtual ~OclImageToImageFilter ()
 Destructor. More...
 
virtual void Update ()=0
 (Virtual) method Update() to be implemented in derived classes. More...
 
virtual mitk::PixelType GetOutputType ()
 (Virtual) method returning the format in which the output image will be returned More...
 
bool InitExec (cl_kernel ckKernel)
 InitExec Initialize the execution. More...
 
virtual int GetBytesPerElem ()
 Get the memory size needed for each element. More...
 
- Protected Member Functions inherited from mitk::OclImageFilter
 OclImageFilter ()
 
virtual ~OclImageFilter ()
 
- Protected Member Functions inherited from mitk::OclFilter
 OclFilter ()
 Constructor. More...
 
 OclFilter (const char *filename)
 Constructor ( overloaded ) More...
 
void SetWorkingSize (unsigned int locx, unsigned int dimx, unsigned int locy=1, unsigned int dimy=1, unsigned int locz=1, unsigned int dimz=1)
 Set the working size for the following OpenCL kernel call. More...
 
bool ExecuteKernel (cl_kernel kernel, unsigned int workSizeDim)
 Execute the given kernel on the OpenCL Index-Space defined by the local and global work sizes. More...
 
bool Initialize ()
 Initialize all necessary parts of the filter. More...
 
void CompileSource ()
 Compile the program source. More...
 
void SetSourcePreambel (const char *preambel)
 Add some source code on the beginning of the loaded source. More...
 
virtual us::ModuleGetModule ()=0
 Get the Module of the filter. Needs to be implemented by every subclass. The filter will load the OpenCL sourcefiles from this module context. More...
 
void LoadSourceFiles (CStringList &SourceCodeList, ClSizeList &SourceCodeSizeList)
 Helper functions that load sourcefiles from the module context in the Initialize function. More...
 

Protected Attributes

mitk::OclImage::Pointer m_Output
 
- Protected Attributes inherited from mitk::OclImageFilter
mitk::OclImage::Pointer m_Input
 
short m_CurrentType
 
- Protected Attributes inherited from mitk::OclFilter
const char * m_ClCompilerFlags
 String that contains the compiler flags. More...
 
cl_program m_ClProgram
 The compiled OpenCL program. More...
 
cl_command_queue m_CommandQue
 Command queue for the filter. More...
 
std::string m_FilterID
 Unique ID of the filter, needs to be specified in the constructor of the derived class. More...
 
const char * m_Preambel
 source preambel for e.g. #define commands to be inserted into the OpenCL source More...
 
CStringList m_ClFiles
 List of sourcefiles that will be compiled for this filter. More...
 
bool m_Initialized
 status of the filter More...
 
vcl_size_t m_LocalWorkSize [3]
 The local work size fo the filter. More...
 
vcl_size_t m_GlobalWorkSize [3]
 The global work size of the filter. More...
 

Additional Inherited Members

- Protected Types inherited from mitk::OclFilter
typedef std::vector< const char * > CStringList
 
typedef std::vector< vcl_size_t > ClSizeList
 

Detailed Description

The OclImageToImageFilter is the base class for all OpenCL image filter generating images.

Definition at line 30 of file mitkOclImageToImageFilter.h.

Constructor & Destructor Documentation

mitk::OclImageToImageFilter::OclImageToImageFilter ( )
protected

OclImageToImageFilter Default constructor.

Definition at line 22 of file mitkOclImageToImageFilter.cpp.

References m_Output, and mitk::OclImage::New().

mitk::OclImageToImageFilter::~OclImageToImageFilter ( )
protectedvirtual

Destructor.

Definition at line 28 of file mitkOclImageToImageFilter.cpp.

Member Function Documentation

int mitk::OclImageToImageFilter::GetBytesPerElem ( )
protectedvirtual

Get the memory size needed for each element.

Reimplemented in mitk::OclBinaryThresholdImageFilter.

Definition at line 98 of file mitkOclImageToImageFilter.cpp.

mitk::OclImage::Pointer mitk::OclImageToImageFilter::GetGPUOutput ( )

Returns a pointer to the graphics memory.

Use this method when executing two and more filters on the GPU for fast access. This method does not copy the data to RAM. It returns only a pointer.

Definition at line 32 of file mitkOclImageToImageFilter.cpp.

mitk::Image::Pointer mitk::OclImageToImageFilter::GetOutput ( void  )

Returns an mitk::Image::Pointer containing the filtered data.

Definition at line 55 of file mitkOclImageToImageFilter.cpp.

References GPU_DATA, MITK_DEBUG, and mitk::Image::ReferenceMemory.

mitk::PixelType mitk::OclImageToImageFilter::GetOutputType ( )
protectedvirtual

(Virtual) method returning the format in which the output image will be returned

Reimplemented in mitk::OclBinaryThresholdImageFilter.

Definition at line 79 of file mitkOclImageToImageFilter.cpp.

References mitk::PixelType::GetPixelType().

bool mitk::OclImageToImageFilter::InitExec ( cl_kernel  ckKernel)
protected

InitExec Initialize the execution.

Parameters
ckKernelThe GPU kernel.
Exceptions
mitk::Exceptionif something goes wrong.
Returns
True for success.

Definition at line 103 of file mitkOclImageToImageFilter.cpp.

References CHECK_OCL_ERR, GetOclErrorAsString(), MITK_DEBUG, and mitkThrow.

virtual void mitk::OclImageToImageFilter::Update ( )
protectedpure virtual

(Virtual) method Update() to be implemented in derived classes.

Implemented in mitk::OclBinaryThresholdImageFilter.

Member Data Documentation

mitk::OclImage::Pointer mitk::OclImageToImageFilter::m_Output
protected

Output Image

Definition at line 56 of file mitkOclImageToImageFilter.h.

Referenced by OclImageToImageFilter().


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