We present a software module MIJ that allows to combine the powerful numerical computation of Matlab and the image-analysis capabilities of ImageJ. Since both ImageJ and Matlab run on multiple operating systems, MIJ is platform-independent. MIJ uses the Java Virtual Machine (JVM) of Matlab to call ImageJ methods from the Matlab console or scripts. In such way, we could bring the richness of ImageJ and of theirs plugins to the Matlab world.
MIJ contains a collection of static methods to bi-directionally exchange data between Matlab and ImageJ. MIJ has methods to convert and transpose images of ImageJ to 2D matrices and stacks of images to 3D arrays into Matlab. MIJ tries to avoid loss of accuracy by converting the image data to the closest numerical type of Matlab. The main drawback of this interoperability model is the current limitation of the heap memory in Matlab. Depending of the architecture and of the version of Matlab, the heap space can be increased, but it cannot be changed by MIJ.
Since 2011, MIJ is included in the Fiji distribution of ImageJ together with a friendly startup Matlab script called Miji. After calling a single function from Matlab, the full functionality of all the plugins and libraries included in Fiji can be accessed by Matlab scripts, via MIJ. Most notably, Fiji's 3D Viewer can be used to display three- or four-dimensional data in volume-rendering, iso-surface and orthoslice mode.
Users have found MIJ very useful even for simple daily tasks, e.g. opening proprietary image formats using the Bio- Formats library or using the image viewer of ImageJ to display a 2D or 3D Matlab's matrices. Imaging professionals prefer usually ImageJ to show, control the rendering and interact with images. On the other hand, displaying plots and graphs is more convenient and flexible in Matlab. Exchanging data between the two platforms can be very valuable for iterative processes which implie image analysis, done in ImageJ, and statistical analysis done in Matlab. MIJ allows also to launch ImageJ macros from Matlab scripts and to run powerful plugins, e.g. TrackMate.
Interoperability, ImageJ, Fiji, Matlab
Presenting author: Daniel Sage
Organisation: Biomedical Imaging Group, Ecole Polytechnique Fédérale de Lausanne, Lausanne, Switzerland
co-authors: Dimiter Prodanov, Jean-Yves Tinevez, Johannes Schindelin