Skip to content
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

Zarr axis order #1703

Open
manthey opened this issue Oct 25, 2024 · 0 comments
Open

Zarr axis order #1703

manthey opened this issue Oct 25, 2024 · 0 comments
Assignees

Comments

@manthey
Copy link
Member

manthey commented Oct 25, 2024

Prior to PR #1625, we always preferred to have the C axis have a stride of 1 if it was present. This changed with writing axes, but I don't think we want this for the general reading case. There are some users who expect the channel to be the inner mode frame axis.

This specifically is here: https://github.com/girder/large_image/blob/master/sources/zarr/large_image_source_zarr/__init__.py#L449-L452

We could make it conditional on whether we are editing or not, since while using the image as a sink reading back in a different axis order could be surprising. Specifically, we could do something like

        # If we aren't in editable mode, prefer the channel axis to have a
        # stride of 1, then the z axis, then the t axis, then sorted by the
        # axis name.
        axisOrder = ((-'tzc'.index(k) if k in 'tzc' else 1, k)
                     for k in self._axes if k not in 'xys')
        # In editable mode, prefer the order that the axes are being written.
        if self._editable:
            axisOrder = ((-self._axes.get(k, 'tzc'.index(k) if k in 'tzc' else -1), k)
                         for k in self._axes if k not in 'xys')
        for _, k in sorted(axisOrder):
            ...

Note that this will cause testFrameValues test in test_sink.py to fail.

@annehaley annehaley self-assigned this Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants