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.
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 becauseImageJ(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 usingImageJ_javaaddpath.m
.Alternatively, instead of splitting
ImageJ.m
into two, if we can say the outcome ofImageJ_javaaddpath.m
. i.e. having access to ImageJ Java classes, can be considered as headless mode, a simple change like below toImageJ.m
may be useful.Apart from being able to access Java API, what else do you need for a headless ImageJ instance?
It's OK to give up this PR if people don't like the idea. Just a try.
Best, Kouichi