Re: Calling ImageJ plugins directly in MATLAB

Posted by dscho on
URL: http://imagej.273.s1.nabble.com/Calling-ImageJ-plugins-directly-in-MATLAB-tp5002621p5002726.html

Hi,

On Wed, 17 Apr 2013, Curtis Rueden wrote:

> > I think it should be possible to use the Java functionality of MATLAB
> > to call functions directly, without using MIJ (or using MIJ only to
> > generate the ImagePlus object, not to run the command), but I can't
> > seem to find any documentation on this.
>
> If you are looking to evaluate MATLAB code from within an ImageJ plugin
> or other Java code, MATLAB provides an interface for doing this as long
> as your program was launched from inside the MATLAB JVM. You can read
> more about it on the excellent "Undocumented Matlab" blog [1].
>
> If you are looking to call ImageJ/Java code from your MATLAB script,
> this is actually much simpler. Simply embed the calls to fully qualified
> Java class methods directly in your scripts. As an example, the
> Bio-Formats bfopen.m script [2] does so extensively to provide image I/O
> for the formats it supports. MATLAB takes care of transparently
> converting between Java primitive types and arrays and its own matrices
> and cell structures.

Note that the majority of the code in MIJ deals with converting data
structures back and forth between ImageJ images (not Java arrays) and
Matlab arrays.

Feel free to reinvent the wheel.

:-)

Ciao,
Dscho

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html