Unable to run skeleton pruning macro under fiji --headless

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
jni
Reply | Threaded
Open this post in threaded view
|

Unable to run skeleton pruning macro under fiji --headless

jni
Hi all,

I'm trying to run the following (Jython) macro to skeletonize a large
number of segments:

```
    imp = IJ.openImage(impath_in)
    IJ.run(imp, "Skeletonize (2D/3D)", "")
    IJ.saveAs(imp, "Tiff", impath_out)
    imp.close()
```

This runs perfectly under fiji --headless, which makes it very convenient
to run in the background. However, if I add the following line after the
skeletonize command:

```
    IJ.run(imp, "Analyze Skeleton (2D/3D)", "prune=none prune")
```

I get the following error:

java.lang.UnsupportedOperationException: The DummyLegacyService has no
LegacyImageMap!
    at imagej.legacy.DummyLegacyService.getImageMap(DummyLegacyService.java:168)
    at imagej.legacy.patches.ImagePlusMethods.show(ImagePlusMethods.java:93)
    at ij.ImagePlus.show(ImagePlus.java:411)
    at ij.ImagePlus.show(ImagePlus.java:355)
    at skeleton_analysis.AnalyzeSkeleton_.displayTagImage(AnalyzeSkeleton_.java:1183)
    at skeleton_analysis.AnalyzeSkeleton_.processSkeleton(AnalyzeSkeleton_.java:888)
    at skeleton_analysis.AnalyzeSkeleton_.run(AnalyzeSkeleton_.java:366)
    at skeleton_analysis.AnalyzeSkeleton_.run(AnalyzeSkeleton_.java:302)
    at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:262)
    at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:111)
    at ij.IJ.runUserPlugIn(IJ.java:198)
    at ij.IJ.runPlugIn(IJ.java:160)
    at ij.Executer.runCommand(Executer.java:130)
    at ij.Executer.run(Executer.java:64)
    at ij.IJ.run(IJ.java:266)
    at ij.IJ.run(IJ.java:317)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:175)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
    at org.python.core.PyObject.__call__(PyObject.java:432)
    at org.python.core.PyObject.__call__(PyObject.java:436)
    at org.python.pycode._pyx0.ij_binary_skeletonize$1(fiji_skeleton_macro.py:24)
    at org.python.pycode._pyx0.call_function(fiji_skeleton_macro.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyBaseCode.call(PyBaseCode.java:146)
    at org.python.core.PyFunction.__call__(PyFunction.java:327)
    at org.python.pycode._pyx0.f$0(fiji_skeleton_macro.py:29)
    at org.python.pycode._pyx0.call_function(fiji_skeleton_macro.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1204)
    at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:200)
    at org.python.util.jython.run(jython.java:246)
    at org.python.util.jython.main(jython.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at imagej.ClassLauncher.launch(ClassLauncher.java:222)
    at imagej.ClassLauncher.run(ClassLauncher.java:159)
    at imagej.ClassLauncher.main(ClassLauncher.java:72)


Can anyone tell me what I can do to run pruning under headless?

Thanks!

Juan.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Unable to run skeleton pruning macro under fiji --headless

dscho
Hi Juan,

On Wed, 7 Aug 2013, Juan Nunez-Iglesias wrote:

> ```
>     IJ.run(imp, "Analyze Skeleton (2D/3D)", "prune=none prune")
> ```
>
> I get the following error:
>
> java.lang.UnsupportedOperationException: The DummyLegacyService has no
> LegacyImageMap!

I actually fixed this bug in the development version already. May I ask
you to delete Fiji.app/jars/ij-legacy-2.0.0-beta-7.2.jar and copy

        http://code.imagej.net/dscho/ij-legacy-2.0.0-SNAPSHOT.jar

into Fiji.app/jars/ instead and try again? If that works for you, I will
upload that version to the update site.

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
jni
Reply | Threaded
Open this post in threaded view
|

Re: Unable to run skeleton pruning macro under fiji --headless

jni
It worked! Awesome, thanks! What other goodies are you keeping from us
common folk??? ;)


On Thu, Aug 8, 2013 at 1:06 AM, Johannes Schindelin <
[hidden email]> wrote:

> Hi Juan,
>
> On Wed, 7 Aug 2013, Juan Nunez-Iglesias wrote:
>
> > ```
> >     IJ.run(imp, "Analyze Skeleton (2D/3D)", "prune=none prune")
> > ```
> >
> > I get the following error:
> >
> > java.lang.UnsupportedOperationException: The DummyLegacyService has no
> > LegacyImageMap!
>
> I actually fixed this bug in the development version already. May I ask
> you to delete Fiji.app/jars/ij-legacy-2.0.0-beta-7.2.jar and copy
>
>         http://code.imagej.net/dscho/ij-legacy-2.0.0-SNAPSHOT.jar
>
> into Fiji.app/jars/ instead and try again? If that works for you, I will
> upload that version to the update site.
>
> Ciao,
> Johannes
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Unable to run skeleton pruning macro under fiji --headless

dscho
Hi Juan,


On Thu, 8 Aug 2013, Juan Nunez-Iglesias wrote:

> On Thu, Aug 8, 2013 at 1:06 AM, Johannes Schindelin
> <[hidden email]> wrote:
>
> > On Wed, 7 Aug 2013, Juan Nunez-Iglesias wrote:
> >
> > > ```
> > >     IJ.run(imp, "Analyze Skeleton (2D/3D)", "prune=none prune")
> > > ```
> > >
> > > I get the following error:
> > >
> > > java.lang.UnsupportedOperationException: The DummyLegacyService has no
> > > LegacyImageMap!
> >
> > I actually fixed this bug in the development version already. May I ask
> > you to delete Fiji.app/jars/ij-legacy-2.0.0-beta-7.2.jar and copy
> >
> >         http://code.imagej.net/dscho/ij-legacy-2.0.0-SNAPSHOT.jar
> >
> > into Fiji.app/jars/ instead and try again? If that works for you, I will
> > upload that version to the update site.
>
> It worked! Awesome, thanks!

Fantastic! Thanks for testing.

> What other goodies are you keeping from us common folk??? ;)

Well, I just keep a couple of aces up my sleeves.

:-)

Seriously again, I try to balance the wishes of users who cannot get
enough updates with the wishes of users preferring more stable software,
and in this particular side I apparently erred on the latter's side.

But thanks to your successful testing, I felt comfortable enough to upload
the version that fixed things for you!

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html