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

upsampling fails if input dataset bbox is not from-mag-aligned

Open fm3 opened this issue 2 years ago • 0 comments

I tried to use Layer.upsample(). The bbox in the input dataset datasource-properties.json was not mag-aligned with the from_mag. I

I got

  File "wkcuber/wkcuber/upsampling.py", line 144, in <module>
    upsample_mags(
  File "wkcuber/wkcuber/upsampling.py", line 111, in upsample_mags
    Dataset.open(path).get_layer(layer_name).upsample(
  File "webknossos/webknossos/dataset/layer.py", line 1058, in upsample
    prev_mag_view.get_view().for_zipped_chunks(
  File "webknossos/webknossos/dataset/view.py", line 834, in for_zipped_chunks
    assert np.array_equal(
AssertionError: Calling 'for_zipped_chunks' failed because the ratio of the view sizes (source size = Vec3Int(26016,25904,200), target size = Vec3Int(26012,25900,200)) must be equal to the ratio of the chunk sizes (source_chunk_shape in Mag(1) = Vec3Int(8192,8192,1024), target_chunk_shape in Mag(1) = Vec3Int(8192,8192,1024))

editing the json to align the bbox with the from_mag worked, but I feel like this is something that should just work.

fm3 avatar Feb 06 '23 13:02 fm3