Coin Logo http://www.sim.no
http://www.coin3d.org

SoTransferFunction Class Reference

Contains the transfer function definition. More...

#include <VolumeViz/nodes/SoTransferFunction.h>

Inheritance diagram for SoTransferFunction:

SoVolumeRendering

List of all members.

Public Types

enum  PredefColorMap {
  NONE = 0, GREY, GRAY = GREY, TEMPERATURE,
  PHYSICS, STANDARD, GLOW, BLUE_RED,
  SEISMIC
}
enum  ColorMapType { ALPHA, LUM_ALPHA, RGBA }

Public Member Functions

void reMap (int low, int high)
SbBool hasTransparency (void) const

Static Public Member Functions

static void initClass (void)

Public Attributes

SoSFInt32 shift
SoSFInt32 offset
SoSFEnum predefColorMap
SoSFEnum colorMapType
SoMFFloat colorMap

Protected Member Functions

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

Friends

class SoTransferFunctionP


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 pre-defined 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

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.

grey.png
GRAY  Same as GREY.
TEMPERATURE  This gradient is fully opaque.

temperature.png
PHYSICS  This gradient is fully opaque.

physics.png
STANDARD  This gradient is fully opaque.

standard.png
GLOW  This gradient is fully opaque.

glow.png
BLUE_RED  This gradient is fully opaque.

blue_red.png
SEISMIC  This gradient is partly transparent.

seismic.png

Type of colormap 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, ie. 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 / grey 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.


Member Function Documentation

void SoTransferFunction::initClass ( void   )  [static]

Sets up initialization for data common to all instances of this class, like submitting necessary information to the type system.

Reimplemented from SoVolumeRendering.

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

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]

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

See the SoTransferFunction::shift field.

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

Note that most of the pre-defined 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 pre-defined values should be used, but that the transfer function color map should be fetched from the SoTransferFunction::colorMap field instead.

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 pre-defined transfer function color maps, i.e. not equal to NONE.)

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

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.


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

Copyright © 1998-2004 by Systems in Motion AS. All rights reserved.

Generated on Mon Jul 27 22:01:15 2009 for SIMVoleon by Doxygen. 1.5.7.1