The data file should contain one byte per voxel, with the bytes stored in one continuous array. At present, AnimaBob does not use a file header. The X direction varies fastest, then Y and lastly Z. In other words, the data file consists of Z planes, each plane containing Y rows, each row X bytes long.
In order to render a volume of data, AnimaBob needs to know how to map the voxel value to both a color and alpha value. This is done using two tables, the color map and the alpha map. Unless an alpha map is specified, AnimaBob constructs the alpha map from the brightness of the color map. This is often the desired result, with dark colors being more transparent and bright colors more opaque. This mode is called "Auto Alpha" in AnimaBob, and can be interactively toggled on and off.
Experienced users may want to specify the alpha values separately. If an alpha map is specified, either on the command line or using the "Alpha Only" mode in Icol, then AnimaBob will turn off "Auto Alpha".
Icol's YUV color space is particularly useful when volume rendering. YUV space is a linear transform of RGB, such that Y is the brightness and U and V encode color. In approximate terms, U encodes the blue channel and V encodes red. The best feature of YUV space is that brightness can be specified independently from color. This gives direct control over opacity when using the "Auto Alpha" mode.
Although YUV space is handy for controlling brightness independently from hue, it can be hard at first to locate saturated colors. The key is to remember that blue is the least bright, followed by red, purple, green, cyan, and yellow. So if your Y value is relatively bright (say 0.70) you won't have much luck finding a deep blue, but you could get close to yellow. In YUV space, pure blue has a Y value of 0.11, U equals +0.50, and V equals -0.7 (maximum U, minimum V). Red is Y equals 0.30, U equals -0.16, and V equals +0.50 (minimum U, maximum V). Green is Y equals 0.59, U equals -0.32, and V equals -0.41 (minimum U, minimum V).
Another useful Icol technique is to flip back and forth between RGB mode and YUV mode, finding pure colors in RGB and modifying the brightness in YUV. Try also dragging knot points in the color map to new locations.
Whenever a new volume is chosen, or the alpha map changes, AnimaBob scans and marks the volume for blank regions. When rendering, AnimaBob will skip these blank regions, resulting in sometimes dramatic increases in rendering speed. Therefore, in the interest of fast rendering and clearer images, it pays to set the alpha value of uninteresting regions to zero.
To specify the alpha value independently from color, use the Alpha mode of Icol. When an alpha map is modified in Icol, the changes are automatically passed on to AnimaBob, like the color map. AnimaBob will turn off Auto Alpha mode when it is given an alpha map, so that subsequent changes to the color map will not effect the alpha map.
Using a separate alpha map is useful for hilighting ranges of values in the volume. While knot points are usually the best way to specify a color map, using brushes to sketch the alpha map in Icol can quickly accentuate or hide volume regions in AnimaBob.
By default, Icol communicates every change in the color or alpha map to AnimaBob. For larger volumes this can be tiresome, because AnimaBob scans the volume for blank regions whenever new alpha values are specified. By turning off the Auto Set Property option in Icol (in the Mode menu), Icol keeps changes to itself. With the "Auto Set Property" feature disable, to explicitly set the color map, use the Set Colormap Property command (in the File menu) in Icol. Main Window
Bob's interface consists of a main window, where the volume rendering takes plac e, and two dialogs, one for controlling the volume dimensions and the other for controlling animation. The dialogs can be hidden and displayed as needed.
The main window is divided into
a rendering area on the left and a control area on the right. The control
area has a menu bar, a scale adjustment for the alpha values, a scale
for the frame number (used for multiple data sets), and two lis
ts. The top list contains the data files, and the bottom list contains
dimensio ns settings. You can resize the main window as needed.
The "Alpha
Attenuation" slider adjusts the scale factor applied to the alpha val ues.
This scale is handy for adjusting the overall transparency of a picture,
p articularly when scaling up or down in volume size. A volume that is
twice as l arge will be approximately twice as opaque, which may not be
desired. The alpha attenuation scale can counter this effect.
The frame slider can be used to skip to a new data frame. If only one
data bric k was specified on the Bob command line, then there will be only
one frame. If there is one frame per file, then each increment of the
frame slider will open a new file. If there is more than one data brick
per file, the frame slider will
walk through the bricks in each file in order.
The file list contains one entry per data file. Clicking on a file name causes Bob to read in the first data brick in that file. Use the frame slider to acces s subsequent bricks if there is more than one brick per file. The current dimen sion settings are used to read the new data. There is currently no way to add o r delete files from the list without restarting Bob.
The dimension list is a convenient place to remember choice locations
in a large data file. The Dimension menu commands add and delete entries
in the dimension
list. Each entry defines all of the settings from the dimension dialog.
Selec
ting a new entry causes Bob to read a volume from the current data file
using th ose dimension settings.
3D Manipulation
Both the finder and volume
cube are rotated and moved using the same mouse techn iques. Button 1 of
the mouse is used to rotate the volume, button 2 pans the vo lume in the
plane of the screen, and button 3 will zoom the volume towards or aw ay
from the viewer. In all three cases, start moving the volume by clicking
wit h the button, hold the button down as you move to drag the volume,
and let up to finish.
The rotation is modeled using a trackball, positioned in the center of
the windo w. Clicking in the center of the volume window will rotate the
image about X an d Y axes, whereas clicking near the edge rotates around
the Z axis. If you keep moving the mouse as the button is released, the
volume is kicked and will keep
rotating in that direction. To stop unwanted rotation, click and release
in the same location.
Panning the volume in the plane of the screen is straightforward. Move the mous e in the vertical direction to zoom the volume closer or farther away.
Bob will automatically cut the resolution of the volume in order to achieve an i nteractive frame rate while the volume is being manipulated with the mouse. Aft er the mouse button is released the image is drawn at full resolution.
Dimension Dialog
An often used feature of Bob is
the ability to render only part of the whole dat a set. The dimension dialog
controls the portion of the data set that is viewed in the main window.
The viewed volume dimensions are specified by its size, the center of the volume , and the stride at which the volume is read. The stride value allows a large d ata set to be subsampled. For example, a 30 by 30 by 30 volume taken with a str ide of three will read every third value of a 90 by 90 by 90 volume from the dat a set. Because a 30 cubed volume will render much faster than a 90 cubed one, t he stride setting is useful for browsing a large area.
The finder view next to the dimension sliders shows the viewed
volume in relatio n to the data set. The cube will change color and position
when a new volume is read from file and/or analyzed. As the volume is
read, a red plane progresses
across the cube. The volume is being transposed and interpolated, if needed,
wh ile the cube is red. The cube builds face by face in light blue as the
volume i s analyzed for opaque regions, and finally the volume is rendered
and the cube r eturns to a darker shade of blue.
When one of the dimension dialog sliders is changed, the cube responds in size a nd also turns a yellow color to indicate that it is out of sync with the rendere d volume in the main window.
The consistency check for dimension settings is always
done in the same order. The volume size values are never changed. Next
the center of the volume is adju sted to be within the data set. Finally
the stride is decreased to fit the data set. Therefore, if you want to
increase the stride to fill the volume, you fir
st must decrease the volume size. For reference, the rotation of the finder
cube is coupled to the rotation of the volume. The finder cube can be
used as a remote method of rotating the volume,
although the finder cube cannot be kicked.
To learn how to use AnimaBob, consult the manual "All About Bob". This document only covers the command line options and resource values. An on line version of "All About Bob", without figures, is available as 'man allbob'.
Global options:
frombin ras.000 sgi.000 512 512 3
The following options control the file format, and can be interspersed with file names. A file size must be specified before the first file name. The files and options are read in order, with option settings applying to all subsequent files. File offsets and block sizes can be specified using the letters 'k' and 'm', with k standing for 1024 and m for 1024*1024. Thus, a four kilobyte block size can be specified as "4k" and a one hundred megabyte offset as "100m" or "100kk".
target = value
Lines may be commented out using '#', like shell scripts. The targets are:
size = 128 128 64
XxYxZ 'by' stride 'at' X,Y,Z
dimension = 32x32x32 by 3 at 48,101,48
If there is no target, then the string is assumed to be a file name and is added to the file list. Thus, long sequences can be built by specifying the correct parameters and appending a listing of file names.
Machines without z-buffers are limited to alpha rendering. Machines without blending hardware, such as the Personal Iris, are limited to maximum value rendering. Machines with no blending or z-buffer hardware are, in Bob's opinion, no better than a Sun.
For large volumes, it is often possible to exceed the swap space available by simply moving the size scale to its maximum value.
animabob -size 64x32x128 -number 50 brickfile
To view a brick of bytes file, named "parietallobe", containing a single, 256x256x300 brick with the color map "tissue.map":
animabob -size 256x256x300 -color tissue.map
To view the same file, specifying that 1000 frames be generated for an interpolated animation:
animabob -size 256x256x300 -color tissue.map -inter 1000
The original development of Bob was supported by the Army Research Office contract number DAALO3-89-C-0038 with the University of Minnesota Army High Performance Computing Research Center.
AnimaBob was written by Grant Erickson in 1996 as part of the Senior Honors Project in the Department of Electrical and Computer Engineering at the University of Minnesota under the advisement of Dr. Matthew O'Keefe. The AnimaBob project grew out of some key frame interpolation routines added by Amir Shinar in fulfilment of his masters thesis in 1995, also under the advisement of Dr. O'Keefe.
The original development and testing of IAnimaBob was performed at the University of Minnesota's Laboratory for Computational Science and Engineering.