ImageJ-MATLAB's ImageJ issues an error when launching

The following code in MATLAB had been working until very recently, but now it often issues an error.

addpath('D:\\Fiji.app\scripts')
ImageJ

The error message is as follows:

Undefined variable "ImageJMATLAB" or class "ImageJMATLAB.start".
Error in ImageJ (line 42)
        ImageJMATLAB.start();

This error message refers to the following code snippet.

    import net.imagej.matlab.*;
    if open_imagej
        ImageJMATLAB.start();
    else
        % initialize ImageJ with the headless flag
        ImageJMATLAB.start('--headless');
    end

This indicates that MATLAB cannot find net.imagej.matlab.ImageJMATLAB, even though I can confirm that D:\Fiji.app\jars\imagej-matlab-0.7.2.jar is in dynamic Java class path by using javaclasspath.

I’m wondering why this error happens (it’s strange that import net.imagej.matlab.*; does not issue an error) and if other people are experiencing the same issue.

I’m using R2018b prerelease on Windows 10.

I have the same issue
on OSX, Matlab2018a, Fiji fully updated and Applications/Fiji.app/jars/imagej-matlab-0.7.2.jar in the javaclasspath.
I cannot find any other references to this problem.

1 Like

Hi @dysthe,
I just tested Fiji Windows 64bit installation from the top of this page: https://imagej.net/Fiji/Downloads#Life-Line_Fiji_versions
on Matlab R2019a.

  1. I started and updated Fiji
  2. In the update window I added Matlab update website: http://sites.imagej.net/MATLAB/
  3. installed required libraries
    after that I was able to start Fiji from Matlab by typing ‘ImageJ’ from the Fiji/scripts directory.

I hope this may help…
Best regards,
Ilya

1 Like