Revision as of 11:50, 12 July 2011 by Eglinger (talk | contribs)

MIJ is a java package to exchange images between Matlab and ImageJ. It is written by Daniel Sage (Biomedical Image Group (BIG), Ecole Polytechnique Fédérale de Lausanne (EPFL), Switzerland) and Dimiter Prodanov (Department of Physiology and Pharmacology, Université Catholique de Louvain (UCL), Brussels, Belgium). It allows to start a instance of ImageJ inside Matlab and exchange images back and forth with it. It takes advantage of the fact that the user interface of Matlab is written in Java.

For your convenience, Jacques Pecreaux & Johannes Schindelin wrote Miji.m, which makes it super-easy to use Fiji and the libraries and functions provided by Fiji's components from within Matlab. Simply make sure that the scripts/ directory of your Fiji.app/ is in Matlab's search patch, via File>Set Path... (on Mac, the file chooser doesn't let you choose directories within .app packages, so you have to use the Matlab command addpath('/Applications/Fiji.app/scripts') ). Then a simple


will start a Fiji inside Matlab.

Getting started

An example how to work with MIJ is provided here:

MIJ.run('Embryos (42K)');
I = MIJ.getCurrentImage;
E = imadjust(wiener2(im2double(I(:,:,1))));

If you get an error saying that some Plugin related classes cannot be found, please update your Fiji with Help>Update Fiji!

Getting help

To get a quick help on the available functions, call


Further descriptions and example code can be found on the home page for MIJ. Eventually, detailed documentation about the class MIJ can be found here (suitable if you have a bit of experience with Java).

MIJ Splash.jpg

Alternative: do not start the Fiji GUI

If you want to use the functions without starting Fiji's graphical interface, just call