webknossos icon indicating copy to clipboard operation
webknossos copied to clipboard

Support all valid values for transpose codec configuration in zarr v3

Open frcroth opened this issue 1 year ago • 3 comments

The codec spec (https://zarr-specs.readthedocs.io/en/latest/v3/codecs/transpose/v1.0.html) states that the "order" configuration key must be one of:

An array of integers specifying a permutation of 0, 1, …, n-1, where n is the number of dimensions in the decoded chunk representation provided as input to this codec.

The string "C", equivalent to specifying the identity permutation 0, 1, …, n-1. This makes the codec a no-op.

The string "F", equivalent to specifying the permutation n-1, …, 1, 0.

Currently, only C and F are supported.

frcroth avatar Jun 02 '23 12:06 frcroth

In https://github.com/scalableminds/webknossos/pull/7288 I add the possibility to specify an IntArray transpose codec. However, it will still only work correctly for C and F order (either expressed by string or by 4,3,2,1,0).

fm3 avatar Oct 12 '23 12:10 fm3

C and F are now no longer supported in the spec.

frcroth avatar Nov 13 '23 08:11 frcroth

I learned today that this does not touch the AxisOrder or the AdditionalCoordinates order. Instead it is only applied when reading a chunk.

So for this we should change the ArrayOrder (not AxisOrder) from the C/F switch to arbitrary permutations.

This would then need adaptation for getting the view on the source chunk axisOrderXYZView (the flip boolean needs to instead become an additional permutation using the transpose codec)

fm3 avatar Jan 29 '24 14:01 fm3