mahmoodlab / PANTHER

Morphological Prototyping for Unsupervised Slide Representation Learning in Computational Pathology - CVPR 2024
Other
64 stars 8 forks source link

WSIs at 20× magnification #7

Closed Polycoriander closed 1 month ago

Polycoriander commented 1 month ago

Hi,how do I know if the Whole Slide Images (WSIs) I am using are at 20× magnification?

andrewsong90 commented 1 month ago

Hi @Polycoriander,

Please refer to API for OpenSlide - You can access pretty much all the information about WSI with this.

Polycoriander commented 1 month ago

Hi @Polycoriander,

Please refer to API for OpenSlide - You can access pretty much all the information about WSI with this.

If they are not at 20x magnification, how should they be handled? Is there corresponding code available for this?

andrewsong90 commented 1 month ago

Hi @Polycoriander,

Yes, the standard patch creation & feature extraction code should be available from CLAM github repo https://github.com/mahmoodlab/CLAM

For example, if you are requesting 256x256 px patch at 20x mag and it doesn't exist, you can create 512x512 px patch at 40x mag (usually one of the two magnifications always exists) and downsample it twice.

Hope it helps!

Polycoriander commented 1 month ago

Hi @Polycoriander,

Yes, the standard patch creation & feature extraction code should be available from CLAM github repo https://github.com/mahmoodlab/CLAM

For example, if you are requesting 256x256 px patch at 20x mag and it doesn't exist, you can create 512x512 px patch at 40x mag (usually one of the two magnifications always exists) and downsample it twice.

Hope it helps!

Thank you for your answer! For the TCGA LUAD dataset, I used

slide = openslide.open_slide(dir) 
print(slide.properties) 

to get the magnification. Some WSI returned properties that included an aperio.AppMag key from which I could determine the magnification.

2

However, some do not have a key similar to aperio.AppMag. How can I obtain the magnification for these slides?

3