MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

WSIReader mirror flip inference map

Open OmarAshkar opened this issue 1 year ago • 5 comments

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

OmarAshkar avatar Mar 18 '23 23:03 OmarAshkar

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?

drbeh avatar Mar 19 '23 01:03 drbeh

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

OmarAshkar avatar Mar 19 '23 01:03 OmarAshkar

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

drbeh avatar Mar 20 '23 13:03 drbeh

@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!!?

JHancox avatar Mar 20 '23 13:03 JHancox

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

OmarAshkar avatar Mar 20 '23 13:03 OmarAshkar