Modern 1D transfer function for classification during rendering.
A 1D transfer function describes a mapping from image intensities to the optical properties of color and opacity. In this implementation, the transfer function is either described by a set of tissues - each consisting of a set of key points - or a look-up-table (LUT). Keypoint mode: each key point defines an RGBA color for a given intensity. Colors are linearly interpolated between key points of the same tissue. LUT mode: the transfer function is directly defined by a texture in form of a 1D SharedImage of type float.
Both image intensities and colors are defined in normalized [0..1] space. The windowing is defined in original pixel value domain (e.g. Hounsfield units).
- See also
- TransferFunctionTissue ,
|
| | TransferFunction (vec2 windowingRange=vec2(0.0, 1.0), int textureSize=256) |
| | Default constructor.
|
|
| TransferFunction (const TransferFunction &rhs) |
|
TransferFunction & | operator= (TransferFunction rhs) |
|
bool | operator== (const TransferFunction &other) const |
|
bool | operator!= (const TransferFunction &other) const |
|
void | invert () |
| | Inverts this transfer function.
|
| void | setDirty () |
| | Marks the textures of this transfer function as dirty.
|
|
const SharedImage * | standardTexture () const |
| | Returns the image storing the standard 1D TF. TransferFunction owns this pointer; it may be invalidated as soon as the TF changes.
|
|
const SharedImage * | preIntTexture () const |
| | Returns the image storing the pre-integrated TF. TransferFunction owns this pointer; it may be invalidated as soon as the TF changes.
|
|
vec2 | opaqueRange () const |
| | Returns the range of intensities where this transfer function is opaque.
|
| void | addTissue (std::unique_ptr< TransferFunctionTissue > tissue) |
| | Adds the given texture to this TF.
|
| void | removeTissue (int index) |
| | Removes the given texture from this TF.
|
|
void | clearTissues () |
| | Removes all tissues from this TF.
|
| void | pushTissueToFront (int tissueIndex) |
| | Pushes the given tissue to the front of the list.
|
|
void | deriveFrom (const GlImage &img, int maxKeypoints=12) |
| | Derives a custom TF from a GlImage.
|
| virtual void | configureDefaults () |
| | Retrieve the properties of this object, replaces values with their defaults and sets it again.
|
|
void | registerParameter (ParameterBase *param) |
| | Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
|
|
void | unregisterParameter (const ParameterBase *param) |
| | Remove the given Parameter or SubProperty from the list of registered parameters.
|
|
| Configurable (const Configurable &rhs) |
|
| Configurable (Configurable &&rhs) noexcept |
|
Configurable & | operator= (const Configurable &) |
|
Configurable & | operator= (Configurable &&) noexcept |
|
| bool | empty () const |
|
const std::vector< std::unique_ptr< TransferFunctionTissue > > & | tissues () const |
| | Returns the list of all tissues.
|
|
TransferFunctionTissue * | tissue (int index) |
| | Returns the tissue at the given index.
|
|
void | setLUT (std::unique_ptr< SharedImage > lut) |
| | Set 1D standard TF with an image as look-up-table and clear all tissues.
|
|
void | removeLUT () |
| | Remove the 1D standard TF and change mode to keypoints.
|
|
Mode | mode () |
| | Returns the mode which defines the rendering of the TF.
|
|
vec2 | windowingRange () const |
| | Convenience function to return the range of intensities of the applied windowing (original values).
|
|
void | setWindowingRange (const vec2 &newRange) |
| | Convenience function to set the range of intensities of the applied windowing to newRange (original values).
|
|
double | window () const |
| | Return the size of the windowing window.
|
|
void | setWindow (double value) |
| | Set the size of the windowing window.
|
|
double | level () const |
| | Return the center of the windowing window (level).
|
|
void | setLevel (double value) |
| | Set the center of the windowing window (level).
|
|
void | setWindowLevel (double window, double level) |
| | Convenience method for setting the windowing range based on window and level.
|
|
const std::string & | presetName () const |
| | Gets the name of the original preset when this transfer function was created (may be the preset name, name of the file).
|
|
void | setPresetName (const std::string &presetName) |
| | Sets the name of the original preset when this transfer function was created (may be the preset name, name of the file).
|
|
void | setTextureSize (int value) |
| | Sets the size of the transfer function texture.
|