Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🆕 Use Annotations as a Filter for Patch Extraction #822

Merged
merged 24 commits into from
Oct 18, 2024

Conversation

measty
Copy link
Collaborator

@measty measty commented Jun 13, 2024

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).

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.86%. Comparing base (52792bc) to head (62f3566).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #822   +/-   ##
========================================
  Coverage    99.86%   99.86%           
========================================
  Files           69       69           
  Lines         8656     8664    +8     
  Branches      1653     1654    +1     
========================================
+ Hits          8644     8652    +8     
  Misses           4        4           
  Partials         8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shaneahmed shaneahmed added the enhancement New feature or request label Jun 14, 2024
@shaneahmed shaneahmed added this to the Release v1.6.0 milestone Jun 14, 2024
@shaneahmed shaneahmed changed the title ENH: Use annotations as a filter for patch extraction 🆕 Use Annotations as a Filter for Patch Extraction Jun 19, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

shaneahmed and others added 4 commits August 16, 2024 10:53
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Copy link
Member

@shaneahmed shaneahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @measty

@shaneahmed
Copy link
Member

Thanks @measty

@mostafajahanifar Please can you review this PR so we can merge this.

Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
@shaneahmed
Copy link
Member

@mostafajahanifar I have updated the file.

Copy link

review-notebook-app bot commented Aug 30, 2024

View / edit / reply to this conversation on ReviewNB

mostafajahanifar commented on 2024-08-30T18:02:03Z
----------------------------------------------------------------

Link of documentaiotn is better to be to the main repo instead of the develop


Copy link

review-notebook-app bot commented Aug 30, 2024

View / edit / reply to this conversation on ReviewNB

mostafajahanifar commented on 2024-08-30T18:02:04Z
----------------------------------------------------------------

Line #3.    pip install git+https://github.com/TissueImageAnalytics/tiatoolbox.git@patch-extractor-filter | tail -n 1

Just make sure you change this installation back to the main repo before merging.


Copy link

review-notebook-app bot commented Aug 30, 2024

View / edit / reply to this conversation on ReviewNB

mostafajahanifar commented on 2024-08-30T18:02:05Z
----------------------------------------------------------------

if you want, you can also add a reference to tissue masking example notebook here in the paranthesis in the first sentence.

... wsi through a simple otsu threshold approach (for more information on tissue masking, please see tiatoolbox/examples/03-tissue-masking.ipynb at master · TissueImageAnalytics/tiatoolbox (github.com))


Copy link
Collaborator

@mostafajahanifar mostafajahanifar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, Mark! Great PR 💯

I only made some minor comments on the Notebook, feel free to make them or to ignore them.

@shaneahmed shaneahmed merged commit 76f02f8 into develop Oct 18, 2024
27 checks passed
@shaneahmed shaneahmed deleted the patch-extractor-filter branch October 18, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants