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

Support wrapping any arraylike object, which may not be a block of memory, to ImgLib2 #202

Open
ctrueden opened this issue May 23, 2022 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@ctrueden
Copy link
Member

Naively, this means writing a Python-side class that implements e.g. Img or Dataset or whatever interface, providing all the methods, but backed by the Python-side arraylike object. No memory shenanigans.

But the naive approach will be extremely slow for things like iteration of samples, because each sample access is across the JNI boundary. So then we have what @hanslovsky wrote in #73:

I have wrapped a numpy-like object into a cached cell img. I don't remember what exactly the object was but as long as the individual cells can be mapped to native memory, this shouldn't be too much of a challenge. It is a different story for completely arbitrary objects, though.

Which could help with performance when we have raw memory access per cell.

@ctrueden ctrueden added the enhancement New feature or request label May 23, 2022
@ctrueden ctrueden added this to the unscheduled milestone May 23, 2022
@ctrueden
Copy link
Member Author

ctrueden commented Nov 2, 2022

I feel dumb for not grokking this before, but @hanslovsky already implemented this years ago with imglib/imglyb#7. The use case was Dask. So all we need to do to resolve this issue is add tests, either here or in imglyb or both...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant