Project-MONAI / Project-MONAI/MONAI
Add WSIPatchDataset with sampling from masks
Nobody has claimed this yet.
- 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:
- sample from a distribution of labels
- using that label, sample from all available annotations of that label
- using that annotation, sample a location
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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