Closed ctrueden closed 4 years ago
I found a workaround:
I will add this functionality to imagej-legacy soon, obviating the need for this hack on the Python side. Once that is in place, this issue will be able to close.
With imagej/imagej-legacy#228, ImageJ 1.x plugins can now be used whenever they are available to the class loader. So it now works to initialize an ImageJ using a Maven coordinate and then invoke ImageJ 1.x plugins, even without plugins.dir
being set.
There are still plenty of issues with running many of the ImageJ1 plugins in headless mode, but at least the ImageJ1 execution mechanism fundamentally knows about them now.
As noted in https://github.com/imagej/pyimagej/issues/35#issuecomment-493019994, if you initialize an ImageJ gateway that includes ImageJ1 plugin artifacts on the classpath, for example a standard Fiji installation as follows...
...then it is not possible to invoke the ImageJ1 plugins via
ij.py.run_plugin
. You'll see an error similar to:This is because ImageJ1 needs a system property
plugins.dir
set to a local file path containing all the plugin JARs. ImageJ1 cannot run plugins present on the classpath but not present in a single folder pointed at by this system property.It is likely possible to work around this limitation. For example, one solution might be to use the
ij1.plugin.dirs
property, added by ImageJ2'sij1-patcher
integration layer, setting it to match directories above all entries ofjava.class.path
, so that all JARs present on the classpath are also available to ImageJ1. But I have not tried doing this yet. So I do not know if it work, and if so, what the performance implications would be.