MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

Add WSIPatchDataset with sampling from masks

Open siemdejong opened this issue 2 years ago • 0 comments

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.

siemdejong avatar Jan 18 '24 12:01 siemdejong