CCB DXJava library Programmer's Guide

DXJava library purpose

This library was created to support the CCB ShapeTools program. It may be useful Java programmers who need to read and/or write OpenDX format data files.

The library is very basic; It defines a small set of classes that parallel the DX data model. You should be familiar with the DX data model before attempting to use this library. The various special purpose DX file formats are not supported by this library.

The DX data model (simplified)

The core OpenDX data structure is a data Field. A Field is a collection of data Arrays. Some of these (numerical) arrays have special meaninng within the context of a sampled field of time/space data. An example is that an array may contain the spatial positions of the sample points. If so, the Field definition associates an array (array #1, for example) with it's contextual meaning (spatial coordinates, or "positions").

The arrays which comprise a Field may have special qualities, referred to in the DX lexicon as "Attributes". For example, an array of data values which were measured at the locations defined in a "positions" array are associated with those positions. This relationship is described by the "depends" attribute of the array containing the data values. More formally, an array of data values would have the following attribute:

attribute "dep" string "positions"

If , for example, the data values were a set of 4 measurements, each of which was a direction vector, then the array definition might look like this:

object 2 class array type float rank 1 shape 3 items 4 data follows
1 1 1
2 2 2
3 3 3
0 0 1
attribute "dep" string "positions"

Continuing our example, the 4 points in space where these directions were measured could be defined by this data array object:

object 1 class array type float rank 1 shape 3 items 4 data follows
128.0000 127.5000 78.0000
128.0000 128.0000 77.0000
127.5000 128.0000 78.0000
128.5000 128.0000 78.0000

and field definition that relates these data arrays would be:

object "default" field
component "positions" 1
component "data" 2
end

Given the above, the DXJava library will read(write) a data Field from(into) a Java ImageInputStream(ImageOutputStream).

Overview of DXJava library classes

The library package, edu.ucla.loni.ccb.dx, contains the following classes:

About
provides the version of this library, the copyright notice we request you display should you use this library , and the authors of the library.
DXArray
Contains the data stored in an OpenDX data array object.
DXAttribute
A Name/Value pair modelling an OpenDX attribute.
DXFacesLoopsEdges
An encoding of an OpenDX surface as defined by Faces, Loops and Edges. Note: This class is not yet used by other classes in this package.
DXField
A collection of DXArray's , their attributes,and component name associations.
DXFileReader
Reads a DXField from an OpenDX general format data file.
DXFileWriter
Writes a DXField into an OpenDX general format data file.
DXObject
common base class for dx field and field components.
IIStreamStringTokenizer
Used by the DXFileWriter to parse an ascii input stream into tokens.
UnsupportedDXElementException
thrown when unuspported DX file options and attributes are found.

Background on DX FIle Format

Modified: 20 April 2006