Transfer Function Editing

A "transfer function" is a mapping from data to color and opacity.  The transfer function editor is used to control the color and opacity in the volume rendering of your data.    Generally the opacity is used to identify the values of the variable that most interesting; other values can be made transparent.   Color is used to highlight particular values, e.g. to distinguish them from other values.

VAPOR transfer function editors are available in the DVR, Iso, Probe, and 2DData Tabs.  The Flow tab has a pair of similar editors, one to control transparency and the other to control color.

Consider the following image of the transfer function editor, in which several key features have been identified.


A tool-tip dialog will appear when the mouse is hovered over the transfer function, displaying information on your variable at that point in the histogram.  "Opacity" will tell you how transparency is being applied to at that variable value (opacity of 0 is completely transparent, 1 is fully opaque).  The "Y-coord" value shows the cursor position in the current region of the transfer function as a decimal value.  "Color(HSV)" is the color being applied at that variable value, and "Histogram" shows how many datapoints have that value in the timestep (In the below figure, 790 points have the ELEVATION value 338).

The vapor transfer function editor provides control over color and opacity.  In the editor window you can manipulate color and opacity with the mouse.  The upper part of the editor window has a black background, in which is displayed a histogram and an opacity graph.   At the bottom of the editor window is a rainbow-colored color bar.  

The editor window displays the color and opacity associated with values of the variable in between the values specified as "TF Domain Bounds".  The histogram shows the frequency of data values in the interval specified by the TF Domain bounds.  You can control the data interval where the transfer function applies, by dragging the domain bar or its end-arrows at the top of the editor window.

The color is determined by the colors at a number of control points on the color bar.  By default, the color between two control points is interpolated in HSV space.   However, there is a check-box "Discrete Color Map" below each transfer function.  When checked, the color values only change at the midpoint between two control points.  Discrete colors can be used to visualize iso-lines in planar visualizations (e.g. in the Probe or in the 2D Data panel).  When "Discrete Color Map" is checked, isolines can be seen as the boundaries between the different color values.

The opacity is determined by the opacity graph.  The opacity, which takes values between 0 and 1, is linearly interpolated between its values at opacity control points.  The opacity slider applies a scale factor to the opacity values. 

Several of the buttons we are using are circled in the above figure:

  • When you click on the "Histo" button, the histogram is recalculated using the current time step of the data. Note, because of performance considerations the histogram is not updated automatically when the time step changes.
  • Clicking on the "Fit to View" button does not change the transfer function. It changes the editor display so that the left and right TF Domain Bounds match the visible editor window.
  • Clicking on the "Fit Data" button resets the editing interval of the variable to become equal to the interval of data values of the variable at the current time step, refinement level, and LOD.
  • Click on the "Load Installed TF" button to replace the current transfer function with one of many standard transfer functions provided with VAPOR.
  • Cick on the "Zoom/Pan" button to change the interval of the transfer function that is displayed.  The transfer function itself is not changed until you click again on the "Edit" button.

There are several ways of modifying the transfer function.  The color or opacity values at an existing control point can be changed by selecting the point and clicking with the right mouse button. Right-click on a desired location to create a new control point.  Existing control points can be moved by selecting and dragging them with the left mouse button.

For an example application of transfer function editing, check the Katrina Tutorial or section 1 of the VAPOR Quick Start Guide.