Project-MONAI / Project-MONAI/MONAI

Add WSIPatchDataset with sampling from masks

Open
#7,402 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Contribution wanted Feature request
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

Is your feature request related to a problem? Please describe.
Currently, in the context of pathology, PatchWSIDataset accepts

[
    {"image": "path/to/image1.tiff", "location": [200, 500], "label": 0},
    {"image": "path/to/image2.tiff", "location": [100, 700], "patch_size": [20, 20], "patch_level": 2, "label": 1},
]

Consider the following sampling strategy:

  1. sample from a distribution of labels
  2. using that label, sample from all available annotations of that label
  3. using that annotation, sample a location
  4. using that location, sample a patch from the WSI using PatchWSIDataset

A lot of the strategy must be done outside WSIPatchDatset.

Describe the solution you'd like
It would be nice to have these sampling strategies available out of the box, e.g. make SlidingPatchWSIDataset accept masks too or make PatchWSIDataset accept masks and sampling probabilities of classes.

Describe alternatives you've considered
The strategy is implemented by WholeSlideData. It associates annotations with images.
PathML also supports loading masks and slides simultaneously, so does TIA Toolbox.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing PatchWSIDataset and SlidingPatchWSIDataset implementations, focusing on how they handle WSI locations and patch extraction. Compare the requested mask-based label and location sampling with the WholeSlideData, PathML, and TIA Toolbox approaches referenced in the issue. Done means a MONAI dataset can sample labels, annotations, and WSI patches from masks using configurable class probabilities.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.