Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select roi rechunk filter itkwasm #717

Conversation

thewtex
Copy link
Member

@thewtex thewtex commented Dec 19, 2023

No description provided.

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
```
@thewtex thewtex requested a review from bnmajor December 19, 2023 15:52
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@bnmajor bnmajor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!

@@ -429,6 +429,7 @@ async def get_roi_image(self, scale: int = -1, name: str = 'Image') -> NgffImage
multiscales = from_ngff_zarr(store)
loaded_image = multiscales.images[scale]
roi_data = loaded_image.data[roi_slices]
roi_data = roi_data.rechunk(loaded_image.data.chunksize)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I did not encounter this error in my testing - I'm glad you caught this!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seemed to happen occasionally, especially with thin slabs.

@thewtex thewtex merged commit 3529089 into InsightSoftwareConsortium:main Dec 19, 2023
6 checks passed
@thewtex thewtex deleted the select-roi-rechunk-filter-itkwasm branch December 19, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants