TissueImageAnalytics / tiatoolbox

Computational Pathology Toolbox developed by TIA Centre, University of Warwick.
https://warwick.ac.uk/tia
Other
340 stars 71 forks source link

🆕 Use Annotations as a Filter for Patch Extraction #822

Open measty opened 3 weeks ago

measty commented 3 weeks ago

This PR is something i've been thinking about from a conversation with Daan when he was here from Radboud doing a seminar a while back. His comment was that one thing some of his colleges felt was missing in TIAtoolbox was ability to get patches filtered by class/label.

Its not that hard to set up tiatoolbox patch extractor to allow this, which is what i've added in this PR.

it allows you to provide a path to an annotation store as the mask. By default the mask will then be built out of all the annotations, but you can also provide any filter that works in the annotation store, and have only those annotations make the mask. So for example, if you have some pathologist annotations with some regions, and you only want to extract patches which have some overlap with regions labelled 'tumor' or whatever, you would just have to provide the appropriate string ("props['label'] == 'tumor'" for example).

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.89%. Comparing base (14f1215) to head (b007dc2).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #822 +/- ## ======================================== Coverage 99.89% 99.89% ======================================== Files 69 69 Lines 8650 8658 +8 Branches 1653 1654 +1 ======================================== + Hits 8641 8649 +8 Misses 1 1 Partials 8 8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.