dict_to_store_semantic_segmentor¶
- dict_to_store_semantic_segmentor(patch_output, scale_factor, output_type, class_dict=None, save_path=None, offset=None, *, ignore_index=None, verbose=True)[source]¶
Converts output of TIAToolbox SemanticSegmentor engine to AnnotationStore.
- Parameters:
patch_output (dict | zarr.Group) – A dictionary with “probabilities”, “predictions”, and “labels” keys.
scale_factor (tuple[float, float]) – The scale factor to use when loading the annotations. All coordinates will be multiplied by this factor to allow conversion of annotations saved at non-baseline resolution to baseline. Should be model_mpp/slide_mpp.
output_type (str) – “annotationstore” → return AnnotationStore “qupath” → return QuPath JSON dict
class_dict (dict) – Optional dictionary mapping class indices to class names.
save_path (str or Path) – Optional Output directory to save the Annotation Store results.
offset (np.ndarray | None) – Optional offset to be added to the coordinates of the annotations.
ignore_index (int | None) – Any index to ignore in the layer list. e.g., background. Defaults to 0 (background). If None, all the layers are saved to the annotationstore or JSON file.
verbose (bool) – Whether to display logs and progress bar.
- Returns:
An SQLiteStore containing Annotations for each patch or Path to file storing SQLiteStore containing Annotations for each patch.
- Return type:
(SQLiteStore or Path)