BufferedSliceWriter Erroneous on Mags > 1
Context
- Affected library: e.g. webknossos
- Creating a BufferedSliceWriter for a mag view with mag > 1 and an offset != 0 does not seem to work correctly
Expected Behavior
- Correctly writing the data
Current Behavior
- Data is written with wrong offset
Possible Fix:
Change line 199
from
absolute_bounding_box=chunk_bbox.from_mag_to_mag1(self._view._mag)
to
absolute_bounding_box=chunk_bbox
I just took a look and tested if the possible fix already solves the issue sufficiently. The change of line 199 leads to two failing wk-libs tests:
FAILED tests/dataset/test_add_layer_from_images.py::test_repo_images[test_rgb.tif-kwargs2-uint8-1-1-size2] - AssertionError: bottomright Vec3Int(32,32,3) is not aligned with the mag 2. Use BoundingBox.align_with_mag().
FAILED tests/dataset/test_add_layer_from_images.py::test_repo_images[rgb_tiff-kwargs3-uint32-1-1-size3] - AssertionError: bottomright Vec3Int(32,32,3) is not aligned with the mag 2. Use BoundingBox.align_with_mag().
We should check what causes these failures and how to avoid them.
Hi @markbader and @Tobias314 -- is there any update on this bug being resolved?
cc @jingjingwu1225 @kabilar -- it seems that this is somewhat of a blocker for Jingjing's script -- @jingjingwu1225 perhaps you could provide more context here