Skip to content

Commit

Permalink
ZarrVolumeService: Permit larger-than-stored bounding-box if the conf…
Browse files Browse the repository at this point in the history
…ig permits out-of-bounds access
  • Loading branch information
stuarteberg committed Sep 7, 2020
1 parent e5bf394 commit 374b563
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flyemflows/volumes/zarr_volume_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ def __init__(self, volume_config):
auto_bb += global_offset

bounding_box_zyx = np.array(volume_config["geometry"]["bounding-box"])[:,::-1]
assert (auto_bb[1] >= bounding_box_zyx[1]).all(), \
f"Volume config bounding box ({bounding_box_zyx}) exceeds the bounding box of the data ({auto_bb})."
assert (auto_bb[1] >= bounding_box_zyx[1]).all() or volume_config["zarr"]["out-of-bounds-access"] != "forbid", \
f"Volume config bounding box ({bounding_box_zyx}) exceeds the bounding box of the data ({auto_bb}).\n"\
f"If you want to enable reading out-of-bounds regions (as empty), add out-of-bounds-access: 'permit-empty' to your config."

# Replace -1 bounds with auto
missing_bounds = (bounding_box_zyx == -1)
Expand Down

0 comments on commit 374b563

Please sign in to comment.