-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Openslide: select best input level based on output dimensions #2222
Comments
Are you able to provide a sample image? What versions of sharp, libvips and openslide are you using? On what platform? |
Note that |
@lovell Sorry for missing out the details. sharp: 0.25.3 I am afraid I am not able to provide the actual image but here is a link to a sample data: |
@kleisauke Is the |
Is the fast thumbnail generation supported in the sharp as I can't seem to find the documentation about it? |
Commit f5f1654 on the work-in-progress openslide-shrink-on-load branch attempts to add this feature. @TAYTS Please can you test this. npm install lovell/sharp#openslide-shrink-on-load |
@lovell I got |
I think the |
@lovell I have tried on the smaller image |
Thank you. It looks like shrink-on-load for openslide input is a little more complex than providing a scaling factor. We need to calculate the best level to extract, based on its dimensions vs desired dimensions. Here's the relevant metadata from the Leica-1.scn sample:
Let's tag this as an enhancement for now. |
The "quickest" (to implement) solution to help with this is to allow the extraction of a specific level, rather than the current behaviour of always using the first/largest layer. The first step in commit 760550c exposes levels via metadata, e.g. for the
The next step is to allow the required It will then at least be possible for someone to select the most relevant level based on their desired output dimensions. |
Commit 7f142bd adds the sharp('Leica-1.scn', {
level: 4,
limitInputPixels: false
})
... This will be in v0.25.4. |
v0.25.4 is now available. |
I am trying to generate thumbnail file from a large openslide format image(~2Gb), but the resize takes forever to run, not sure if I did it wrongly. Below are my code for trying to generate the thumbnails.
I manage to use
vipsthumbnail
to generate the thumbnail very fast(instant) and I am using the global libvips.The text was updated successfully, but these errors were encountered: