-
Notifications
You must be signed in to change notification settings - Fork 43
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
20x Scale Bugs #55
Comments
Hi, we do not recommend to use the x20 models, as the performance is inferior. We always load the models on the largest WSI level and therefore rescaling to x20 magnification most probably leads to the shift. We are aware of this, but currently do not have the capacity to implement a fix. However, we are very glad for contributors to solve this issue. Sorry that I cannot help you further! Best, Fabian |
Have you tried using 512 pixels for the x20 model? |
Not yet, I will try it soon. Thanks for the reply! |
Hi @FabianHoerst , I have a follow up question , |
Hi @FabianHoerst, I have tried using 512 x 512 pixel patches on 20x but still having the same issue. I'm hoping to run CellViT on some samples from interesting clinical cohorts which are digitized at 20x only, so any tips you have on getting around this issue would be great, thanks! |
I believe the solution for correct global coordinates is to add in the wsi_scaling_factor (=2 for 20x) for the following (which allows for the correct x/y offset), at approximately lines 346 and 350 in cell_segmentation/inference/cell_detection.py: x_global = int(patch_metadata["row"] * patch_size * wsi_scaling_factor - (patch_metadata["row"] + 0.5) * overlap * wsi_scaling_factor) For the correct spacing between nuclei at 20x, you would need to add in the wsi_scaling_factor around lines 358-360: |
Describe the bug
When using CellViT to segment some WSIs under 20x magnification scale, the result showed in QuPath is incorrect. However, when under 40x magnification scale, they are correct. But for those WSIs that doesn't s support 40x magnification scale, segment result under 20x scale is correct. I think there are some bugs in the post-process procedure of the result, making it recognize the result of the model as under 40x magnification scale (which is actually under 20x) and sett he wrong rescale factor.
To Reproduce
Patch Extraction YAML
Patch Extraction
python3 ./preprocessing/patch_extraction/main_extraction.py --config ./preprocessing.yaml
Inference
File
Including WSI and segment results.
https://drive.google.com/drive/folders/1MxZIGvaws8HIdhrVq-nT4F2wvvNyszrZ?usp=drive_link
Error Traceback
No error during the code running, but error appears in QuPath.
Expected behavior
Fix the bugs.
Screenshots
Additional context
None
The text was updated successfully, but these errors were encountered: