The zarr dimension code tries to auto-select a multiresolution level to display. The autoselection of multiresolution level was picking the worst resolution even if a better one would fit.
This fix computes an estimate of the best multiresolution layer based on how we would ideally tile the z slices in our internal texture for rendering.
The code in the zarr loader is a bit ugly because I want to remap the dimension order back to TCZYX even if it is ordered differently inside the file. So there are some indirections through the index remappings. Some of this remapping stuff was being repeated in two places so I did a DRY refactor into functions.
The result of this code is that the zarr loader won't always just select the worst resolution.
The zarr dimension code tries to auto-select a multiresolution level to display. The autoselection of multiresolution level was picking the worst resolution even if a better one would fit.
This fix computes an estimate of the best multiresolution layer based on how we would ideally tile the z slices in our internal texture for rendering. The code in the zarr loader is a bit ugly because I want to remap the dimension order back to TCZYX even if it is ordered differently inside the file. So there are some indirections through the index remappings. Some of this remapping stuff was being repeated in two places so I did a DRY refactor into functions.
The result of this code is that the zarr loader won't always just select the worst resolution.