These are chat archives for fiji/fiji

10th
Oct 2018
Szabolcs Horvát
@szhorvat
Oct 10 2018 15:35
Hello everyone!
I am looking to make use of a filter present in Fiji while doing the rest of the work in MATLAB. Basically I am looking for a way to control (and script) Fiji from MATLAB. I see that there is a MATLAB interface and it allows putting a MATLAB image up as a Fiji image window, or retrieving a Fiji image in MATLAB. But I am struggling to instruct Fiji (directly from MATLAB) to apply a filter.
Is there an example that shows how this is done?
Curtis Rueden
@ctrueden
Oct 10 2018 19:27
@szhorvat Heh, that's funny, I guess there are no example scripts showing how to invoke ImageJ's image processing APIs, are there? Just calling MATLAB functions.
Well, you should be able to call the ImageJ API the same way you do it in other contexts. You can take a look at the ImageJ tutorial notebooks for ideas: https://imagej.github.io/tutorials
But... I'm not sure how to get a handle on the ImageJ gateway and/or SciJava context from MATLAB.
Curtis Rueden
@ctrueden
Oct 10 2018 19:43
ij = new net.imagej.ImageJ(IJM.context());
might work.
Then you could do e.g.:
image3 = ij.op().math().add(image1, image2);
Is the new keyword in MATLAB a thing for instantiating Java objects?
It might be simply ij = net.imagej.ImageJ(IJM.context());