Skip to content

Add WSIPatchDataset with sampling from masks #7402

@siemdejong

Description

@siemdejong

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions