3D Volume Rendering Using VolPack

VolPack is a library for rendering three dimensional data. It uses voxels and shear-warp factorization to turn the three dimensional data into two dimensional images.

Display of the data can be done using a Tcl/Tk program called vprender. Building VolPack was fairly easy. Building vprender was a royal pain.

Obtaining and Building VolPack

The VolPack distribution is at ftp://graphics.stanford.edu:/pub/volpack/volpack-1.0b3.tar.Z. It compiled cleanly after downloading.

    ./configure --prefix=$HOME
    make install
was all that was needed.

Obtaining and Building Vprender

Vprender was more troublesome. Vprender is found the same place as VolPack; ftp://graphics.stanford.edu:/pub/volpack/vprender-2.0b.tar.Z. It did not compile cleanly. In fact, it requires a ridiculous number of supporting files in order to run. Not only does it need (old, obsolete) versions of Tcl and Tk, but it needs object-oriented extensions to Tcl, and some graphics extensions ( photos, tiffs) to tk.

Building Tcl/Tk

The first two supporting packages, Tcl and Tk, installed very nicely.

    ./configure --prefix=$HOME
    make install
for each was about all that was necessary. This is quality software.

Building Photo extension to Tk

Other files were not as easy. photo-2.4.tar.gz required patching the Tk installation, and rebuilding Tk. This was one of the more successful endeavors.

Building Itcl

Itcl (object-oriented Tcl) made me uneasy. The package didn't use GNU Autoconf properly; it's use was awkward at best. When Autoconf works properly, everything is great, so the mishandling made me awkward. But things worked out okay in the end. Itcl compiled successfully, although not as a shared library.

Building the Tiff library

At first, I didn't want to build the tiff library, because it's configure script didn't even understand the --prefix option. However, I had no choice. Vprender wanted the tiff code. Bleargh.

I configured with ./configure -with-CC=cc. This still didn't work properly. The guy who wrote this should learn how to generate proper Autoconf scripts. I had to manually type in where I wanted the files to go. I ended up with configuration parameters of

    [ 1] Directory for tools:               /u1/mit-26/bin
    [ 2] Directory for libraries:           /u1/mit-26/lib
    [ 3] Directory for include files:       /u1/mit-26/include
    [ 4] Directory for manual pages:        /u1/mit-26/man
    [ 5] Manual page installation scheme:   sysv-source-cat-strip
I then built it, using make and make -install. What a mess. I have no respect for this program.

Building Vprender

I finally got libtiff built. Building vprender was still frustrating, because the vprender program didn't use Autoconf any better than the tiff library did. It couldn't locate libraries that I had just finished installing all around it. It couldn't even locate -lX11! I had to tweak quite a bit by hand to get things to work. What finally made things work is when I added lines

    /usr/openwin/lib \
    $HOME/lib \
to the VPR_LIBRARY_PATH in config.paths, and
    /usr/openwin/include \
    $HOME/include \
to the VPR_INCLUDE_PATH in config.paths. But I'm very disappointed that configure wasn't smart enough to locate -lX11 on its own.

Once configure finished, I tried to make the code. This was treacherous, too. I got many errors that I did not fully understand. I resolved them by making changes that seemed as innocent as possible, until the compiler stopped complaining. It worked okay. I was able to get by with a minimum of mysterious changes.

Testing it on Data

The ftp machine graphics.stanford.edu has a nice directory of data files which can be used to test the rendering abilities of VolPack. I downloaded all of the data. To test it, I would have to run the vprender program.

But I couldn't run the program! Trying run it gave the error message:

    ld.so.1: vprender: fatal: libtiff.so.3: can't open file: errno=2
So, I was frustrated. I recompiled, except this time I explicitly included the file $HOME/lib/libtiff.a on the link line, instead of calling it as -ltiff.

Finally. It ran.

The Data

I linked the data files from the stanford site into the demo directory. The program vprdemo runs the programs just fine. Some of the data sets are large:

[~/src/vprender-2.0b/demo]% ls -lF ../../data/*/*{den,vprdemo}
-rw-r--r--   1 mit-26  10944574  May 20  ../../data/brain/bigbrain.den
-rw-r--r--   1 mit-26      5276  May 20  ../../data/brain/bigbrain.vprdemo
-rw-r--r--   1 mit-26   7143486  May 20  ../../data/brain/brain.den
-rw-r--r--   1 mit-26   1376318  May 20  ../../data/brain/brainsmall.den
-rw-r--r--   1 mit-26      5289  May 20  ../../data/brain/brainsmall.vprdemo
-rw-r--r--   1 mit-26   7209022  May 20  ../../data/engine/engine.den
-rw-r--r--   1 mit-26      8140  May 20  ../../data/engine/engine.vprdemo
-rw-r--r--   1 mit-26  14745662  May 20  ../../data/head/bighead.den
-rw-r--r--   1 mit-26      5298  May 20  ../../data/head/bighead.vprdemo
-rw-r--r--   1 mit-26      6888  May 20  ../../data/head/face.vprdemo
-rw-r--r--   1 mit-26   7405630  May 20  ../../data/head/head.den
-rw-r--r--   1 mit-26      9425  May 20  ../../data/head/head_skin.vprdemo
-rw-r--r--   1 mit-26   1851454  May 20  ../../data/head/headsmall.


CT Head

MRI Brain

CT Engine

Jacob Morzinski
Last modified: Tue May 20 05:38:02 EDT 1997