266 - Openslide library for whole slide images

  Рет қаралды 18,951

DigitalSreeni

2 жыл бұрын

Code generated in the video can be downloaded from here:
github.com/bnsreenu/python_for_microscopists
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/download/
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)

Пікірлер: 45
@ajay0909
@ajay0909 2 жыл бұрын
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.
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
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 :)
@SP-cg9fu
@SP-cg9fu Жыл бұрын
Superb presentation ! I was struggling to install openslide but this video really helped ! Thanks a lot. 👍
@LiquidMasti
@LiquidMasti 2 жыл бұрын
Most awaited tutorial
@nying3452
@nying3452 2 жыл бұрын
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
@krishnabala8403
@krishnabala8403 Жыл бұрын
Thank you. This was a very helpful tutorial.
@awesomeclicks722
@awesomeclicks722 11 ай бұрын
Thank you very much for the great content.
@brunospfc8511
@brunospfc8511 2 жыл бұрын
Thank you professor! have a good day
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
You too!
@feras6471
@feras6471 Жыл бұрын
You are the best. Thanks
@Agent_47S
@Agent_47S Жыл бұрын
You are THE BEST!
@davidw.9711
@davidw.9711 2 жыл бұрын
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.
@shashanksundi5669
@shashanksundi5669 2 жыл бұрын
Life Saver !! Thank You.
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
You're welcome!
@sepidkh6249
@sepidkh6249 Жыл бұрын
Great job! Thanks for sharing.
@DigitalSreeni
@DigitalSreeni Жыл бұрын
Thanks for watching!
@sepidkh6249
@sepidkh6249 Жыл бұрын
@@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.
@Asadkhan-nz6qm
@Asadkhan-nz6qm 2 жыл бұрын
Thank you, SIR, at least something related to Mitosis Detection Images.
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
You're welcome
@auraperez6156
@auraperez6156 Жыл бұрын
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?
@konstantinospanagiotopoulo4379
@konstantinospanagiotopoulo4379 11 ай бұрын
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?
@ozmemr09
@ozmemr09 Жыл бұрын
You are amazing.
@DigitalSreeni
@DigitalSreeni Жыл бұрын
You're the best!
@anirudhgangadhar6158
@anirudhgangadhar6158 Жыл бұрын
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".
@tilkesh
@tilkesh 2 жыл бұрын
Thank you
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
You're welcome
@Bioinformatics_Made_Easy
@Bioinformatics_Made_Easy 2 жыл бұрын
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.
@YusufKhan-hv1qh
@YusufKhan-hv1qh 2 ай бұрын
Import os function and then download the binary files for openslide then find the binary folder and pin it in the code
@mesutseker5247
@mesutseker5247 11 ай бұрын
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.
@romansmaliks8553
@romansmaliks8553 4 ай бұрын
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!
@jsdiary8056
@jsdiary8056 2 жыл бұрын
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~~
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
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.
@patilvinod555
@patilvinod555 2 жыл бұрын
Can you make video on medical image segmentation using vision transformer
@RedShipsofSpainAgain
@RedShipsofSpainAgain 2 жыл бұрын
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")
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
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.
@aritahalder9397
@aritahalder9397 Жыл бұрын
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
@DigitalSreeni
@DigitalSreeni Жыл бұрын
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.
@aritahalder9397
@aritahalder9397 Жыл бұрын
@@DigitalSreeni thank you so much for the clarification
@trollinginmymind39
@trollinginmymind39 2 жыл бұрын
Please make a video on error detection from gamma maps in patient specific qa radiotherapy using deep learning
@setarehhasanabadi4994
@setarehhasanabadi4994 Жыл бұрын
Hi dr I can't install openslide I don't have 'lowlevel.py'in my package ' openslide' Why?
@habtamutilahunmekonnen2247
@habtamutilahunmekonnen2247 2 жыл бұрын
Thanks a lot, Sir. Can you please make a video demonstrating hierarchical classification using SVM or RF?🙏🙏🙏
@DigitalSreeni
@DigitalSreeni 2 жыл бұрын
You mean, segmenting a region and then looking for other objects within that region?
@habtamutilahunmekonnen2247
@habtamutilahunmekonnen2247 2 жыл бұрын
@@DigitalSreeni No, I mean hierarchical image classification like local classifier per parent node using any type of features like shape, texture, etc...
@jakubpawelak9543
@jakubpawelak9543 Жыл бұрын
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
@DigitalSreeni
@DigitalSreeni Жыл бұрын
If you are referring to super resolution, I did a video on that topic. kzbin.info/www/bejne/Z3nUm4Ong8yfhsU