Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alessiamarcolini
Copy link
Collaborator

@alessiamarcolini alessiamarcolini commented Nov 29, 2021

Description

This PR fixes the calculation of the tissue mask (and related usages) in case we have a tile completely covered with tissue.

From #357 "Sometimes the filters used to extract the tissue mask of the tile are not identifying the whole tissue, but the cell nuclei only. Therefore during tile extraction from the WSI, the tile will be wrongly discarded as if it contained too much background."

In order to solve this, the filters are applied on the tile with a white border of 10px, and then the border is removed from the returned mask.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@alessiamarcolini alessiamarcolini requested review from ernestoarbitrio and nicolebussola and removed request for nicolebussola November 29, 2021 15:08
@alessiamarcolini alessiamarcolini added this to the 0.4.1 milestone Nov 29, 2021
@alessiamarcolini alessiamarcolini added the bug Something isn't working label Nov 29, 2021
@alessiamarcolini alessiamarcolini force-pushed the fix-tissue-mask-tile-full-tissue branch from 3c45c19 to c0d925b Compare November 29, 2021 15:09
@codecov
Copy link

codecov bot commented Nov 29, 2021

Codecov Report

Merging #360 (070c3e3) into master (19722a0) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #360   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1409      1411    +2     
  Branches       218       218           
=========================================
+ Hits          1409      1411    +2     
Impacted Files Coverage Δ
histolab/scorer.py 100.00% <ø> (ø)
histolab/masks.py 100.00% <100.00%> (ø)
histolab/tile.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19722a0...070c3e3. Read the comment docs.

Returns
-------
mask: np.ndarray
Copy link
Collaborator

Choose a reason for hiding this comment

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

docstring.

Is it necessary to have this as a method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

docstring.

what do you mean?

Is it necessary to have this as a method?

I like the idea of having TissueMask that is flexible and does the right thing based on the input

@ernestoarbitrio thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

I do not understand the matter ... sorry

@alessiamarcolini alessiamarcolini force-pushed the fix-tissue-mask-tile-full-tissue branch from 3e8b988 to a87eb06 Compare December 6, 2021 15:53
Copy link
Collaborator

@nicolebussola nicolebussola left a comment

Choose a reason for hiding this comment

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

LGTM

@ernestoarbitrio ernestoarbitrio merged commit 192f081 into master Dec 7, 2021
@ernestoarbitrio ernestoarbitrio deleted the fix-tissue-mask-tile-full-tissue branch December 7, 2021 13:20
alessiamarcolini added a commit that referenced this pull request Aug 18, 2023
This was already addressed in the past in #360, but 10px of border thickness is not enough for some use cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tile.has_enough_tissue sometimes returns False on tiles with tissue only

4 participants