webknossos-libs icon indicating copy to clipboard operation
webknossos-libs copied to clipboard

BufferedSliceWriter Erroneous on Mags > 1

Open Tobias314 opened this issue 1 year ago • 2 comments

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

Tobias314 avatar Aug 13 '24 12:08 Tobias314

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.

markbader avatar Aug 20 '24 12:08 markbader

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

aaronkanzer avatar Oct 10 '24 21:10 aaronkanzer