266 - Openslide library for whole slide images
HTML-код
- Опубликовано: 8 сен 2024
- Code generated in the video can be downloaded from here:
github.com/bns...
OpenSlide can read virtual slides in several formats:
Aperio (.svs, .tif)
Hamamatsu (.ndpi, .vms, .vmu)
Leica (.scn)
MIRAX (.mrxs)
Philips (.tiff)
Sakura (.svslide)
Trestle (.tif)
Ventana (.bif, .tif)
Generic tiled TIFF (.tif)
OpenSlide allows reading a small amount of image data at the resolution
closest to a desired zoom level.
pip install openslide-python
then download the latest windows binaries
openslide.org/...
Extract the contents to a place that you can locate later.
If you are getting the error: [WinError 126] The specified module could not be found
Open the lowlevel.py file located in:
lib\site-packages\openslide
Add this at the top, after from _future_ import division, in the lowlevel.py
os.environ['PATH'] = "path+to+binary" + ";" + os.environ['PATH']
path+to+binary is the path to your windows binaries that you just downloaded.
In my case, it looks like this.
import os
os.environ['PATH'] = "C:/Users/Admin/anaconda3/envs/py37/lib/site-packages/openslide/openslide-win64-20171122/bin" + ";" + os.environ['PATH']
A few useful commands to locate the sitepackages directory
import sys
for p in sys.path:
print(p)
Everytime i watch a video and try to implement it, i realize the effort you put on it to give us the most unique content. Thank you sir for all the work.
It takes me many hours to put together my content. It is not easy as many of my videos are like mini projects and in some cases major projects. I still love doing this as it gives me an opportunity to learn and also to support my favorite charities. Good feedback always helps :)
Super helpful! Big thanks for sharing.
Superb presentation ! I was struggling to install openslide but this video really helped ! Thanks a lot. 👍
Most awaited tutorial
Excellent Professor. This is great video. before watching this lecture, I did this WSI to tiles using Qpath application. I got tiles. But I do not know exactly how to cut tiles in details. Your lecture is best. if you upload openslide installing video, we will be gratefully thank you, sir
Thank you. This was a very helpful tutorial.
Thank you very much for the great content.
Thank you, SIR, at least something related to Mitosis Detection Images.
You're welcome
You are THE BEST!
You are the best.
Thanks
Thank you professor! have a good day
You too!
Hello, thank you for the video, super useful. Although I have 2 questions regarding the processing data with openslide. First one is, what if the image size is way bigger (like 100k x 100k pixels). There will be no memory to open such image with the 0th level of the zoom. I could use size reduction or taking lower zoom level, but I need the quality and whole image to perform the registration. How to work with such issue? Second question is regarding the color mode of the image. If I have, for example 4 channel autofluorescence data with DAPI, CY3, CY5 and FITC channels and .mrxs data type, how can I convert it to RGB mode , like in the video and not loose the information from all the channels? How openslide works, will it ignore 1 of the 4 channels or combane it to RGB in a way so there is no information lost from all 4 channels? Would be pleased to hear a comment from you!
Great job! Thanks for sharing.
Thanks for watching!
@@DigitalSreeni I am just wondering whether there is a straightforward way like "DeepZoomGenerator" to generate corresponding masks for generated tiles. (Considering that annotations are provided for WSIs as XML files). It would be great if you could also discuss generating annotations tiles and working with them.
Life Saver !! Thank You.
You're welcome!
thank you for all the videos. i would like to start with the videos; I do analysis in R, but will need to switch to Python. Could you give me some tipps which videos are a "must" at you channel to see and work with/learn from, e.g. a playlist or should I just go through themin a sequential order. thanks again for you effort and sharing your expertise democratizing image analysis and data sience.
Thank you sir so much! your content really helped me a lot! Could you plz consider doing a video about how to code vision transformer (transformer unet)? That would help me a lottttt. Thanks~~
I haven't explored this topic much. I know of it and read about it and also realized that keras documentation provides good explanation so never prioritized it for my videos. I will add it to the list. Thanks for the suggestion.
You are amazing.
You're the best!
Thank you
You're welcome
Hi Sir,
It was an excellent work, and helped me so much to read my .ndpi image
I would like to ask you a question as given below:
How can I obtain .tiff version of .ndpi image using slide_props() without loss of information ?
My input images are is .ndpi format and I need to convert them into .tiff format.
Best regards.
Hello, congratulations for the great work!
I have trouble finding if it is possible, and how, to convert .tif WSI files to .svs , have you encountered similar problems?
Great content! Could you please make a video on handling ".czi" WSI files ? I'm working with these and there are a lot of bottlenecks especially when it comes to tiling. Also, as you probably know, OpenSlide currently cannot handle ".czi".
Hopefully you will see this. I have done your script and learned a lot but things go bad when I tried to saved the tiles. When I get to the line for row in range(rows):, I get the error syntax error: unexpected EOF while parsing. I see no reason for this error, I have re-checked everything. I am using a NDPi file, so I decided to find an svs file to see if that was the problem, but get the exact same error. Any ideas?
I am getting an error: Could not find module 'libopenslide-0.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Import os function and then download the binary files for openslide then find the binary folder and pin it in the code
Thanks a lot, Sir. Can you please make a video demonstrating hierarchical classification using SVM or RF?🙏🙏🙏
You mean, segmenting a region and then looking for other objects within that region?
@@DigitalSreeni No, I mean hierarchical image classification like local classifier per parent node using any type of features like shape, texture, etc...
hello. This video was very helpful. I just have one question.. I did not understand how we can downsample by a factor 32?? we can also use the thumbnail option to get an image of 1k x 1k.... using read_region how can we get the 1k by 1k image?? I am unable to understand the usefulness of the function get_best_level_for_downsample
The information (image) is stored at multiple levels. If your goal is to end up with a 1K x 1K image, you can down sample the largest image but it may require a lot of computing resources, depending on the size of the image. It would be computationally faster if you start with the lowest resolution image.
@@DigitalSreeni thank you so much for the clarification
8:56 On line, 56, there appears to be no file called "whole_slide_image.svs" in the images directory. Where do we get this whole slide image?
#Load the slide file (svs) into an object.
slide = open_slide("images/whole_slide_image.svs")
You need to Google search and find your own svs file or any other whole slide image. I do not own the image I used in my tutorial and I do not have permission to share.
Hi dr
I can't install openslide
I don't have 'lowlevel.py'in my package ' openslide'
Why?
Hi, can you try to cover a topic of generating new image by multipling a single tile of histological image. Make one larger image out of one tile, make its edge pixels to fit with edge pixels of next tile. I would love to see that
If you are referring to super resolution, I did a video on that topic. ruclips.net/video/1HqjPqNglPc/видео.html
Please make a video on error detection from gamma maps in patient specific qa radiotherapy using deep learning
Can you make video on medical image segmentation using vision transformer