Improving the core architecture of ImageJ is one of the primary aims of the ImageJDev project. Increasingly people are working with datasets beyond 2, 3, 4, or even 5 dimensions. There is a fundamental need in ImageJ to support datasets of arbitrary dimensionality (n-dimensional) and size efficiently. People also need access to a larger range of underlying data types (1-bit, 8-bit unsigned, 12-bit unsigned, 16-bit signed, 32-bit unsigned, 64-bit float, etc.) than currently supported.
The ImgLib library
ImageJDev uses the ImgLib library for multidimensional image data processing. Using ImgLib allows ImageJ to:
- support many different native data types (different combinations of bit depths, signedness, and integer/real representations)
- represent large datasets (many planes/cubes/etc., large planes/cubes/etc.)
- abstract data access such that ImageJ can store data in structures that minimize memory footprints
- provide a metadata capability that can be used to carry information of a dataset from import through analysis and on to export.
ImgLib ties its data model and metadata facilities together in a class called ImgPlus.
Multidimensional data support is supported in the ImgLib library by specifying the dimensions and axes of an image. Axes are represented with the AxisType interface. Users can specify their own axis types. Or they can use some of the predefined ones such as X, Y, Z, CHANNEL, TIME, FREQUENCY, etc. All the predefined axes can be found in the Axes enum.
Datasets
ImageJ interfaces to the ImgLib library through a class called Dataset. A Dataset stores its data in an ImgLib ImgPlus. The Dataset class provides methods for creating Datasets and manipulating their attributes. ImageJ data manipulation algorithms rely on low level access routines in ImgLib. The ImgPlus member of Dataset is the connection between ImageJ algorithms and the ImgLib library.
In ImgLib the shape of an image data container is fixed at creation time. Thus a 256x256 image will always have those dimensions. In ImageJ the Dataset class allows mutability of the image data container shape via the setImgPlus() method. In ImageJ users can change image data container shapes by adding and deleting planes and axes as desired. For example, adding 2 XY planes, or 10 CZ planes, or 33 CZT cubes is possible. One can also add a FREQUENCY axis to an XY Dataset.
ImageJ allows primitive access to underlying image data when possible. Datasets whose ImgPlus stores data in a planar fashion can get and set primitive array references to plane data using the getPlane() and setPlane() methods. This allows users to write efficient code for manipulating image data.
Finally Datasets support the Metadata interface. Users can specify color tables, calibration values, axis information, names, etc. for a given Dataset. This allows metadata to be tracked throughout a Dataset's entire lifecycle.
