DIAGNijmegen / pathology-whole-slide-data

A package for working with whole-slide data including a fast batch iterator that can be used to train deep learning models.
https://diagnijmegen.github.io/pathology-whole-slide-data/
Apache License 2.0
92 stars 27 forks source link

Update imagewriter.py with tile and coordinate checks and corrections #65

Open JoeySpronck opened 1 month ago

JoeySpronck commented 1 month ago

As discussed with multiple people from our group the wrapped ASAP image writer sometimes exhibits unexaplainable behaviour that is very hard to debug. In this PR I intend to prevent some of the obvious mistakes to pass without errors. If possible I correct the tile. By doing this the writer becomes more robust and guides the user on what to fix, instead of ambiguously trying to keep the loop going without throwing warnings or errors.

I think the _crop_tile function and the _get_row_col function already partly do some of these checks, but neither throw errors or warnings, causign outputs that are incorrect and leaving users unaware of what went wrong. I left them in right now though, the new function takes care of possible errors.

I havent tested this yet but I would like to share this already so we can finalize it together. @martvanrijthoven @daangeijs @carlijnlems @nfsuysal @leandervaneekelen @rolandnemeth000

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 10634488362

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
wholeslidedata/interoperability/asap/imagewriter.py 15 25 60.0%
<!-- Total: 15 25 60.0% -->
Totals Coverage Status
Change from base Build 10526088141: -0.1%
Covered Lines: 2224
Relevant Lines: 3065

💛 - Coveralls