Open ctrueden opened 7 years ago
I just had a look at the documentation and the examples of the MATLAB Engine w.r.t. to Converter
s:
// ...
// Get result from the workspace
Future<double[]> futureEval = ml.getVariableAsync("B");
double[] output = futureEval.get();
// ...
We could use that to generate Img
s of narrower types than DoubleType
(which is the current status quo).
On the other hand, using the Engine API with Maven might not be the most fun project to work on: it is only bundled with MATLAB (http://de.mathworks.com/help/matlab/matlab_external/setup-environment.html).
On the other hand, using the Engine API with Maven might not be the most fun project to work on: it is only bundled with MATLAB
We could write a small shell script which does mvn install:install-file
on the engine.jar
. You'd just need to run the shell script before invoking mvn
the first time. Then we can depend on com.mathworks:matlab-engine
in the POM. However, it needs to be marked as provided
scope, so that downstream code is not infected. Of course, you'd also need to have MATLAB installed on your local machine. But to develop ImageJ-MATLAB you really need to have it anyway, or else you cannot test anything.
Another possible approach would to be create and publish our own matlab-engine-stubs
JAR which replicates the entire API, but as no-ops. This is how we solve the dependency on Apple-specific Java APIs, for example. Then it is possible to compile without MATLAB present, but not run unit tests.
MATLAB 2016b and later have a new MATLAB Engine API for Java which might be better—or at least better supported and more official—than matlabcontrol.