cellmil.dataset.dataset_creator

Classes

DatasetCreator(config)

Class to create a dataset for MIL training based on the provided configuration.

class cellmil.dataset.dataset_creator.DatasetCreator(config: DatasetCreatorConfig)[source]

Bases: object

Class to create a dataset for MIL training based on the provided configuration.

__init__(config: DatasetCreatorConfig)[source]
_check_config()[source]

Check the configuration for any issues.

_read_excel()[source]

Read the Excel file specified in the configuration.

_preprocess_excel()[source]

Preprocess the Excel data to ensure paths are correctly formatted.

_get_magnification_openslide(path: str) float | None[source]

Extract magnification from slide metadata using openslide.

_load_progress() dict[str, list[str]][source]

Load previous progress from log.json if it exists.

_extract_features(patched_slide_path: Path, extractor: ExtractorType, wsi_path: Optional[Path] = None, graph_method: Optional[GraphCreatorType] = None, segmentation_model: Optional[ModelType] = None)[source]

Extract features from the segmented cells.

create()[source]

Create the dataset based on the configuration.