-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add axis convention handling to conversion functions #17
Comments
I think we should invert the dimension order by default when going between ImgLib2 and NumPy. And we need the API to support customizable ordering during conversion as well. |
See also imageio/imageio#382 and xarray. |
This issue has been mentioned on Image.sc Forum. There might be relevant details there: |
Aaxis handling conventions are fully resolved with #151, as well as explained in the tutorials, and customizable with individual conversions via the optional |
Numpy and matplotlib have limited axis handling capabilities when it comes to plotting. There is no way to specify a custom axis, such as XYCT vs XYTC, except by manually plotting it with foreknowledge of the axis.
In addition, numpy indexing is in row-major form (ZYX) which is reversed from Java (XYZ). However, as an exception, python plotting libraries assume that the image is RGB if the last channel is 3-dimensional. E.g. YXC or ZYXC. This complicates conversion back and forth between ImageJ and Numpy, as ImageJ opens RGB as XYZC, and so you can't simply reverse the axis order if you want to make the numpy image directly plotable.
The pyimagej conversion functions
from_java
andto_java
should have some way of specifying channel conventions, and theview
function should plot that convention correctly. This is particularly important in cases where ops/filters alter the axis order, which can quickly cause unintended errors.@ctrueden suggests some form of
hint
variable or other way of passing through Metadata, but the implementation and edge-case handling needs to be determined.The text was updated successfully, but these errors were encountered: