VICAR Image I/O package. This package supplies plugins for reading and writing
images using the ImageIO package which is part of the standard Java
system JDK1.4 and higher. The plugins are automatically registered. The plugins
are independent of JAI. A RenderedImage is returned from a reader. A RenderedImage
from any source may be given to a writer.
SUN supplies some standard Readers and Writers. Some of them are curretnly
supplied as a part of the standard JDK package (jpg, png, gif). A few others
will be supplied with the JAI package. Tiff, pnm, bmp are planned..
This package supplies plugins for some image formats not supported by the
standard or JAI plugin set.
Currently Readers and Writers for Vicar and PDS images are included.
The plugins use the vicar I/O classes to perform low level file access.
The ImageIO package adds support for image metadata. Vicar and PDS labels
are the metadata source.
A Transcoder layer allows the conversion of metadata from one format to the
form understood by a different format. A specific transcoder must be written
to handle transcoding metadata from one specific format to another.
The current package contains a Vicar to PDS transcoder.
The Transcoder use an XSL script to control the conversion processing.
In the simplest form the following code can be used to read in an image file
and write it out as jpeg image file. ImageIO will ask each registered plugin
if it can read the file. If one of the plugins says "Yes" it will be asked
to open the file and return the RenderedImage. A RenderedImage can then be
used by a program to display the image or it can be used to obtain the data
contained in the image file. In the example below the RenderedImage is supplied
to the writer. There must be a writer available for the requested format.
String input_file = "mer_edr.vic";
String output_format = "jpg";
String output_file = mer_edr.jpg";
RenderedImage image image = ImageIO.read(new File(input_file));
ImageIO.write(image, output_format, output_file);
Currently Input, Output and Transcoding are supported.
In-place Update of files is not.
The package's major features are:
- Full label parsing
- Low-level (record-based) I/O API
- Mid-level (tile-based) I/O API
- Thread-safe
- Data type translation for any valid VICAR or PDS file
- Reading and writing "Dual Labeled" PDS files. A PDS label with an embedded
vicar label.
- Binary label supported (although discouraged)
- Transcoding of metadata. Vicar to PDS is the only currently available
Transcoder.
Note that Complex data is not fully supported.
While direct access to VICAR and PDS files via this API is possible, it
is recommended that the higher-level "plugin" from the jpl.mipl.io.plugins
package be used instead. This plugin is automatically registered . The
plugin supports tiling and access to the VICAR or PDS metadata.
Information on the mid- and low-level interfaces can be found in the javadoc
for the VicarInput
and VicarOutput
interfaces.
To write a vicar format image file the format String should be "vicar".
To write a vicar format image file the format String should be "pds".
Eventually JAI codec's will be deprecated.
Added functionality 4-2003
An ISIS (USGS Flagstaff) image reader has been added.
Vicar, PDS and ISIS readers can now return a RenderedImage. Previously the returned image was actually
a BufferedImage. A BufferedImage is displayable since it includes a ColorModel. If the Jade
display component is used a RenderedImage may be used and the Jade component will add a suitable
ColorModel.
Requesting a RenderedImage has 2 valuable uses.
1). A RenderedImage can contain more than 3 bands. 3 bands must be selected from these to create something
which can be displayed.
2). A RenderedImage doesn't pull data until it is requested thus saving some overhead when a subset
of the image is all that is required, such as in a display of a large image using the Jade component.