Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins in the plugin folder cannot be used if they are just .class files. #313

Open
odinsbane opened this issue Aug 19, 2024 · 4 comments

Comments

@odinsbane
Copy link

Some plugins are used by just putting a class file in the plugins folder. These plugins do not load properly in pyimagej.

To reproduce this, take an example plugin and compile it to a class file and place it in the fiji plugins folder.

import ij.plugin.PlugIn;

public class Example_Plugin implements PlugIn {
    @Override
    public void run(String s) {
        System.out.println("That's the one");
    }
}

Starting fiji, the Example Plugin will be available in the menu and running it should produce the desired output.

Starting pyimagej.

import imagej
ij = imagej.init("Fiji.app", mode='interactive')
ij.ui().showUI()

Note the "Fiji.app" is the path to the Fiji that has the plugin installed. This should display the UI with Example Plugin in the menu. Trying to run it will cause a class not found exception.

@odinsbane
Copy link
Author

One work around is the put the class file into a jar.

jar cf Example_Plugin.jar Example_Plugin.class

Restarting pyimagej the plugin should work fine.

@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/issue-with-loading-local-plugins-with-pyimagej/100279/9

@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/adjustable-watershed-plugin-in-pyimagej/100563/3

@ctrueden
Copy link
Member

See also this Zulip topic, where I describe some findings related to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants