SIMVoleon  2.1.0
Coin3D volume rendering library
Loading...
Searching...
No Matches
SoTransferFunction Class Reference

Contains the transfer function definition. More...

#include <VolumeViz/nodes/SoTransferFunction.h>

Inheritance diagram for SoTransferFunction:
SoVolumeRendering SoNode

Public Types

enum  ColorMapType { ALPHA , LUM_ALPHA , RGBA }
 
enum  PredefColorMap {
  NONE = 0 , GREY , GRAY = GREY , TEMPERATURE ,
  PHYSICS , STANDARD , GLOW , BLUE_RED ,
  SEISMIC
}
 
- Public Types inherited from SoVolumeRendering
enum  HW_Feature { HW_VOLUMEPRO , HW_3DTEXMAP , HW_TEXCOLORMAP , HW_TEXCOMPRESSION }
 
enum  HW_SupportStatus { NO , YES , UNKNOWN }
 

Public Member Functions

SbBool hasTransparency (void) const
 
void reMap (int low, int high)
 
- Public Member Functions inherited from SoVolumeRendering
HW_SupportStatus isSupported (HW_Feature feature)
 

Static Public Member Functions

static void initClass (void)
 
- Static Public Member Functions inherited from SoVolumeRendering
static SbBool getDelayedRendering (void)
 
static SbBool getReadAlternateRep (void)
 
static SbBool getWriteAlternateRep (void)
 
static void init (void)
 
static void initClass (void)
 
static void setDelayedRendering (SbBool flag)
 
static void setReadAlternateRep (SbBool flag)
 
static void setWriteAlternateRep (SbBool flag)
 

Public Attributes

SoMFFloat colorMap
 
SoSFEnum colorMapType
 
SoSFInt32 offset
 
SoSFEnum predefColorMap
 
SoSFInt32 shift
 

Protected Member Functions

virtual void callback (SoCallbackAction *action)
 
virtual void doAction (SoAction *action)
 
virtual void GLRender (SoGLRenderAction *action)
 
virtual void pick (SoPickAction *action)
 

Detailed Description

Contains the transfer function definition.

This node sets up the mapping from voxel data values to actual on-screen color values and transparency / opaqueness.

It has a set of predefined color maps, commonly used in e.g. seismic visualization, and the option to set up one's own free-form color map lookup table (by setting SoTransferFunction::predefColorMap to NONE).

Member Enumeration Documentation

◆ ColorMapType

Type of color map array. Defines the possible values for the SoTransferFunction::colorMapType field.

Enumerator
ALPHA 

Each color entry in the transfer function has only one component, so the SoTransferFunction::colorMap field should consist of exactly 256 float values, each value representing a transparency value. The RGB colors will all be set to [1,1,1], i.e. all white.

LUM_ALPHA 

Each transfer function color map entry in SoTransferFunction::colorMap has two components, i.e. two floats, so the field should contain exactly 256*2 = 512 values. The first float value of each pair is taken to be an intensity / gray color value, and the second float of each pair is a transparency value (as for the ALPHA enum).

RGBA 

Four floats are used to specify each color of the transfer function. SoTransferFunction::colorMap should consist of exactly 256*4 = 1024 float values. Each quadruple consist of intensity values for red, green, and blue, and then the fourth value is an alpha value, as for LUM_ALPHA and ALPHA.

◆ PredefColorMap

Predefined color transfer functions, each containing exactly 256 colors.

Enumerator
NONE 

If this is set, the SoTransferFunction::colorMap field must be used.

GREY 

Default transfer function color map. The checker board indicates that this gradient is partly transparent.

GRAY 

Same as GREY.

TEMPERATURE 

This gradient is fully opaque.

PHYSICS 

This gradient is fully opaque.

STANDARD 

This gradient is fully opaque.

GLOW 

This gradient is fully opaque.

BLUE_RED 

This gradient is fully opaque.

SEISMIC 

This gradient is partly transparent.

Member Function Documentation

◆ reMap()

void SoTransferFunction::reMap ( int low,
int high )

Set two thresholds, where all transfer function mappings that ends up below the low value or above the high value are set to be completely transparent.

Initial default values are [0, 65535].

Member Data Documentation

◆ colorMap

SoMFFloat SoTransferFunction::colorMap

An array of floats describing the transfer function. Each value must be normalized to be within [0.0, 1.0] for the intensity value of a color, or the alpha value for transparency.

The array must contain 256 colors. The number of floats needed in the array for each color depends on the SoTransferFunction::ColorMapType setting.

◆ colorMapType

SoSFEnum SoTransferFunction::colorMapType

This field specifies how the SoTransferFunction::colorMap field should be interpreted when SoTransferFunction::predefColorMap is set to SoTransferFunction::NONE.

(Note that it will not have any effect when SoTransferFunction::predefColorMap is set to any of the actual predefined transfer function color maps, i.e. not equal to NONE.)

See SoTransferFunction::ColorMapType for what possible values this field can have, and their semantics.

◆ offset

SoSFInt32 SoTransferFunction::offset

See the SoTransferFunction::shift field.

◆ predefColorMap

SoSFEnum SoTransferFunction::predefColorMap

Sets up the transfer function to use. See SoTransferFunction::PredefColorMap for a list of the predefined color maps.

Note that most of the predefined color maps are all opaque, even for data value 0. This will often cause the unwanted behavior that the full data set will be completely opaque for visualization, so only the outer "walls" of the volume are shown. To avoid this, use the SoTransferFunction::reMap() method to "narrow" the data values that are to be rendered according to the transfer function (all values outside of the given range will then be fully transparent).

The value SoTransferFunction::NONE has special meaning: it signifies that none of the predefined values should be used, but that the transfer function color map should be fetched from the SoTransferFunction::colorMap field instead.

◆ shift

SoSFInt32 SoTransferFunction::shift

Used to shift the voxel attribute value before assigning a color value from the transfer function color map. In pseudo code:

colorvalue = transferfunction[(voxelvalue << shift) + offset]
SoSFInt32 shift
Definition SoTransferFunction.h:71
SoSFInt32 offset
Definition SoTransferFunction.h:72

(offset is the value of the SoTransferFunction::offset field.)


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