You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Heyo, I just tried to naively write an ndarray to a an ome.zarr file, but didn't manage. My array was something like numpy.zeros((100, 200, 1), dtype='uint8') where I considered axes to be yxc.
of course when calling write_image I specified the axes argument. The scaler, however, will assume a certain axisorder. This leads to weird errors that are not super obvious.
I'd say this should be documented, or circumvented (e.g. making Scaler aware of axes, using a temporary adding the appropriate axes, etc...)
The text was updated successfully, but these errors were encountered:
Hi @k-dominik thanks for the feedback. write_image should be doing a better job of validating the axes since the NGFF spec at https://ngff.openmicroscopy.org/latest/#image-layout says All image arrays must be up to 5-dimensional with dimension order (t, c, z, y, x).
The scaler currently only downsamples in y and x dimensions, so it will certainly give strange behaviour if either of those are 1.
thx for the quick reply. I'd argue that this should be part of the documentation of the function - users might not necessarily the spec, whereas it's natural to read a docstring. Also, I'd argue it could also be totally natural to expect write_image to do all necessary conversions. Or at least, a meaningful exception should be thrown, as you suggest.
Heyo, I just tried to naively write an ndarray to a an ome.zarr file, but didn't manage. My array was something like
numpy.zeros((100, 200, 1), dtype='uint8')
where I considered axes to beyxc
.of course when calling
write_image
I specified theaxes
argument. Thescaler
, however, will assume a certain axisorder. This leads to weird errors that are not super obvious.I'd say this should be documented, or circumvented (e.g. making
Scaler
aware of axes, using a temporary adding the appropriate axes, etc...)The text was updated successfully, but these errors were encountered: