Re: Importing ImageJ classes into Matlab



On May 29, 3:32 am, greg <jsg...@xxxxxxxxxxx> wrote:
On 27 May, 12:11, vonschwartzwalder <vonschwartzwal...@xxxxxxx> wrote:

On May 26, 12:26 pm, ezkcdude <zamir.e...@xxxxxxxxx> wrote:

Has anyone done this?

Yes.

How? Please tell.

If you are using a recent version of MatLab, just put the ImageJ jar
file (ij.jar) in the Java path. MatLab uses Java for it's front end,
so you just need to make sure it can find the classes you want to
use. Once that is done you can instantiate classes at will. MatLab
provides data type translation almost transparently.

I did this, and I also wrote my own classes that call ImageJ classes.

For example:

----------
function result = doSomething(arg1, arg2)
% function that returns a result that comes from doing something in
Java

% make sure you import the class you are going to use
import com.company.library.*;

% call the Java class
result = MyClass.doSomething(arg1, arg2);

----------

The only tricky part of this whole thing is getting the path right,
but once you get it, the Java is very simple.

duane

.



Relevant Pages

  • Re: add a uicontainer or uipanel to a JPanel
    ... An axis is ultimately what I wanted to add to to a ... The uicontainers and uipanels and axes, for that matter, ... As for putting an axes in a Java container, ... Java enables richer GUI than Matlab ...
    (comp.soft-sys.matlab)
  • Re: add a uicontainer or uipanel to a JPanel
    ... An axis is ultimately what I wanted to add to to a ... The uicontainers and uipanels and axes, for that matter, ... As for putting an axes in a Java container, ... Java enables richer GUI than Matlab ...
    (comp.soft-sys.matlab)
  • JAVA Unsatisfied Link Error
    ... I've been getting rather frustrated with the native interface to JAVA ... I wish to load some Java classes that use the JNI ... decided to test it in Matlab. ... In particular I compiled in the Swig ...
    (comp.soft-sys.matlab)
  • Re: text rendering changes after last mac os x java update
    ... The MathWorks is still evaluating the Java for Mac OS X 10.5 Update 2 update released yesterday via Software Update. ... We have confirmed the issues described here on comp.soft-sys.matlab affecting MATLAB regarding Editor document tab appearance, and the Command Window/Editor font size. ... We are confident, however, that this Java update does improve reliability and resolves other issues impacting MATLAB users. ... The Command Window and Editor font size issue is still under investigation, and we are working with Apple to try to resolve this in another java update or patch. ...
    (comp.soft-sys.matlab)
  • Re: Adding a listener java/MATLAB interface
    ... I have a client/server program where the client calls java server code running in MATLAB. ... The Server receives an XML filename from the remote client and sends the file name on to a function in MATLAB, the function returns another filename which contains the results of the simulation. ...
    (comp.soft-sys.matlab)