Click and Drag circular controlpoints of transfer function widget to adjust position and transparency.
Double-click circular controlpoints of transfer function widget to pick or adjust a color value. The color value can be specified using either the hue slider and the saturation-/value picker or by entering RGB values in the input fields.
Click and Drag rectangular anchor of transfer function widget to move transfer function widget. Hold the Shift key while dragging to lock dragging direction to either horizontal or vertical dragging.
To add a controlpoint, either double-click or hold the Shift key and click on the line connecting the controlpoints.
Hold the Shift key and click on the handle to
delete a controlpoint, or bring up the context menu with a right click.
Click and Drag the vertical edges of transfer function widget to horizontally scale the widget.
Right-click the rectangular anchor of a transfer function widget to bring up the context menu. You can delete the widget from this context menu, or change the layer ordering of the widgets.
Right-click any place in the transfer function editor to add a new transfer function widget and choose from a number of presets.
Play around with the parameters of the volume rendering by adjusting the transfer function in the transfer function editor, picking a volume from the upper-right menu and modifying sampling rate and alpha correction.[ view fullscreen ]
Resulting transfer function
tf_panel.getTF()
returns an array of [ value, { r, g, b, a } ] items.
The transfer function generated from these values looks like this:
Options
The Transfer Function Editor's look and feel is customizable using multiple options passed when the editor is instantiated. All options are substituted by default values if not specified.
The options are passed as a JSON object and can be queried from the editor using tf_panel.getOptions()
panel {
options for the appearance of the main transfer function editor
width
[ number ] total width of transfer function editor (default: 650)
height
[ number ] total height of transfer function editor (default: 170)
[ boolean ] creates vertical button on left of panel to collapse/expand panel (default: false)
showTFResult
[ boolean ] specifies whether a bottom bar should show the result of the alpha blended transfer function widgets (default: false)
resultHeight
[ number ] height of result bar (default: 20)
resultBackground
[ css ] specifies css background attribute for result bar (default: #000000)
colorScheme
[ 'dark', 'light' or 'blue' ] specifies the color scheme for the context menus, tooltips and color picker (default: 'dark')
}
histogram {
options for the histogram displayed in the back of the editor (optional)
fillColor
[ color ] fill color for the histogram SVG (default: #333333)
lineColor
[ color ] line color for the histogram SVG (default: #666666)
style
[ 'polygon' or 'bars' ] specifies whether the histogram should be plotted as a polyline or vertical rectangular bars (default: 'polygon')
scale
[ function ] (mathematical) function by which the histogram values should be scaled (e.g. logarithmic, ...) (default: Math.log)
overlayUnscaled
[ boolean ] whether the histogram (scaled by the 'scale' function) should be overlayed with an unscaled version (default: true)
}
gradientPresets {
options for the gradient presets available when adding a new widget (right click context menu)
defaultPresets
[ boolean ] specifies whether the default presets should be loaded and appended to the custom presets. If presets array is empty, default presets will be loaded anyway. (default: true)