Back to neurospy for developers
About Java Advanced Imaging (JAI)
This page is a log of the pros and cons of using the Java Advanced Imaging library.
The major pros to this library are as follows:
- Imaging Operation Library - The JAI library contains a large set of pre-built imaging ops such as: gamma correction, scaling, convolution/FFT methods, etc. bypassing the need to develop each of these operations from scratch.
- Native Imaging Operations - Each imaging operation in JAI has its own native method on XP, OS X and Linux operating systems. This allows for faster operation processing vs. the normal java methods that are run through the java interpreter.
The major cons to this library are as follows:
- Unimplemented Renderables - JAI has a RenderableImage object which is image object that is not yet rendered in pixel space. In addition, the RenderableImages are “pulled” through the filter chain rather than “pushed”. This causes the filtering to be done on the demand of the last (usually a display or save) operation. However, RenderableImage is an abstract class that has no implementation or use case. This makes them unusable and is the reason why JAI will ultimately not be used in neurospy.
Basic JAI Classes
There are some basic image format classes:
- PlanarImage is the basic 2D image class that implements the RenderedImage interface.
- CollectionImage is a collection of PlanarImages which can be constructed to link over time or 3D perspective.
- TiledImage allows a series of PlanarImages to be tiled together. It also allows them to be written directly to disk by implementing the WritableRenderedImage interface and can by rendered. The big benefit to a TiledImage is that it can be processed in tiles thus improving performance.
- OpImage is the parent class for all operations that defines its image computationally.
Imaging Graphs
The imaging graph is the flow of data through image operations starting from the source and ending with the sink. It is also called a chain.
The most common graph is a directed acyclic graph (DAG) which has each objects represented by a node which can reference each other from the edges (like a graphical programming language).
Rendered graphs are computed upon instantiation and are constant. Renderable graphs are computed when requested and are variable.
By using Renderable graphs one can implement the “push” model. Data is changed when necessary and the image is then called to be rendered based on whatever data is present at the time of call (as opposed to instantiation).
For more details see Java Image Representations