-
Notifications
You must be signed in to change notification settings - Fork 6
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
DecodeNumpy via BufferAccess classes. #29
Comments
xref: scijava/pom-scijava#229 |
Awesome, I will implement it then. |
Hello @mkitti , I am trying to use your code and I am encountering a couple of problems. Is there a way to go around this problem using ImgLib2 code? |
I am uncertain what you mean by doss not work well. My guess is that you need to reorder or permute the dimensions. Numpy is usually row major, and I believe imglib2 is column major. Numpy does support Fortran order. https://numpy.org/doc/stable/reference/generated/numpy.asfortranarray.html You could try that. Otherwise, you will need to permite the dimensions on the ImgLib2 side. |
This is what I was trying to refer to:
But I did not know how ImgLib2 dimensions are organised. Permuting the axes might be the best option. |
Numpy has dimensions For 3D, Numpy would be |
Meanwhile, pom-scijava 37.0.0 has been released and now manages imglib2 at 6.2.0... |
Finally implemented for numpy file reading. Also improved the tensor<->imglib2 RAI conversion accross all the Deep Learning engines with the help of @tpietzsch at Brno's Hackaton Oct 2023
|
Here's an alternate version of the
DecodeNumpy.build
.https://github.com/bioimage-io/model-runner-java/blob/ea4bec4616d81ce63c3fb1ed4e6c13aeb0e4c53c/src/main/java/io/bioimage/modelrunner/numpy/DecodeNumpy.java#L248
This may require a version of ImgLib2 with imglib/imglib2#299 . The earliest such version would be imglib2-5.13.0.
Currently, pom-scijava is at imglib2-5.12.0 but @ctrueden mentioned he was interested in release a pom-scijava with a version bump to imglib2-5.13.0.
The main reason for this change is so that it does not copy the
ByteBuffer
but rather uses it directly.The text was updated successfully, but these errors were encountered: