imagej / imagej-matlab

MATLAB integration with ImageJ data structures and runtime.
https://imagej.net/scripting/matlab
BSD 2-Clause "Simplified" License
14 stars 6 forks source link

Image j split #22

Closed kouichi-c-nakamura closed 6 years ago

kouichi-c-nakamura commented 6 years ago

This is a proposal.

Sometime you may want to access ImageJ Java classes from MATLAB without launching ImageJ GUI. This is particularly important if you want to execute ImageJ command from within MATLAB parfor loop (parallel computing).

Apparently, this has been achieved by using the legacy Miji(false). This is mainly because ImageJ(false) (headless mode) never works.

However, ImageJ.m is actually made of two parts: one to add ImageJ 's jJava class paths to MATLAB, and the other to launch ImageJ GUI.

My suggestion here is to split ImageJ.m into two, so that one can add Java class paths without ImageJ GUI using ImageJ_javaaddpath.m.

Alternatively, instead of splitting ImageJ.m into two, if we can say the outcome of ImageJ_javaaddpath.m. i.e. having access to ImageJ Java classes, can be considered as headless mode, a simple change like below to ImageJ.m may be useful.

Apart from being able to access Java API, what else do you need for a headless ImageJ instance?

import net.imagej.matlab.*;
if open_imagej
    ImageJMATLAB.start(verbose);
end

It's OK to give up this PR if people don't like the idea. Just a try.

Best, Kouichi

kouichi-c-nakamura commented 6 years ago

Sorry, I just realized that this PR is a duplicate.