Posted by
ctrueden on
Apr 17, 2013; 7:12pm
URL: http://imagej.273.s1.nabble.com/Calling-ImageJ-plugins-directly-in-MATLAB-tp5002621p5002695.html
Hi Dan,
> 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.
Regards,
Curtis
[1]
http://undocumentedmatlab.com/blog/jmi-java-to-matlab-interface/[2]
https://github.com/openmicroscopy/bioformats/blob/v4.4.6/components/bio-formats/matlab/bfopen.mOn Fri, Apr 12, 2013 at 6:00 AM, ddickinson <
[hidden email]> wrote:
> Hi everyone,
>
> I'm using Michael Schmid's "Find Maxima" plugin to locate peaks in some
> images. This is part of a complicated image processing pipeline that runs
> in MATLAB, so I've been calling the command using This works, but the
> problem is that MIJ seems to require that the image is displayed in order
> for the "Find Maxima" command to work (if I change to non-displaying mode,
> I
> can see that the ImagePlus object is there - i.e. the image is open - but
> the command returns error "No Images Open"). 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. Does
> anyone know how to do it?
>
> Thanks,
> Dan Dickinson
> University of North Carolina
>
>
>
> --
> View this message in context:
>
http://imagej.1557.x6.nabble.com/Calling-ImageJ-plugins-directly-in-MATLAB-tp5002621.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html