
#%{{{Macros 

#i linuxdoc.tm

#d var#1 \tt{$1}
#d ldots ...
#d chapter#1 <chapt>$1<p>
#d preface <preface>
#d tag#1 <tag>$1</tag>
#d quote#1 <quote>$1</quote>
#d r#1 \ref{$1}{$1}
#d documentstyle book
#d kw#1 \tt{$1}
#d mit_modules_page \url{http://space.mit.edu/cxc/software/slang/modules/}
#d isis_url	\url{http://space.mit.edu/cxc/isis/}
#d volpack_url	\url{http://graphics.stanford.edu/software/volpack/}
#d gtk_url	\url{http://www.gtk.org/}
#d vwhere_url	\url{http://arxiv.org/abs/astro-ph/0412003}
#d isis_url	\url{http://space.mit.edu/cxc/isis/}
#d cubism_url	\url{http://ssc.spitzer.caltech.edu/archanaly/contributed/cubism}

#d slang S-Lang
#d isis ISIS
#d slirp SLIRP
#d vv \tt{volview}
#d vp \tt{volpack}
#d argn  argument \em{n}
#d tab \space\space\space\space
#d newline <tag></tag>
#d nl <newline>

#cd example \tab\space\space\space\bf{Example}<p>
#d example <tag> Example </tag>
#d description <tag>Description</tag>
#d done </descrip>
#d img#1 <img src="$1">

#d function#1 \sect{<bf>$1</bf>\label{$1}}<descrip>
#d variable#1 \sect{<bf>$1</bf>\label{$1}}<descrip>
#d synopsis#1 <tag> Synopsis </tag> $1
#d keywords#1 <tag> Keywords </tag> $1
#d usage#1 <tag> Usage </tag> <verb>$1</verb>
#d description <tag> Description </tag>
#d example <tag> Example </tag>
#d notes <tag> Notes </tag>
#d seealso#1 <tag> See Also </tag> <tt>$1</tt>

#%}}}

\linuxdoc
\begin{\documentstyle}

\title \nl \vv:  A \slang Guilet For Volume Visualization \nl
Reference Manual, Version @VOLVIEW_MODULE_VERSION_STRING@
\author Michael S. Noble, \tt{mnoble@space.mit.edu}
\date \__today__

\toc

#i preface.tm

\chapter{Introduction}

\vv is an extension module which adds volume visualization capability
to the S-Lang interpreter, using the \vp rendering library and Gtk
widget set (see \volpack_url and \gtk_url).  Like VWhere (\vwhere_url),
\vv is also an example of the notion of a \em{guilet} (pronounced
"gooey-let"), by which we
mean to connote visual interfaces of a small-ish, scriptable nature, that
may be easily embedded within -- and launched from -- other programs, even
applications with interactive command lines and no ostensible graphical
interface.  For example, \vv is frequently used in ISIS (\isis_url),
our platform for robust, high-performance astrophysical analysis and modeling,
whose main interface is an interactive \tt{Matlab}(tm)-style command line
prompt.  Guilets fill an important software niche, the middle ground
between novice users -- who often argue that visual interfaces make
software easier to use -- and power users -- who frequently complain
that GUIs are more cumbersome and inflexible than command lines.
Experience suggests that the code size and development cycle of the typical
guilet is considerably smaller than that of traditional, monolithic GUIs
(by which we mean to connote applications coded from scratch, typically
 in a compiled language such as C or C++, to have only a visual interface).
Moreover, given their scripting
heritage, guilets can be more amenable to changing requirements or ad-hoc
experimentation and customization by the end-user.  This is especially
important in the scientific and engineering research arenas.

\sect{Building}

\vv ships with a configure script generated by autoconf, and in most cases
can be built by issuing the following standard commands within a UNIX-like
(e.g. Linux or Cygwin) environment:
#v+
	./configure [options]
	make
	make install
#v-
Beyond \slang itself, \vv has three explicit dependencies: \slirp, \vp,
and SLgtk.
The latter two of these, if not present on your system, may be automatically
downloaded from our site and installed on your system by using the
\tt{--enable-download} configure option.  Issue a \tt{./configure --help}
command for more information.
\vv can be loaded at runtime into any suitably configured
application which embeds the S-Lang interpreter, using either
#v+
        require("volview");
#v-
or
#v+
        () = evalfile("volview");
#v-

\sect{Examples}

  Volumes are visualized from arrays, of either 3 or 4 dimensions, none
  of which may be zero in length.  When a 4D array is given the first
  element is selected as the 3D volume to be visualized (using a 4D array
  to perform a 3D slideshow will be supported in the near future).
  For example, this statement sequence
#v+
  variable volume = tan([1:8000]);
  reshape(volume,[20,20,20]);
  volview(volume);
#v-
  yields
#v+
#v-
\img{tan.png}
#v+
#v-
 Since volumes are just arrays they may be read from virtually any
 source.  For example, consider a classic brain MRI scan example,
 stored in HDF5 format and read using the \tt{slh5} module:
#v+
        require("h5");
        volview( h5_read("brain.h5"));



#v-
\img{brain.png}
#v+
#v-
Here the HDF5 file was converted from a "raw volume" format used
by \vp (representing an MRI scan of a human head, derived from
public domain data provided by SoftLab at UNC Chapel Hill).

Our final example is drawn from astronomy, and utilizes a spectral
cube in the FITS file format, generated by CUBISM (\cubism_url) from
Spitzer observation 3310 of the Cassiopeia A supernova remnant and
graciously provided by Dr. Tracey Delaney.  The visual is useful because
many popular astronomical visualization tools only support visualizing
2D slices of 3D images, which does not reveal interesting structure in
the 3rd dimension (e.g. here wavelength).  By visualizing the entire
volume as a single array
#v+
  require("fits");
  volview( fits_read_image("casa_ll2_s12.fits") );
#v-
we see instantly the clumpy areas which correspond to areas of strong
emission:

\img{casa.png}

\chapter{Command Reference}

#v+
#i volview.hlp
#v-

\end{\documentstyle}
