question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redesign of WSIReader

See original GitHub issue

Right now WSIReader is based on ImageReader class with read and get_data methods. However, reading whole slide images regardless of the library to use have its own additional complexities that are not captured in the base class. Also, currently, we have implemented different backends cuCIM, OpenSlide, and TiffFile` through if statements!

My suggestion would be to have a WSIReader base class that implements those additional functionalities such as evaluating the level based on ppm/resolution, validating the pyramidal levels, etc. along with abstract methods that each of the libraries has to implement. In this way, we can implement each backend in different classes like CuCIMReader (for cuCIM) inherited from WSIReader.

This not only makes the code cleaner and more readable but also decouples MONAI integration of third-party WSI reader libraries and makes the future contribution easier and safer.

The overall structure would look like this: (will update #4005) wsi

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
drbehcommented, Apr 5, 2022

I think this is a good change though WSIReader should still inherit from ImageReader so that the API remains compatible. TiffFileReader isn’t just reading TIFF images but specifically those storing slide data so this class should have a more specific name to not appear to be a general purpose TIFF image reader, PILReader is meant for that instead.

You are right! Here we are implementing a specific use of tifffile library, so we should be more clear. I’ll think of a better name for that.

1reaction
ericspodcommented, Apr 5, 2022

I think this is a good change though WSIReader should still inherit from ImageReader so that the API remains compatible. TiffFileReader isn’t just reading TIFF images but specifically those storing slide data so this class should have a more specific name to not appear to be a general purpose TIFF image reader, PILReader is meant for that instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source code for monai.data.wsi_reader
"`WSIReader` is designed to work only with 2D images with color channel. ... Verify whether the specified file or files format is supported...
Read more >
HP_2010_06 by androsov.info
Cogeneration Process redesign Replaceing lowefficiency process equipment. Theoretical minimum Medium. General improvements in automation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found