ACQUIFER Java packages
At ACQUIFER, we developed Java packages to allow the creation of custom software solutions, scripts or macro, to streamline the handling and visualization of Imaging Machine datasets.
This “ACQUIFER Java API” is used in our ACQUIFER Fiji plugins, and can be reused for scripting in Fiji (see the API documentation below).
Besides, the functionalities of the acquifer-core package can be used in any java program such as ICY, QuPath…
The java packages are automatically installed by the ACQUIFER update site in Fiji (freely available upon request).
The ACQUIFER Java API is separated in 2 packages:
This package contains core functionalities, such as metadata parsing from IM filenames or listing IM image files in a directory.
This package can be used within other java programs such as ICY.
This package is specific to Fiji. It provides the plugins but also a number of utilitary functions for the creation of hyperstacks from IM datasets…
Scripting in Fiji
In Fiji, both packages are shipped with the ACQUIFER update site and the ACQUIFER API can be accessed by scripting in the built-in Fiji script editor.
The update site also provides scripting examples, either in jython or with the ImageJ macro language (see the menu ACQUIFER > Examples or the GitHub repository of examples).
Any scripting language supported by Fiji can be used to access the methods defined in the packages (except for the ImageJ macro language which is limited to a subset of functions). For instance, the jython examples can be “translated” to other scripting languages, provided the syntax is adapted accordingly.
If you are new to scripting in ImageJ/Fiji, you can consult the Fiji wiki documentation about scripting, and the subsections dedicated to the different languages.
While the examples show some possible use-case of the API. The API documentation is a valuable resource, which expose all methods available for scripting.
As explained below, most of the classes are documented under the acquifer.im namespace.
If you are not familiar with how to read a java API, you can consult this page from the Fiji wiki. Also read about the API structure below.
As you might notice in the examples, the functions from the acquifer-core and acquifer-IJ packages use similar imports statements such as in jython:
from acquifer.core.im04 import SomeClass from acquifer.ij.im04 import SomeOtherClass # Or for IM03 owners from acquifer.core.im03 import SomeClass from acquifer.ij.im03 import SomeOtherClass
You might notice in the API documentation, that classes with identical names exist, but using a different path. For instance you can find the class BatchDialog under acquifer.ij, acquifer.ij.im03 and acquifer.ij.im04.
While this might look a bit odd, as you might notice it in the API, the classes in im03 and im04 are derived from the classes in im.
This mechanism allows us to define generic code for all Imaging Machine (IM) versions in the im namespace and to only implement version-specific features in the im03/im04 subclasses.
In short, use the correct version of im in your import (IM03 images starts with “WE”, while IM04 images starts with “-“).
However, for the API documentation, most of the documentation will be in the mother classes, under acquifer.core.im or acquifer.ij.im.