Skip to content

data

DetectionDataset

Bases: Dataset

PyTorch dataset for slide segmentation tasks.

Parameters:

Name Type Description Default
slide_paths Sequence[PathLike]

list of slides' filepaths.

required
mask_paths Sequence[PathLike]

list of masks' filepaths. Masks are supposed to be tiled pyramidal images.

required
patches_paths Sequence[PathLike]

list of patch csvs' filepaths. Files must be formatted according to PathAIA API <https://github.com/MicroMedIAn/PathAIA>_.

required
stain_matrices_paths Optional[Sequence[PathLike]]

path to stain matrices .npy files. Each file must contain a (2, 3) matrice to use for stain separation. If not sppecified while stain_augmentor is, stain matrices will be computed at runtime (can cause a bottleneckd uring training).

None
stain_augmentor Optional[StainAugmentor]

:class:~apriorics.transforms.StainAugmentor object to use for stain augmentation.

None
transforms Optional[Sequence[BasicTransform]]

list of albumentation <https://albumentations.ai/>_ transforms to use on images (and on masks when relevant).

None
slide_backend str

whether to use OpenSlide <https://openslide.org/> or cuCIM <https://github.com/rapidsai/cucim> to load slides.

'cucim'

SegmentationDataset

Bases: Dataset

PyTorch dataset for slide segmentation tasks.

Parameters:

Name Type Description Default
slide_paths Sequence[PathLike]

list of slides' filepaths.

required
mask_paths Sequence[PathLike]

list of masks' filepaths. Masks are supposed to be tiled pyramidal images.

required
patches_paths Sequence[PathLike]

list of patch csvs' filepaths. Files must be formatted according to PathAIA API <https://github.com/MicroMedIAn/PathAIA>_.

required
stain_matrices_paths Optional[Sequence[PathLike]]

path to stain matrices .npy files. Each file must contain a (2, 3) matrice to use for stain separation. If not sppecified while stain_augmentor is, stain matrices will be computed at runtime (can cause a bottleneckd uring training).

None
stain_augmentor Optional[StainAugmentor]

:class:~apriorics.transforms.StainAugmentor object to use for stain augmentation.

None
transforms Optional[Sequence[BasicTransform]]

list of albumentation <https://albumentations.ai/>_ transforms to use on images (and on masks when relevant).

None
slide_backend str

whether to use OpenSlide <https://openslide.org/> or cuCIM <https://github.com/rapidsai/cucim> to load slides.

'cucim'

SparseSegmentationDataset

Bases: Dataset

PyTorch dataset for slide segmentation tasks.

Parameters:

Name Type Description Default
slide_paths Sequence[PathLike]

list of slides' filepaths.

required
mask_paths Sequence[PathLike]

list of masks' filepaths. Masks are supposed to be tiled pyramidal images.

required
patches_paths Sequence[PathLike]

list of patch csvs' filepaths. Files must be formatted according to PathAIA API <https://github.com/MicroMedIAn/PathAIA>_.

required
stain_matrices_paths Optional[Sequence[PathLike]]

path to stain matrices .npy files. Each file must contain a (2, 3) matrice to use for stain separation. If not sppecified while stain_augmentor is, stain matrices will be computed at runtime (can cause a bottleneckd uring training).

None
stain_augmentor Optional[StainAugmentor]

:class:~apriorics.transforms.StainAugmentor object to use for stain augmentation.

None
transforms Optional[Sequence[BasicTransform]]

list of albumentation <https://albumentations.ai/>_ transforms to use on images (and on masks when relevant).

None
slide_backend str

whether to use OpenSlide <https://openslide.org/> or cuCIM <https://github.com/rapidsai/cucim> to load slides.

'cucim'