I think I discovered an issue…
# @ImgPlus img
as part of the script it seems to indeed try make the active image available as an img object. The problem with this is that in my case the currently active image is 500GB virtual stack. When I run the script it seems to try to load the whole thing into memory and Fiji crashes with an out-of-memory error.
That is indeed a serious problem. I split this post to a new topic, since it is different from the prior discussion.
Please open an issue here: https://github.com/imagej/imagej-legacy/issues/new
Until this gets fixed (which might be a while), does it work to use:
# @ImagePlus imp instead?
# @ImagePlus imp does not have this problem
# @ImagePlus imp sufficient for your needs for now? You can wrap it into an ImgLib2 object after the fact using the
In fact I don’t need either of them. I directly import the java classes for wrapping.