Inferer

Main inferer class to utilize the GlioMODA models. Allows to easily provide various combinations of input modalities to obtain high quality predictions. All available models are listed in the gliomoda.constants module.

class gliomoda.inferer.Inferer(device: str | None = 'cuda', cuda_visible_devices: str | None = '0')

Bases: object

infer(t1c: str | Path | ndarray | None = None, t2f: str | Path | ndarray | None = None, t1n: str | Path | ndarray | None = None, t2w: str | Path | ndarray | None = None, segmentation_file: str | Path | None = None, use_ResEncL: bool = False) ndarray

Infer segmentations based on provided images.

Parameters:
  • t1c (Optional[str | Path | np.ndarray], optional) – T1C image. Defaults to None.

  • t2f (Optional[str | Path | np.ndarray], optional) – T2F image. Defaults to None.

  • t1n (Optional[str | Path | np.ndarray], optional) – T1N image. Defaults to None.

  • t2w (Optional[str | Path | np.ndarray], optional) – T2W image. Defaults to None.

  • segmentation_file (Optional[str | Path], optional) – Segmentation file. Defaults to None.

  • use_ResEncL (bool, optional) – Use ResEncL model (only available when providing all 4 modalities). Defaults to False.

Returns:

Inferred segmentation.

Return type:

np.ndarray