FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
fast::TransferFunction Class Reference

#include <TransferFunction.hpp>

Public Member Functions

 TransferFunction ()
 
 TransferFunction (std::initializer_list< float > values)
 
int addPoint (float intensity, Vector4f color)
 
void removePoint (int i)
 
void clear ()
 
int getSize () const
 
std::tuple< float, Vector4f > getPoint (int i) const
 
cl::Buffer getAsOpenCLBuffer (OpenCLDevice::pointer device) const
 

Static Public Member Functions

static TransferFunction CT_Blood_And_Bone ()
 
static TransferFunction CT_Bone ()
 
static TransferFunction CT_Blood ()
 
static TransferFunction Ultrasound ()
 

Protected Member Functions

void checkData () const
 

Protected Attributes

std::vector< float > m_data
 

Detailed Description

A class for defining a transfer function used in volume rendering. The transfer function contains a set of 5-tuple points (intensity, red, green, blue, alpha).

Constructor & Destructor Documentation

◆ TransferFunction() [1/2]

fast::TransferFunction::TransferFunction ( )
inline

Creates an empty transfer function

◆ TransferFunction() [2/2]

fast::TransferFunction::TransferFunction ( std::initializer_list< float >  values)

Initialize the transfer function. The input values have to be a multiple of 5. Thus a set of 5-tuples (intensity, red, green, blue, alpha)

Parameters
values

Member Function Documentation

◆ addPoint()

int fast::TransferFunction::addPoint ( float  intensity,
Vector4f  color 
)

Add a point to the transfer function. Intensity must be larger than previous point. I.e. the transfer function has to be sorted on increasing intensity

Parameters
intensity
color(red, green, blue, alpha)
Returns
index

◆ checkData()

void fast::TransferFunction::checkData ( ) const
protected

Validate the internal data structure of TransferFunction. Throws exception if invalid.

◆ clear()

void fast::TransferFunction::clear ( )

Remove all points in the transfer function.

◆ CT_Blood()

static TransferFunction fast::TransferFunction::CT_Blood ( )
inlinestatic

◆ CT_Blood_And_Bone()

static TransferFunction fast::TransferFunction::CT_Blood_And_Bone ( )
inlinestatic

◆ CT_Bone()

static TransferFunction fast::TransferFunction::CT_Bone ( )
inlinestatic

◆ getAsOpenCLBuffer()

cl::Buffer fast::TransferFunction::getAsOpenCLBuffer ( OpenCLDevice::pointer  device) const

Create an OpenCL buffer from the transfer function data.

Parameters
deviceOpenCL device to transfer data to
Returns
OpenCL buffer

◆ getPoint()

std::tuple<float, Vector4f> fast::TransferFunction::getPoint ( int  i) const

Get intensity and color at index i

Parameters
iindex
Returns
2-tuple of intensity and color(red, green, blue, alpha)

◆ getSize()

int fast::TransferFunction::getSize ( ) const
Returns
number of points in the transfer function

◆ removePoint()

void fast::TransferFunction::removePoint ( int  i)

Remove transfer function point at index i

Parameters
iindex

◆ Ultrasound()

static TransferFunction fast::TransferFunction::Ultrasound ( )
inlinestatic

Member Data Documentation

◆ m_data

std::vector<float> fast::TransferFunction::m_data
protected

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