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

The OclBinaryThresholdImageFilter computes a binary segmentation based on given threshold values. More...

#include <mitkOclBinaryThresholdImageFilter.h>

Inheritance diagram for mitk::OclBinaryThresholdImageFilter:
Collaboration diagram for mitk::OclBinaryThresholdImageFilter:

Public Member Functions

 mitkClassMacroItkParent (OclBinaryThresholdImageFilter, itk::Object)
 
void SetInput (Image::Pointer image)
 SetInput Set the input image. Only 3D images are supported for now. More...
 
void Update ()
 
void SetLowerThreshold (int lowerThreshold)
 
void SetUpperThreshold (int upperThreshold)
 
void SetOutsideValue (int outsideValue)
 
void SetInsideValue (int insideValue)
 
- Public Member Functions inherited from mitk::OclImageToImageFilter
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...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 OclBinaryThresholdImageFilter ()
 
virtual ~OclBinaryThresholdImageFilter ()
 
bool Initialize ()
 
void Execute ()
 
mitk::PixelType GetOutputType ()
 (Virtual) method returning the format in which the output image will be returned More...
 
int GetBytesPerElem ()
 Get the memory size needed for each element. More...
 
virtual us::ModuleGetModule ()
 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...
 
- Protected Member Functions inherited from mitk::OclImageToImageFilter
 OclImageToImageFilter ()
 OclImageToImageFilter Default constructor. More...
 
virtual ~OclImageToImageFilter ()
 Destructor. More...
 
bool InitExec (cl_kernel ckKernel)
 InitExec Initialize the execution. 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...
 
void LoadSourceFiles (CStringList &SourceCodeList, ClSizeList &SourceCodeSizeList)
 Helper functions that load sourcefiles from the module context in the Initialize function. More...
 

Additional Inherited Members

- Protected Types inherited from mitk::OclFilter
typedef std::vector< const char * > CStringList
 
typedef std::vector< vcl_size_t > ClSizeList
 
- Protected Attributes inherited from mitk::OclImageToImageFilter
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...
 

Detailed Description

The OclBinaryThresholdImageFilter computes a binary segmentation based on given threshold values.

Documentation

The filter requires two threshold values ( the upper and the lower threshold ) and two image values ( inside and outside ). The resulting voxel of the segmentation image is assigned the inside value 1 if the image value is between the given thresholds and the outside value otherwise.

Definition at line 35 of file mitkOclBinaryThresholdImageFilter.h.

Constructor & Destructor Documentation

mitk::OclBinaryThresholdImageFilter::OclBinaryThresholdImageFilter ( )
protected
mitk::OclBinaryThresholdImageFilter::~OclBinaryThresholdImageFilter ( )
protectedvirtual

Destructor

Definition at line 33 of file mitkOclBinaryThresholdImageFilter.cpp.

Member Function Documentation

void mitk::OclBinaryThresholdImageFilter::Execute ( )
protected

Definition at line 59 of file mitkOclBinaryThresholdImageFilter.cpp.

References CHECK_OCL_ERR, GPU_DATA, and MITK_ERROR.

int mitk::OclBinaryThresholdImageFilter::GetBytesPerElem ( )
inlineprotectedvirtual

Get the memory size needed for each element.

Reimplemented from mitk::OclImageToImageFilter.

Definition at line 103 of file mitkOclBinaryThresholdImageFilter.h.

us::Module * mitk::OclBinaryThresholdImageFilter::GetModule ( )
protectedvirtual

Get the Module of the filter. Needs to be implemented by every subclass. The filter will load the OpenCL sourcefiles from this module context.

Implements mitk::OclFilter.

Definition at line 87 of file mitkOclBinaryThresholdImageFilter.cpp.

References ModuleContext::GetModule(), and us::GetModuleContext().

mitk::PixelType mitk::OclBinaryThresholdImageFilter::GetOutputType ( )
inlineprotectedvirtual

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

Reimplemented from mitk::OclImageToImageFilter.

Definition at line 98 of file mitkOclBinaryThresholdImageFilter.h.

bool mitk::OclBinaryThresholdImageFilter::Initialize ( )
protected
mitk::OclBinaryThresholdImageFilter::mitkClassMacroItkParent ( OclBinaryThresholdImageFilter  ,
itk::Object   
)
static Pointer mitk::OclBinaryThresholdImageFilter::New ( )
static
void mitk::OclBinaryThresholdImageFilter::SetInput ( Image::Pointer  image)

SetInput Set the input image. Only 3D images are supported for now.

Parameters
imagea 3D image.
Exceptions
mitk::Exceptionif the dimesion is not 3.

Definition at line 106 of file mitkOclBinaryThresholdImageFilter.cpp.

References mitkThrowException, and mitk::OclImageFilter::SetInput().

void mitk::OclBinaryThresholdImageFilter::SetInsideValue ( int  insideValue)
inline

Set the inside value

Parameters
valThe inside value

Definition at line 80 of file mitkOclBinaryThresholdImageFilter.h.

void mitk::OclBinaryThresholdImageFilter::SetLowerThreshold ( int  lowerThreshold)
inline

Set the lower threshold

Parameters
thrThreshold value

Definition at line 55 of file mitkOclBinaryThresholdImageFilter.h.

void mitk::OclBinaryThresholdImageFilter::SetOutsideValue ( int  outsideValue)
inline

Set the outside value

Parameters
valThe outside value

Definition at line 72 of file mitkOclBinaryThresholdImageFilter.h.

void mitk::OclBinaryThresholdImageFilter::SetUpperThreshold ( int  upperThreshold)
inline

Set the upper threshold

Parameters
thrThreshold value

Definition at line 63 of file mitkOclBinaryThresholdImageFilter.h.

void mitk::OclBinaryThresholdImageFilter::Update ( )
virtual

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