boxVolSlice DSO

This DSO is under development.

Introduction

The boxVolSlice DSO creates texture mapped box and cross-sections of a 3D volume of data that can be changed in real time.

What it is

The boxVolSlice DSO generates a set of texture-mapped polygons based on a provided 3D texture and 3D box. The polygons are the six faces of the box (within the volume) and the six cross-sections through the entire volume that are coplanar with the six sides of the box. But only three of the full cross-sections are visible at one time. These are the three cross sections that are on the far side of the box relative to the viewer. The intent of displaying only the far side polygons is that those polygons could provide a backdrop or context for objects of interest displayed within the box, and that they would not obscure the interior of the box.

Here is an example of the boxVolSlice DSO being used in conjunction with the rubberbandBox DSO and the boxClip DSO.

The texture mapped polygons are being generated by the boxVolSlice DSO based on the coordinates of the box provided by the rubberbandBox DSO. This box is also being used by the boxClip DSO for clipping the cube data that is shown inside the box. Here is another view of this example:



How to use it

The user provides a 3D volume of data that serves as the texture. This is provided through a file specifed by the enviroment variable BOX_VOL_SLICE_FILE. This environment variable string has the following format:

     volumeFileName:boxSliceNodeName:parentNodeName
where Defaults if not specified: The volume file is an ascii file that has the following format:

  dim             X Y Z
  voxelFN         voxel_filename
  lutFN           lut_filename
  numComponents   1 | 2 | 3 | 4
  interpMethod    POINT | LINEAR | BILINEAR | TRILINEAR | QUADLINEAR
  whichSides      BOX | CROSS_SECTIONS | BOX&CROSS_SECTIONS
The coordinates of the box are obtained from an area of memory pointed to by a pointer provided by a call to getRubberbandBoxPtr(). This call is currently only provided by the rubberbandBox DSO; see the rubberbandBox DSO documentation. These coordinates are obtained every frame during the postFrame callback. Note that this scheme results in some problems associated with frame accuracy (synchronization).

Example

Here is a fragment of a shell script for running savgfly (diversifly) using the boxVolSlice DSO. It actually uses a several DSOs working together: rubberbandBox, slb, and boxVolSlice.

 
export SLB_1="rubberbandBoxButton"

export DF_DSO=":slb:rubberbandBox:boxVolSlice"

export BOX_VOL_SLICE_FILE="1000.subset64.vol:vol1000:world"

savgfly -$device box.savg 

The slb DSO will put button presses for wand button 1 into the dtk shared memory named rubberbandBoxButton, which is where the DSO rubberbandBox will look for it.

The environment variable BOX_VOL_SLICE_FILE tells the boxVolSlice DSO several things:

The volume file 1000.subset64.vol looks like this:

# File describing volume to be used by boxVolSlice DSO
dim            64 64 64
numComponents  1
voxelFN        1000.subset64.bin
lutFN          jgh.lut
interpMethod   POINT           # we want texture to look blocky
whichSides     cross_sections  # show the cross sections but not the box

This says that the data is 64x64x64 with one component per voxel and the binary data is contained in the file 1000.subset64.bin. The texture mapped polygons will be colored according to the lookup table in the file jgh.lut and the interpolation method will be POINT which indicates that the textures will appear blocky. Finally, the file indicates that only the cross section polygons will be displayed; the box polygons will not be displayed.

The boxVolSlice DSO picks up the coordinates of the box generated by the rubberbandBox DSO and these coordinates are used to create the cross section polygons.

See also

DSOs: rubberbandBox, boxClip, boxCull


Last revision: John Hagedorn, May 10, 2005