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

beta-0.9 #115

Merged
merged 4 commits into from
Sep 18, 2024
Merged

beta-0.9 #115

merged 4 commits into from
Sep 18, 2024

Conversation

Dev-Lan
Copy link

@Dev-Lan Dev-Lan commented Sep 17, 2024

Does this PR close any open issues?

Closes #112.

Give a longer description of what this PR addresses and why it's needed

This code adds support for Zstd decompression. Zstd compression is the preferred algorithm used by our collaborators. It is not supported out of the box by viv's loadOmeTiff function. Fortunately you can register new ways to decode the data. This is largely done with geotiff which is a library used by viv.

Since we are using worker threads to do the decompression (this fixed many issues in the past) by passing a Pool object to the loadOmeTiff we have to do a little extra work in order to add the new decoder to a worker.

First, we have to create a new worker in decoder.worker.ts that is set up to handle Zstd by adding the the decoder for it. This is done with the addDecoder function. The 50,000 is the identifier for Zstd (see http://fileformats.archiveteam.org/wiki/TIFF).

Since this is the first custom worker we are writing, this also caused some build issues. To resolve these I had to update vite.config.ts to fix the issue referenced here (vitejs/vite#17483). This introduced another error that required updating vite from 4 → 5 (see vitejs/vite#17775).

Copy link

@bbollen23 bbollen23 left a comment

Choose a reason for hiding this comment

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

If you can, pull the code and try it out quick. Want to see if my suggestion for error handling and strict typing is appropriate.

apps/client/src/components/ImageViewer.vue Outdated Show resolved Hide resolved
apps/client/src/util/decoder.worker.ts Outdated Show resolved Hide resolved
@bbollen23 bbollen23 changed the title add Zstd decoding beta-0.9 Sep 18, 2024
@Dev-Lan Dev-Lan merged commit 104e548 into dev Sep 18, 2024
@Dev-Lan Dev-Lan deleted the 112-zstd-decompression branch September 18, 2024 16:38
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