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

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ docs/jupyterlite/_output/

# autodoc2 generated
docs/apidocs

examples/integrations/itk/roi.zarr/
examples/integrations/itk/roi_gradient.nrrd
examples/integrations/itk/roi_image.nrrd

examples/integrations/itkwasm/roi.zarr/
examples/integrations/itkwasm/roi_image.nrrd
113 changes: 78 additions & 35 deletions examples/integrations/itk/SelectROI.ipynb

Large diffs are not rendered by default.

635 changes: 635 additions & 0 deletions examples/integrations/itkwasm/SelectROI.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions itkwidgets/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

return to_ngff_image(
roi_data,
dims=loaded_image.dims,
Expand Down
Loading