Analyze Skeleton in jython

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Analyze Skeleton in jython

Harri Jäälinoja
Hi,

I would like to use the Analyze Skeleton plugin in a silent mode
(http://fiji.sc/AnalyzeSkeleton) in Jython, but I don't know how to
import the module.

Based on the jar-file contents...
dev@192e0e6fb8a5:~/lmu-users/jaakko$ jar tvf
/Fiji.app/plugins/AnalyzeSkeleton_-2.0.0-SNAPSHOT.jar
      0 Tue Apr 15 17:25:22 UTC 2014 META-INF/
    519 Tue Apr 15 17:25:20 UTC 2014 META-INF/MANIFEST.MF
      0 Tue Apr 15 17:25:20 UTC 2014 skeleton_analysis/
   1936 Tue Apr 15 17:25:20 UTC 2014 skeleton_analysis/Edge.class
   1111 Tue Apr 15 17:25:20 UTC 2014 skeleton_analysis/Point.class

... I have tried
import skeleton_analysis

... but I get the error
ImportError: No module named skeleton_analysis


JavaScript import works as advertised:
dev@192e0e6fb8a5:~/lmu-users/jaakko$ cat test.js
importPackage(Packages.skeleton_analysis);
dev@192e0e6fb8a5:~/lmu-users/jaakko$ /Fiji.app/ImageJ-linux64 test.js
dev@192e0e6fb8a5:~/lmu-users/jaakko$


I have ImageJ 1.49g (Fiji).

Any ideas?

Thanks, best regards,
Harri

_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: Analyze Skeleton in jython

dscho
Administrator
Hi Harri,

On Mon, 15 Sep 2014, Harri Jäälinoja wrote:

> I would like to use the Analyze Skeleton plugin in a silent mode
> (http://fiji.sc/AnalyzeSkeleton) in Jython, but I don't know how to import the
> module.
>
> Based on the jar-file contents...
> dev@192e0e6fb8a5:~/lmu-users/jaakko$ jar tvf
> /Fiji.app/plugins/AnalyzeSkeleton_-2.0.0-SNAPSHOT.jar
>      0 Tue Apr 15 17:25:22 UTC 2014 META-INF/
>    519 Tue Apr 15 17:25:20 UTC 2014 META-INF/MANIFEST.MF
>      0 Tue Apr 15 17:25:20 UTC 2014 skeleton_analysis/
>   1936 Tue Apr 15 17:25:20 UTC 2014 skeleton_analysis/Edge.class
>   1111 Tue Apr 15 17:25:20 UTC 2014 skeleton_analysis/Point.class
A better way is to inspect the Javadoc:

        http://jenkins.imagej.net/job/Fiji-javadoc/javadoc/skeleton_analysis/package-summary.html

or the source code directly:

        https://github.com/fiji/AnalyzeSkeleton

> ... I have tried
> import skeleton_analysis
>
> ... but I get the error
> ImportError: No module named skeleton_analysis

For performance reasons, we had to disable the wildcard imports (Jython's
startup was just really unbearably slow otherwise). Therefore, you have to
import the classes explicitly:

        from skeleton_analysis import Edge, Graph, AnalyzeSkeleton_

Please feel free to become an active part of the community by enhancing
the documentation on the ImageJ/Fiji wiki. As a rule of thumb: if the
documentation could have done a better job helping you do your job, please
just edit it accordingly, to help the community.

Ciao,
Johannes
_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: Analyze Skeleton in jython

dscho
Administrator
Hi Harri,

On Mon, 15 Sep 2014, Johannes Schindelin wrote:

> Please feel free to become an active part of the community by enhancing
> the documentation on the ImageJ/Fiji wiki. As a rule of thumb: if the
> documentation could have done a better job helping you do your job,
> please just edit it accordingly, to help the community.

I should have provided the link, sorry! The ImageJ/Fiji wiki is accessible
via http://imagej.net/Jython_Scripting (or http://fiji.sc/Jython_Scripting
using the Fiji skin of the same wiki).

Thank you for your contributions,
Johannes

_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: Analyze Skeleton in jython

Harri Jäälinoja
In reply to this post by dscho
Hi Johannes,

On 15/09/14 17:22, Johannes Schindelin wrote:
> For performance reasons, we had to disable the wildcard imports (Jython's
> startup was just really unbearably slow otherwise). Therefore, you have to
> import the classes explicitly:
>
> from skeleton_analysis import Edge, Graph, AnalyzeSkeleton_
thanks, I didn't know about this. It worked immediately.
> Please feel free to become an active part of the community by enhancing
> the documentation on the ImageJ/Fiji wiki. As a rule of thumb: if the
> documentation could have done a better job helping you do your job, please
> just edit it accordingly, to help the community.

Thanks for invitation, I added a little example to see how it's done.

Best,
Harri
>
> Ciao,
> Johannes


_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: Analyze Skeleton in jython

dscho
Administrator
Hi Harri,

On Mon, 22 Sep 2014, Harri Jäälinoja wrote:

> On 15/09/14 17:22, Johannes Schindelin wrote:
> > For performance reasons, we had to disable the wildcard imports (Jython's
> > startup was just really unbearably slow otherwise). Therefore, you have to
> > import the classes explicitly:
> >
> >  from skeleton_analysis import Edge, Graph, AnalyzeSkeleton_
>
> thanks, I didn't know about this. It worked immediately.
>
> > Please feel free to become an active part of the community by enhancing
> > the documentation on the ImageJ/Fiji wiki. As a rule of thumb: if the
> > documentation could have done a better job helping you do your job, please
> > just edit it accordingly, to help the community.
>
> Thanks for invitation, I added a little example to see how it's done.
Thank you!

By the way, the Fiji community is (mostyl ;-)) inviting... And now you're
part of it!

Ciao,
Johannes
_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel