CustusX  16.5.0-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::VNNclAlgorithm Class Reference

#include <cxVNNclAlgorithm.h>

Classes

struct  __frameBlock_t
 

Public Types

typedef struct
cx::VNNclAlgorithm::__frameBlock_t 
frameBlock_t
 

Public Member Functions

 VNNclAlgorithm ()
 
 ~VNNclAlgorithm ()
 
virtual bool initCL (QString kernelFile, int nMaxPlanes, int nPlanes, int method, int planeMethod, int nStarts, float brightnessWeight, float newnessWeight)
 
virtual cl::Program buildCLProgram (std::string program_src, std::string kernelPath, int nMaxPlanes, int nPlanes, int method, int planeMethod, int nStarts, float brightnessWeight, float newnessWeight)
 
virtual bool reconstruct (ProcessedUSInputDataPtr input, vtkImageDataPtr outputData, float radius, int nClosePlanes)
 
virtual bool initializeFrameBlocks (frameBlock_t *framePointers, int numBlocks, ProcessedUSInputDataPtr inputFrames)
 
virtual void freeFrameBlocks (frameBlock_t *framePointers, int numBlocks)
 
virtual void fillPlaneMatrices (float *planeMatrices, ProcessedUSInputDataPtr input)
 
void setProfiling (bool on)
 
double getTotalExecutionTime ()
 
double getKernelExecutionTime ()
 

Detailed Description

Original author Tord Øygard

Definition at line 48 of file cxVNNclAlgorithm.h.

Member Typedef Documentation

A representation of a Frame block in CPU memory. Since OpenCL has an upper limit on how big memory objects can be, we need to partition the input US images into several blocks. This struct represents one such block

Constructor & Destructor Documentation

cx::VNNclAlgorithm::VNNclAlgorithm ( )

Definition at line 45 of file cxVNNclAlgorithm.cpp.

cx::VNNclAlgorithm::~VNNclAlgorithm ( )

Definition at line 57 of file cxVNNclAlgorithm.cpp.

Member Function Documentation

cl::Program cx::VNNclAlgorithm::buildCLProgram ( std::string  program_src,
std::string  kernelPath,
int  nMaxPlanes,
int  nPlanes,
int  method,
int  planeMethod,
int  nStarts,
float  brightnessWeight,
float  newnessWeight 
)
virtual

Build the OpenCL kernel

Parameters
program_srcThe kernel source code
kernelPathpath to kernel source
nMaxPlanesThe MAX_PLANES parameter of the kernel, i.e. max value of how many planes to include in the reconstruction of one voxel
nPlanesNumber of image planes in the input data set
methodThe method ID. See kernels.cl for more information
planeMethodthe plane method ID. See kernels.cl for more information
nStartsnumber of starts for multistart search for close planes
brightnessWeightThe extra weight to give pixels brighter than mean
newnessWeightThe extra weight to give pixels newer than mean
Returns
True on suc

Definition at line 78 of file cxVNNclAlgorithm.cpp.

void cx::VNNclAlgorithm::fillPlaneMatrices ( float *  planeMatrices,
ProcessedUSInputDataPtr  input 
)
virtual

Fill the supplied array of floats with the values from the transformation matrices in input. The data is stored like this: [ a b c d e f g h -> [ a b c d e f g h i j k l m n o p ] i j k l m n o p ] I.e: 16 floats per image plane, row major.

Parameters
planeMatricesPointer to array of 16*number of image planes floats where the matrices will be stored
inputThe US data - which also has position data

Definition at line 258 of file cxVNNclAlgorithm.cpp.

void cx::VNNclAlgorithm::freeFrameBlocks ( frameBlock_t framePointers,
int  numBlocks 
)
virtual

Free a set of frame blocks allocated by initializeFrameBlocks Does not free the actual frameBlock_t structure, but the data pointer is free'd. You still have to free the frameBlocks!

Parameters
framePointersPointer to first element in array of frame blocks
numBlocksnumber of blocks in the array

Definition at line 309 of file cxVNNclAlgorithm.cpp.

double cx::VNNclAlgorithm::getKernelExecutionTime ( )

Definition at line 302 of file cxVNNclAlgorithm.cpp.

double cx::VNNclAlgorithm::getTotalExecutionTime ( )

Definition at line 290 of file cxVNNclAlgorithm.cpp.

bool cx::VNNclAlgorithm::initCL ( QString  kernelFile,
int  nMaxPlanes,
int  nPlanes,
int  method,
int  planeMethod,
int  nStarts,
float  brightnessWeight,
float  newnessWeight 
)
virtual

Initialize OpenCL. This function initializes OpenCL and builds the kernel with the given parameters. Note that these parameters are set at compile time and not kernel run time. Uses buildCLProgram() to build the kernel.

Parameters
kernelFilePath to the OpenCL kernel source
nMaxPlanesThe MAX_PLANES parameter of the kernel, i.e. max value of how many planes to include in the reconstruction of one voxel
nPlanesNumber of image planes in the input data set
methodThe method ID. See kernels.cl for more information
planeMethodthe plane method ID. See kernels.cl for more information
nStartsnumber of starts for multistart search for close planes
brightnessWeightThe extra weight to give pixels brighter than mean
newnessWeightThe extra weight to give pixels newer than mean
Returns
True on success
See Also
buildCLProgram

Definition at line 60 of file cxVNNclAlgorithm.cpp.

bool cx::VNNclAlgorithm::initializeFrameBlocks ( frameBlock_t framePointers,
int  numBlocks,
ProcessedUSInputDataPtr  inputFrames 
)
virtual

Split the US input into numBlock blocks of whole frames and store them in framePointers.

Parameters
[out]framePointersPre-allocated array of numBlocks unsigned char* pointers Data will be returned here
[in]numBlocksNumber of blocks to split US input into
[in]inputFramesThe input US B-scans
Returns
true on success, false otherwise

Definition at line 99 of file cxVNNclAlgorithm.cpp.

bool cx::VNNclAlgorithm::reconstruct ( ProcessedUSInputDataPtr  input,
vtkImageDataPtr  outputData,
float  radius,
int  nClosePlanes 
)
virtual

Perform GPU Reconstruction. This function initializes the CL memory objects, calls the kernel and reads back the result, which is stored in outputData.

Parameters
inputThe input US data
outputDataThe output volume is stored here
radiusThe radius of the kernel - i.e. how far away to look for image planes to use
nClosePlanesThe number of close planes to search for
Returns
true on success

Definition at line 144 of file cxVNNclAlgorithm.cpp.

void cx::VNNclAlgorithm::setProfiling ( bool  on)

Enable/diable OpenCL profiling for this algorithm

Definition at line 282 of file cxVNNclAlgorithm.cpp.


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