Skip to content

Tumor FROC Evaluation #1878

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

Merged
merged 47 commits into from
Mar 31, 2021
Merged

Conversation

bhashemian
Copy link
Member

@bhashemian bhashemian commented Mar 28, 2021

Fixes #1872

Description

It a reimplementation of #1873 that

  • Uses WSIReader to support both OpenSlide and CuCIM
  • Updates class, methods, parameters, and variables's names to be more representative
  • Restructures the process for more modularity
  • Receives the probability map of inference outputs
  • Applies non-maximal suppression
  • Adds level and pixel_pacing to the input
  • Removes redundant calculations
  • Rewrites compute_evaluation_mask, now is compute_multi_instance_mask
  • Rewrites compute_itc_list, now is compute_isolated_tumor_cells

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Behrooz <[email protected]>
@bhashemian bhashemian changed the title [WIP] Tumor FROC Evaluation Tumor FROC Evaluation Mar 28, 2021
@bhashemian
Copy link
Member Author

@yiheng-wang-nv, is there any other issue that I can address before merging?

@bhashemian bhashemian enabled auto-merge (squash) March 30, 2021 22:47
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks I put some comments inline

box_size=48,
)

def _load_data(self, file_path: str) -> List[Dict]:
Copy link
Contributor

Choose a reason for hiding this comment

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

could you remove _load_data, this data list should be read before this metric computation, to be consistent with the other metric modules

Copy link
Member Author

Choose a reason for hiding this comment

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

This metrics supports the case that that is loaded too. _load_data is optional in case the data is not loaded and can provide the json path only.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is to be consistent across the project. the data working group is proposing prototypes for data representation, before we have a concrete design we shouldn't assume a JSON encoded file here

threshold: the threashold to fill holes
"""
# make sure it is between 0 and 1
assert 0 <= mask.max() <= 1, "The input mask should be a binary mask!"
Copy link
Contributor

Choose a reason for hiding this comment

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


return froc_score

def compute_multi_instance_mask(self, mask: np.ndarray, threshold: float):
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be a generic postprocessing utility as self is not used.


return multi_instance_mask

def compute_isolated_tumor_cells(self, tumor_mask: np.ndarray, threshold: float) -> List[int]:
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be a generic postprocessing utility as self is not used.

Evaluate with Free Response Operating Characteristic (FROC) score.

Args:
data: either the list of dictionaries containg probability maps (inference result) and
Copy link
Contributor

Choose a reason for hiding this comment

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

typo "containg"


def evaluate(self):
"""
Evalaute the detection performance of a model based on the model probability map output,
Copy link
Contributor

Choose a reason for hiding this comment

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

typo Evalaute


Args:
mask: the binary mask array
threshold: the threashold to fill holes
Copy link
Contributor

Choose a reason for hiding this comment

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

typo threashold

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks!

@bhashemian bhashemian merged commit 1314701 into Project-MONAI:master Mar 31, 2021
wyli added a commit to wyli/MONAI that referenced this pull request Apr 1, 2021
@wyli wyli mentioned this pull request Apr 1, 2021
1 task
bhashemian added a commit that referenced this pull request Apr 1, 2021
* followup of #1878, fixes tests, remove json loading

Signed-off-by: Wenqi Li <[email protected]>

* Update test ordinal numbers

Signed-off-by: Behrooz <[email protected]>

Co-authored-by: Behrooz <[email protected]>
@bhashemian bhashemian deleted the calculate_froc branch April 12, 2021 20:22
nsrivathsa pushed a commit to nsrivathsa/MONAI that referenced this pull request Apr 12, 2021
* followup of Project-MONAI#1878, fixes tests, remove json loading

Signed-off-by: Wenqi Li <[email protected]>

* Update test ordinal numbers

Signed-off-by: Behrooz <[email protected]>

Co-authored-by: Behrooz <[email protected]>
Signed-off-by: Neha Srivathsa <[email protected]>
@kevinkwshin
Copy link

can this module apply to 3d FROC?

@bhashemian
Copy link
Member Author

can this module apply to 3d FROC?

Hi @kevinkwshin, thank for your question. This FROC is particular to pathology applications so it only supports 2D FROC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Pathology based FROC metric calculation class
4 participants