Monday, March 7, 2011

JAI-tools version 1.1.0

The JAI-tools project team is pleased to announce the release of version 1.1.0 of the library. This is a bumper issue with many new features plus major improvements to existing features. Highlights (described below) include new image operators Contour, Vectorize and VectorBinarize; a new ROI class capable of handling massive images; and a performance boost for the Jiffle scripting language.

The release is now available from the Maven Central repository and mirror sites. Maven users should read the notes below (Library setup) about new module names and the option of using a single jar.

You can checkout the sources for this release from:

To search for particular changes of interest go to the issue tracker.

Many thanks to team members Andrea Aime, Andrea Antonello and Simone Giannecchini for all of their work and advice over the last year.

Summary of new features and changes

New image operators


Generates vector contours from raster image values. The contour levels can be specified explicitly or as the interval between levels. Selective contouring can be done by defining particular image values or ranges of values as NoData to be ignored by the operator. The generated contours are returned as JTS LineString objects, suitable for plotting as well as further manipulation or analysis. Here are a couple of examples of the operator in action courtesy of GeoSolutions:


Generates vector boundaries (as JTS Polygons) for regions of uniform value in a raster image. This complements the JAI-tools Regionalize and RangeLookup operators. Here is an example, where an image has first been classified into two uniform ranges using RangeLookup and then vectorized into polygons using Vectorize:


An alternative to the standard JAI Binarize operation. The destination image is backed by a JTS Geometry object rather than a raster. This makes it possible to binarize massive images with only small memory usage.

New ROI class

The new ROIGeometry class can be used as a replacement for the standard JAI ROIShape class. It is backed by a JTS Geometry object rather than an image to minimize memory overhead and it works in conjunction with the VectorBinarize operator, making it possible to define ROIs over massive image areas. It also offers the choice of using pixel corner or center coordinates which is particularly useful for geospatial applications.


The Jiffle image scripting language has been almost completely rewritten for this new version, as previewed in previous posts here and here.

It's faster

Jiffle scripts are now translated to Java source and then compiled to executable bytecode using the Janino in-memory compiler. As a result, scripts now run hundreds of times faster than was the case in version 1.0. The generated Java source can be saved for later use and the compiled objects can be used as any other Java class.

It's easier

A new JiffleBuilder class makes it easier to compile and run scripts with a minimum of key strokes. It can also create a destination image for you ready to receive the results of the script.

It's multi-tasking

The JiffleExecutor class allows you to run one or more Jiffle scripts on background threads. The progress of each task can be monitored and results are passed back to the caller via a simple event system.

It has more bits

The Jiffle language itself has been extended and now provides support for multi-band source images, scoped variables, loop constructs and simple lists.

And it's coming to a program near you

Jiffle can be integrated into applications as an analysis engine. It has been used in JGrass and is about to appear in the upcoming spatial toolbox OmsBox in the uDig GIS application.

As well as Jiffle, OmsBox will include many other features from JAI-tools such as the contour extractor:

To learn more about Jiffle, have a look at the new collection of example programs.

Library setup

Module names

All module names are now prefixed with "jt-" to make it easier to spot them when you're working with a large number of other dependencies. If you use Maven, this means you'll need to edit both the name and the version of JAI-tools modules in your existing pom.xml files.

One jar fits all

You now have the option of using a single jar for JAI-tools. Maven users just need to include jt-all as a dependency in the pom.xml file. If you don't use Maven you can download and add jt-all-1.1.0.jar to your project manually. This combined jar includes all JAI-tools modules other than jt-demo (the example applications).

No comments:

Post a Comment