next up previous
Next: Graphical User Interface Up: JIV : A 3D Previous: JIV : A 3D

Subsections


Inputs


Environment

JIV can be run either as a Java applet, either as a (standalone) Java application.

Running it as an applet requires an HTML file to invoke it; however, this can be a very simple file, containing only the applet tag. This applet expects a run-time parameter (in the form of an applet parameter): the URL of a config file, which contains information about which 3D data volumes to load, the layout of the user interface, initial settings of various controls, and so on.

The applet can be launched by some HTML code like this:

<applet height=50 width=400 archive="jiv.jar" code="jiv/Main.class">
        <param name="cfg" value="config_file">
</applet>
where jiv.jar should be the URL of the JAR file containing the JIV Java bytecode, and config_file should be the URL of the appropriate JIV config file (config can be used instead of cfg for the parameter name). The config file can also be supplied ``inline'' within the HTML file using the inline_cfg (or inline_config) applet parameter; for example:
<applet height=50 width=400 archive="jiv.jar" code="jiv/Main.class">
        <param name="inline_cfg" value=" ;
# config file's content here: ;
data1 : data1.raw_byte.gz ;
jiv.panel.0 : data1 ;
# ... ;
">
</applet>
Note that, unlike the separate config file, the inline config needs to have each line terminated with the ';' character. Both a separate config file and an inline config can be supplied at the same time: the inline config is read last, so its content takes precendence for keys defined in both places.

The HTML file is not needed when JIV is not run as an applet but as a regular Java application. In this case, the config file's URL can be supplied as a command line argument, or as the value of the cfg or config Java system properties (``environment variables''). The top-level class that needs to be run is the same (jiv/Main.class).


Config File

The config file is expected to be in the following format:

Keys which start with ``jiv.'' are JIV configuration options. Keys which do not start with ``jiv.'' give the location of the image data files (image volumes). JIV configuration options refer to data files by means of data volume aliases, i.e. a kind of a short name. The alias is displayed as a title at the top of each panel, hence it's a good idea to choose something descriptive and short (such that it will fit in the, possibly narrow, panel).

For a given alias ``myalias'', the value associated with key myalias is the volume image file's URL (URL-s for the individual slices are derived from the volume URL, as described in section 1.3). The value associated with key myalias.header is the URL of the header file associated with the image file(s). All relative URL-s are interpreted relative to the base URL of the config file, or relative to the base URL of the HTML file launching the applet if a config file is not defined (by means of the cfg or config applet parameters). If all volumes have the same header, it is acceptable to specify it only for one of the volumes; otherwise, a header should be specified for all volumes (see section 1.3 for the header file format).

The following JIV configuration options are supported:

Panels are displayed left to right, sorted by their increasing number. Note that these numbers do not have to be consecutive -- ``gaps'' in the numbering sequence are silently skipped. Note that the same alias (i.e. the same data volume) can be displayed in several individual and combined volume panels.

The config file is parsed in several passes, so the order of the key/value pairs is irrelevant. However, if several conflicting key/value definitions are given (which is bad practice, by the way), not the last definition given but a random one of them will be considered!


Data Files

JIV reads 3D image data from an image file which should contain the image intensity (gray level) data represented as unsigned bytes (8-bit). The image data are interpreted using an associated header file, which specifies the volume sampling, world coordinates (real world mm), and real image values. All the data files can be optionally compressed using gnuzip, in which case their names (URL-s) need to have the .gz suffix.

The header file is a text file with the same syntax as the config file (see section 1.2). The following statements are supported (where the 3 values of the right-hand side can be separated by whitespace or ``,'') :

The $x, y, z$ axes and their positive direction are assumed to be (respectively): left to right, posterior to anterior, and inferior to superior of a 3D medical image. Note that the sizes, starts, and steps are always expected in $x, y, z$ order, regardless of the file dimension order. If any of the header information is not specified, the following defaults are used (they correspond to the ``ICBM'' sampling and to the ``Talairach'' stereotaxic coordinates systems used at the Montreal Neurological Institute, McGill University):
  size   :  181 217 181
  start  :  -90 -126 -72
  step   :  1 1 1
  order  :  z y x
  imagerange  :  0.0 1.0

Performance tip: Due to internal optimizations, the initial download of the image data will be faster if all the steps are positive and equal (for all dimensions and all image volumes) and the dimension ordering is 'z y x'. However this performance difference will be hardly noticeable when using a modern Java runtime environment (JVM)...

There are two kinds of image files:

volume file:
contains the complete (3D) image volume data; it is required by the upfront and the hybrid download modes.
slice file(s):
contain a 2D slice of the 3D image volume; three sets of all the slices orthogonal to each of the three coordinate axes are required by the on_demand and the hybrid download modes.
The volume file URL is specified in the config file (as shown above in section 1.2); the slice files are expected at URL-s of the form: base/orientation/slice_number.extension, where orientation is one of ``01'', ``02'', or ``12'' -- the name indicates which are the in-slice dimensions (in file dimension order) for that orientation. For example, for a ``transverse'' volume (order: z y x) 01, 02, 12 correspond to ``sagittal'' (z-y), ``coronal'' (z-x), and ``transverse'' (y-x) slice orientations.

base and extension are obtained by breaking the volume file URL at the last ``.'' (other than the suffixes .gz or .bz2); for example, all of the following:

  /some/dir/somename.raw_byte.gz
  /some/dir/somename.raw_byte
  /some/dir/somename.gz
  /some/dir/somename
result in base = /some/dir/somename .

For converting MNI-MINC data to the JIV input format, two utilities (Perl scripts) are distributed along with JIV: minc2jiv.pl, and jiv.pl.

Note: the upfront download mode requires the volume file(s), the on_demand mode requires the slice files, and the hybrid download mode requires both the volume and the slice files.


next up previous
Next: Graphical User Interface Up: JIV : A 3D Previous: JIV : A 3D
Chris COCOSCO 2004-04-27