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:
BOX_VOL_SLICE_FILE
.
This environment variable string has the following format:
volumeFileName:boxSliceNodeName:parentNodeName
where
volumeFileName
is the name of the file describing the volume
boxSliceNodeName
is the name to be given to the pfNode
containing the box and slice polygons
parentNodeName
is the name of the node under which the box slice node is to be placed
volumeFilename
- no default, must be specified
boxSliceNodeName
- "boxVolSlice"
parentName
- "world"
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
PFTEX_
identifiers.
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).
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:
1000.subset64.vol
.
vol1000
.
world
node in
the scene graph.
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.