Comments (8)
Hello @mkitti , I am trying to use your code and I am encountering a couple of problems.
When trying to create imglib2 images from npy files that contain 3D images the reconstruction doe snot work well. I think it is because ImgLib2 indexes flat arrays in a different way to numpy. This is why with 2D images it works well.
Is there a way to go around this problem using ImgLib2 code?
from jdll.
Meanwhile, pom-scijava 37.0.0 has been released and now manages imglib2 at 6.2.0...
from jdll.
xref: scijava/pom-scijava#229
from jdll.
Awesome, I will implement it then.
Is it possible to get a reference to the imglib2 buffer too?
Does the cursor.get().getByte() already return a reference?
from jdll.
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.
from jdll.
This is what I was trying to refer to:
My guess is that you need to reorder or permute the dimensions. Numpy is usually row major, and I believe imglib2 is column major.
But I did not know how ImgLib2 dimensions are organised.
Permuting the axes might be the best option.
Thanks a lot @mkitti !
from jdll.
Numpy has dimensions (y,x)
where the last dimension is the fastest varying dimension. ImgLib2 has dimensions (x,y)
where the first dimension is the fastest varying dimension.
For 3D, Numpy would be (z,y,x)
and ImgLib2 would be (x, y, z)
.
from jdll.
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
from jdll.
Related Issues (15)
- Backend of the model-runner tensors HOT 5
- Make output tensors accept pre-allocated data HOT 2
- Removing the depency to org.bioimageanalysis.icy HOT 2
- update developer guidelines for the library HOT 1
- Dependency artifact not found HOT 1
- Improve memory efficiency of the ScaleRangeTransformation HOT 1
- java runner in Fiji HOT 6
- Support choosing which GPU to use
- Consider to what extent JDLL should support (re)training HOT 1
- couldn't find the JDLL plug in for FIJI and icy HOT 3
- Clarify relations of the java libraries HOT 4
- Tf 1 does not work on Apple M1 HOT 1
- Create Java object from model.yaml HOT 1
- Make it easier to configure the Tensors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jdll.