-
Notifications
You must be signed in to change notification settings - Fork 50
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
Is it possible to use pyvips to read a certain level of whole slide image and convert it to numpy array? #200
Comments
Hello @thomascong121, Yes, use https://libvips.github.io/libvips/API/current/VipsForeignSave.html#vips-openslideload You can convert to a numpy array in the usual way: |
Thank you @jcupitt for the quick reply, I try to read level 0 image from the whole slide image, the image on level0 is of shape(217088, 103936, 3), the following code failed as it used up all my RAM. Do you have any suggestions on how to read the image from level0 with lower memory usage?the WSI image file can be accessed from this link
|
Is this for training a NN? |
Yes |
There's some code here for fetching small patches from a large slide for training: If you want larger patches (1024 x 1024 etc.) it'd probably be faster to use |
Great, I will go check it, Thank you for the help. |
Hi @jcupitt , Just a quick question, after I load the whole slide image using |
Yes, openslide images can have missing sections (where the camera didn't record any pixels), so images are RGBA. You can use |
No description provided.
The text was updated successfully, but these errors were encountered: