Skip to content
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

Add setting the objective magnification when patching #287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yang-ze-kang
Copy link

The current code only supports patching at a specified 'patch_level' of the WSI. However, in actual research, the objective magnification is usually specified for patching.

Therefore, I added functionality to the fast patching pipeline to allow specifying the objective magnification during patching. The objective magnification attribute is set to 'None' by default. When the objective magnification is specified, the 'patch_level' will be ignored, and the code will automatically select an appropriate 'patch_level' and corresponding 'custom_downsample' based on the WSI. Additionally, I made corresponding modifications to 'dataset_h5.py' to enable custom downsampling during feature extraction.

@iamownt
Copy link

iamownt commented Jan 6, 2025

in fact, i am not sure why CLAM doesn't directly support patching at different magnification. For example, when i download wsi from TCGA, some wsi has no patch level corresponds to 20X magnification, but UNI/CONCH/Prov-Gigapath/TITAN all utilize 20X magnification

@yang-ze-kang
Copy link
Author

in fact, i am not sure why CLAM doesn't directly support patching at different magnification. For example, when i download wsi from TCGA, some wsi has no patch level corresponds to 20X magnification, but UNI/CONCH/Prov-Gigapath/TITAN all utilize 20X magnification

For example, if the maximum objective magnification of WSI is 20x, slices can be directly performed at patch_level 0, but when the maximum magnification is 40x, slices need to be performed at 2 times the downsample rate.

@iamownt
Copy link

iamownt commented Jan 6, 2025

in fact, i am not sure why CLAM doesn't directly support patching at different magnification. For example, when i download wsi from TCGA, some wsi has no patch level corresponds to 20X magnification, but UNI/CONCH/Prov-Gigapath/TITAN all utilize 20X magnification

For example, if the maximum objective magnification of WSI is 20x, slices can be directly performed at patch_level 0, but when the maximum magnification is 40x, slices need to be performed at 2 times the downsample rate.

you are right. the other issue also point out this problem

@iamownt iamownt mentioned this pull request Jan 13, 2025
invisprints added a commit to invisprints/CLAM that referenced this pull request Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants