imagej / pyimagej

Use ImageJ from Python
https://pyimagej.readthedocs.io/
Other
473 stars 82 forks source link

Google Colab example in Install.md yields VerifyError #248

Open gselzer opened 1 year ago

gselzer commented 1 year ago

Running the Google Colab, example, I get the following exception running this line:

ij.py.run_plugin("Filter Rank", {"window": 3, "randomise": True}, imp=imp)
[java.lang.Enum.toString] java.lang.VerifyError: (class: Filter_Rank, method: setup signature: (Ljava/lang/String;Lij/ImagePlus;)I) Incompatible object argument for function call
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
    at java.lang.Class.getConstructor0(Class.java:3075)
    at java.lang.Class.newInstance(Class.java:412)
    at ij.IJ.runUserPlugIn(IJ.java:235)
    at ij.IJ.runPlugIn(IJ.java:203)
    at ij.Executer.runCommand(Executer.java:152)
    at ij.Executer.run(Executer.java:70)
    at ij.IJ.run(IJ.java:319)
    at ij.IJ.run(IJ.java:409)
[java.lang.Enum.toString] 

Can anyone else replicate this?

CanYing0913 commented 1 year ago

I tried with code in install.md and replicated the same error. I then tried with my customized plugin and it worked fine (You can try my notebook).

With my local Fiji installation, I could not find a plugin called Filter Rank (Contrast Enhancer neither). Adding on top of this, I found a contrast enhancer using Fiji "find command" utility. I download it from this site and gave a test. I suspect it is not the standard way to call this plugin (although the calling convention I got using recorder is the same):

ij.py.run_plugin("Filter Rank", {"window": 3, "randomise": True}, imp=imp)