HTML Usage

This document describes the HTML parameters accepted by SliceViewer, and explains how to apply SliceViewer to your own data.  SliceViewer, for the uninitiated, will display an arbitrary slice of a block of 3D brightness data.  This data block is read in from a file.

To use SliceViewer on your own data, it's easiest to start with the .jar file in this archive (it's in java/SliceVie.jar). Just copy this file into the directory containing the data you wish to view (they have to be in the same directory to run under a browser). Next, add an HTML file calling the applet (see the bottom of this page for an example) to that same directory. Finally, open the HTML file in IE 4.0 or Netscape 4.0 and enjoy.

File Format
SliceViewer uses an incredibly low-level, basic file format.  The program simply interprets each byte of the file as a brightness value, with 0 corresponding to black and 255 corresponding to white.  These brightness values apply to sucessive voxels first along the X axis, then rows of these voxels lie along the Y axis, and finally planes of these values lie along the Z axis.

For example, if the block of data has dimensions 49*50*51 along the X, Y, and Z axes; then each voxel (as always) consists of a single byte, each row along X consists of 49 bytes, and each plane along XY consists of 49*50 bytes.  Then to access the volume element at location (3,7,21), SliceViewer would look at the 21st plane, 7th colum, and 3rd voxel:

    offset=(49*50)*29+49*7+3

For those interested, SliceViewer straight away reads the entire input file into memory for greater speed.

Parameters
Of couse, since SliceViewer's file format is so simple, SliceViewer must get the size of the file from some other source.  This information is read from the HTML <param> tag.  The parameters supported by SliceViewer are:

<param name=filename value="shoulder.dat">
<param name=lengthx value="256">
<param name=lengthy value="256">
<param name=lengthz value="12">
<param name=deltax value="0.5">
<param name=deltay value="0.5">
<param name=deltaz value="10.0">
<param name=interpolation value="trilinear">
SliceViewer automatically resizes the zoom and plane position controls to whatever width and height you specify in the <applet> tag-- to take up less screen space, make height smaller; to display a wider range of values, make height larger.

Example HTML
A "typical" HTML call to the SliceViewer might consist of:

<applet archive="SliceVie.jar" code="SliceApplet.class" width=150 height=300>
<param name=filename value="shoulder.dat">
<param name=lengthx value="256">
<param name=lengthy value="256">
<param name=lengthz value="12">
<param name=deltax value="0.5">
<param name=deltay value="-0.5">
<param name=deltaz value="10.0">
<param name=interpolation value="trilinear">
</applet>
That's all!

Return to SliceViewer index