Skip to content

Switch from PixelBuffer to Zarr metadata and array cache#3

Merged
chris-allan merged 2 commits intoglencoesoftware:masterfrom
chris-allan:fix-pixel-buffer-cache
Mar 14, 2024
Merged

Switch from PixelBuffer to Zarr metadata and array cache#3
chris-allan merged 2 commits intoglencoesoftware:masterfrom
chris-allan:fix-pixel-buffer-cache

Conversation

@chris-allan
Copy link
Copy Markdown
Member

@chris-allan chris-allan commented Mar 14, 2024

Caching at the PixelBuffer level can cause concurrency issues due to the combination of setResolutionLevel() and getTile() not being used atomically in all situations. We can also improve performance by caching ZarrArray instances and not recreating them when switching between resolution levels.

@chris-allan chris-allan requested review from kkoz and sbesson March 14, 2024 11:37
Copy link
Copy Markdown
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

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

Similarly to #1 (comment), integrated these changes into a development branch of omero-ms-image-region for deployment and testing on a development instance.

The rendering of RGB and fluorescent OME-Zarr images as well as OME-Zarr labels hosted on our public S3 bucket is working as expected in PathViewer. For digital pathology data in particular, the navigation experience including the bird's eye view as well as zooming & panning functionality was working without any error while retrieving tiles.

My inline comments are related to possible next steps so I think we could get this included as is but @kkoz might want to take a look at the changes.

throws IOException {
// FIXME: Really should be ZarrUtils.readAttributes() to allow for
// attribute retrieval from either a ZarrArray or ZarrGroup but ZarrPath
// is package private at the moment.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In the same spirit as the work we did with @melissalinkert on bioformats2raw/raw2ometiff, I was considering switching to the more active zarr-developers/jzarr fork on this repository as well
This might be an opportunity to discuss any API improvements we should consider as a preamble of this update.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Opened as zarr-developers/jzarr#19. I think it makes sense to switch to that fork for testing as soon as possible.

.maximumSize(0)
.buildAsync(PixelsService::getZarrArray)
);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 I'll port similar changes to the omero-ms-image-region unit tests instantiating ZarrPixelBuffer .

This raises the question of whether AbstractZarrPixelBufferTest (which originates from the omero-ms-image-region tests) is still relevant and could be consumed by downstream components. In that case, there's probably a case for moving this utility method under this abstract class.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sounds good. I'm not sure the utility now to be honest.

@chris-allan chris-allan merged commit 395c955 into glencoesoftware:master Mar 14, 2024
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