Skip to content

Commit d5193ec

Browse files
committed
BUG: rechunk roi data after slicing
So the roi image, when used later either in another view call or saving with to_ngff_zarr, we do not run into the error: ``` ValueError: Attempt to save array to zarr with irregular chunking, please call `arr.rechunk(...)` first ```
1 parent a3a11b1 commit d5193ec

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

itkwidgets/viewer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ async def get_roi_image(self, scale: int = -1, name: str = 'Image') -> NgffImage
429429
multiscales = from_ngff_zarr(store)
430430
loaded_image = multiscales.images[scale]
431431
roi_data = loaded_image.data[roi_slices]
432+
roi_data = roi_data.rechunk(loaded_image.data.chunksize)
432433
return to_ngff_image(
433434
roi_data,
434435
dims=loaded_image.dims,

0 commit comments

Comments
 (0)