Skip to content

java.lang.RuntimeException: Macro canceled with DiameterJ Segment #251

Open
@marilin99

Description

@marilin99

Hi

I am trying to run the DiameterJ Segment plugin using pyimagej.
After initialising the object, opening an image and converting the image to imageplus:

image = ij.io().open(PATH_1)
imp = ij.py.to_imageplus(image)

I run the following command:

ij.IJ.run(imp, "DiameterJ Segment", "do=Yes image=1024 image_0=768 top=0 top_0=0 bottom=1024 bottom_0=650 stat. do_0=No choose=/home/marilin/Documents/ESP/diameterJ_test/sem_test")

I get a Java exception about the Macro being canceled with the following output:

Traceback (most recent call last):
  File "IJ.java", line 409, in ij.IJ.run
  File "IJ.java", line 322, in ij.IJ.run
  File "IJ.java", line 423, in ij.IJ.testAbort
  File "IJ.java", line 2484, in ij.IJ.abort
Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/marilin/Documents/ESP/master_thesis/scripts/pyimagej_test.py", line 69, in <module>
    ij.IJ.run(imp, "DiameterJ Segment", "do=Yes image=1024 image_0=768 top=0 top_0=0 bottom=1024 bottom_0=650 stat. do_0=No choose=/home/marilin/Documents/ESP/diameterJ_test/sem_test")
java.lang.RuntimeException: java.lang.RuntimeException: Macro canceled

Additionally, I have tried to add the custom plugins directory to sj config and use the run_plugin() , alas received the same error about the macro being canceled.
I also tried using the run_macro() but ended with a similar result of an unrecognized command "DiameterJ Segment".

I know the error is pretty verbose, but is there any way to successfully run this plugin in pyimagej?

EDIT:
added some more .jim files to the custom plugin folder, and now have received an import error with run_macro() -
ImportError: The original ImageJ is not available in this environment. Use of original ImageJ macros is not possible. See: https://github.com/imagej/pyimagej/blob/main/doc/Initialization.md

is there a way around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-supportNeed help to get things working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions