Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging
https://monai.io/
Apache License 2.0
5.68k stars 1.04k forks source link

WSIReader mirror flip inference map #6173

Open OmarAshkar opened 1 year ago

OmarAshkar commented 1 year ago

Describe the bug I am using WSIReader as either transform or SlidingPatchWSIDataset, the resultant maps are mirror flipped always.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://github.com/Project-MONAI/tutorials/blob/main/pathology/hovernet/inference.py
  2. Either convert this line to WSIReader https://github.com/Project-MONAI/tutorials/blob/02911a9bf11934516d4f93f29a46b3acd3dcc58e/pathology/hovernet/inference.py#L69 or remove it and use SlidingPatchWSIDataset.
  3. Run the script and check the resultant maps.

Expected behavior It should have the same orientation as the inputed images. The current implementation of the script works well.

CC. @drbeh

Thank you

drbeh commented 1 year ago

Hi @omashkartrx, thank you very much for reporting this. We will looks into this. May I know what is the whole slide image that you are using?

OmarAshkar commented 1 year ago

@drbeh it is private svs files. I have tried to export to tif and use tifffle backend with WSIReader transform still with same issue.

drbeh commented 1 year ago

@JHancox would it be possible for you to confirm this behavior? Thanks

JHancox commented 1 year ago

@JHancox would it be possible for you to confirm this behavior? Thanks

Sure, will do. @omashkartrx - any chance this could be related to the fact that for I/O, we use the imaging convention of (x,y) with the origin at Top Left, whereas, once loaded, we use the data science convention of (row, column) with origin at Top Left, remembering that graphs/plots tend to use (x,y) with origin bottom left!!?

OmarAshkar commented 1 year ago

@JHancox yes this sounds logical. I have to confirm that PIL reader doesn't have this issue.