cellmil.interfaces

class cellmil.interfaces.PatchExtractorConfig(*, output_path: Path, wsi_path: Path, patch_size: int, patch_overlap: float | int, target_mag: float)[source]

Bases: BaseModel

Configuration for data preparation

output_path: Path
wsi_path: Path
patch_size: int
patch_overlap: float | int
target_mag: float
classmethod validate_overlap(v: int | float) float | int[source]
class Config[source]

Bases: object

arbitrary_types_allowed = True
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cellmil.interfaces.CellSegmenterConfig(*, model: ModelType, gpu: int = 0, wsi_path: Path, patched_slide_path: Path)[source]

Bases: BaseModel

Configuration for data preparation

model: ModelType
gpu: int
wsi_path: Path
patched_slide_path: Path
classmethod validate_model(v: str) str[source]
class Config[source]

Bases: object

arbitrary_types_allowed = True
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cellmil.interfaces.FeatureExtractorConfig(*, extractor: ExtractorType, patched_slide_path: Path, wsi_path: Optional[Path] = None, segmentation_model: Optional[ModelType] = None, graph_method: Optional[str] = None)[source]

Bases: BaseModel

Configuration for feature extraction from segmented cells

extractor: ExtractorType
patched_slide_path: Path
wsi_path: Optional[Path]
segmentation_model: Optional[ModelType]
graph_method: Optional[str]
classmethod validate_model(v: str) str[source]
classmethod validate_segmentation_model(v: str | None) str | None[source]
class Config[source]

Bases: object

arbitrary_types_allowed = True
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cellmil.interfaces.MILPredictorConfig(*, model: MILType, gpu: int = 0, patched_slide_path: Path, extractor: ExtractorType, segmentation_model: ModelType, chkpt_path: pathlib.Path | None = None)[source]

Bases: BaseModel

Configuration for MIL prediction using CLAM or standard MIL models

model: MILType
gpu: int
patched_slide_path: Path
extractor: ExtractorType
segmentation_model: ModelType
chkpt_path: pathlib.Path | None
classmethod validate_model(v: str) str[source]
class Config[source]

Bases: object

arbitrary_types_allowed = True
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cellmil.interfaces.DatasetCreatorConfig(*, excel_path: Path, output_path: Path, gpu: int = 0, segmentation_models: list[cellmil.interfaces.CellSegmenterConfig.ModelType] | None, extractors: list[cellmil.interfaces.FeatureExtractorConfig.ExtractorType], graph_methods: list[cellmil.interfaces.GraphCreatorConfig.GraphCreatorType] | None)[source]

Bases: BaseModel

Configuration for creating a dataset for MIL training.

excel_path: Path
output_path: Path
gpu: int
segmentation_models: list[cellmil.interfaces.CellSegmenterConfig.ModelType] | None
extractors: list[cellmil.interfaces.FeatureExtractorConfig.ExtractorType]
graph_methods: list[cellmil.interfaces.GraphCreatorConfig.GraphCreatorType] | None
classmethod validate_segmentation_models(v: list[cellmil.interfaces.CellSegmenterConfig.ModelType]) list[cellmil.interfaces.CellSegmenterConfig.ModelType][source]
classmethod validate_extractors(v: list[cellmil.interfaces.FeatureExtractorConfig.ExtractorType]) list[cellmil.interfaces.FeatureExtractorConfig.ExtractorType][source]
classmethod validate_graph_methods(v: list[cellmil.interfaces.GraphCreatorConfig.GraphCreatorType]) list[cellmil.interfaces.GraphCreatorConfig.GraphCreatorType][source]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cellmil.interfaces.FeatureVisualizerConfig(*, dataset: Path)[source]

Bases: BaseModel

Configuration for feature visualization from a dataset containing multiple slides

dataset: Path
class Config[source]

Bases: object

arbitrary_types_allowed = True
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cellmil.interfaces.MILTrainerConfig(*, root: Path, folder: Path, excel_path: Path, label: str, model: MILType, gpu: int = 0, extractor: cellmil.interfaces.FeatureExtractorConfig.ExtractorType | list[cellmil.interfaces.FeatureExtractorConfig.ExtractorType], segmentation_model: ModelType, graph_creator: GraphCreatorType, ckpt_path: Path, normalization: bool = False, correlation_filter: float = 0.0, cell_type: bool = False, n_bins: int = 4)[source]

Bases: BaseModel

Configuration for MIL prediction using CLAM or standard MIL models

root: Path
folder: Path
excel_path: Path
label: str
model: MILType
gpu: int
extractor: cellmil.interfaces.FeatureExtractorConfig.ExtractorType | list[cellmil.interfaces.FeatureExtractorConfig.ExtractorType]
segmentation_model: ModelType
graph_creator: GraphCreatorType
ckpt_path: Path
normalization: bool
correlation_filter: float
cell_type: bool
n_bins: int
classmethod validate_model(v: str) str[source]
class Config[source]

Bases: object

arbitrary_types_allowed = True
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class cellmil.interfaces.GraphCreatorConfig(*, method: GraphCreatorType, gpu: int = 0, patched_slide_path: Path, segmentation_model: ModelType, plot: bool = True, debug: bool = False)[source]

Bases: BaseModel

Configuration for graph creation from segmented cells

method: GraphCreatorType
gpu: int
patched_slide_path: Path
segmentation_model: ModelType
plot: bool
debug: bool
classmethod validate_model(v: str) str[source]
classmethod validate_segmentation_model(v: str) str[source]
class Config[source]

Bases: object

arbitrary_types_allowed = True
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Modules

cellmil.interfaces.AttentionExplainerConfig

cellmil.interfaces.CellSegmenterConfig(*, model)

Configuration for data preparation

cellmil.interfaces.DatasetCreatorConfig(*, ...)

Configuration for creating a dataset for MIL training.

cellmil.interfaces.EvaluationExternalValidatorConfig

cellmil.interfaces.EvaluationReporterConfig

cellmil.interfaces.FeatureExtractorConfig(*, ...)

Configuration for feature extraction from segmented cells

cellmil.interfaces.FeatureVisualizerConfig(*, ...)

Configuration for feature visualization from a dataset containing multiple slides

cellmil.interfaces.GraphCreatorConfig(*, method)

Configuration for graph creation from segmented cells

cellmil.interfaces.MIL

cellmil.interfaces.MILPredictorConfig(*, model)

Configuration for MIL prediction using CLAM or standard MIL models

cellmil.interfaces.MILTrainerConfig(*, root, ...)

Configuration for MIL prediction using CLAM or standard MIL models

cellmil.interfaces.PatchExtractorConfig(*, ...)

Configuration for data preparation

cellmil.interfaces.SHAPExplainerConfig

cellmil.interfaces.StatsPrinterConfig

cellmil.interfaces.TableConfig