webknossos
webknossos copied to clipboard
Support all valid values for transpose codec configuration in zarr v3
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.
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).
C and F are now no longer supported in the spec.
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)