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

Comparison with pyimagej #11

Closed
phisanti opened this issue Apr 22, 2020 · 4 comments
Closed

Comparison with pyimagej #11

phisanti opened this issue Apr 22, 2020 · 4 comments

Comments

@phisanti
Copy link

Hi,

I write very frequently scripts for Imagej in python using the Jython interpreter but starting to consider using directly python. For that I am considering these options:

From the pure scripting approach, is there any significant differences among those?

@hanslovsky
Copy link
Member

Hi @phisanti, I have left my position in academia and am not working actively on this anymore at this time.

To answer your question: imglyb is a compatibility layer for shared memory between numpy.ndarray and ImgLib2 data structures. pyimagej uses imglyb and also exposes ImageJ + useful helper functions as a CPython library. The difference between those two libraries is that imglyb operates at a lower level and pyimagej is more comprehensive. I you want to use ImageJ anyways, it is probably best to use pyimagej. As for scripting, if you are using ImageJ1 data structures (ImageProcessor etc), you will not benefit from the shared memory access, but the CPython environment may provide a better scripting experience than the Jython experience.

The notebooks you linked are executed in the JVM afaik, so they are not CPython compatible but @ctrueden would know for sure.

tldr: If you really want to use CPython, you should probably use pyimagej.

cc @ctrueden @imagejan @kephale Please share your scripting experience with pyimagej and if you'd recommend it over using Jython (in the context of ImageJ1 or ImageJ2)

@kephale
Copy link

kephale commented Apr 24, 2020

The short answer is:
Jython is great if you only need to rely on ImageJ/Fiji/Java projects as dependencies

pyimagej is essentially required if you write your own deep learning tools and need to use ImageJ to use/analyze DL results

@ctrueden
Copy link
Member

@phisanti In future, please disclose when you cross-post. This was posted also as imagej/pyimagej#76; see my response there.

@phisanti
Copy link
Author

Thanks for the help and sorry for the not notifying the cross-post! Always learning.

Kind regards
Santi

hinerm added a commit to imglib/imglyb-bdv that referenced this issue Sep 23, 2021
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

4 participants