livecellx.segment.utils.match_mask_labels_by_iou

livecellx.segment.utils.match_mask_labels_by_iou(seg_label_mask, gt_label_mask, bg_label=0, return_all=False)[source]

compute the similarity between ground truth mask and segmentation mask by intersection over union

Parameters:
  • seg_label_mask (_type_) – _description_

  • gt_label_mask (_type_) – _description_

  • bg_label (int, optional) – _description_, by default 0

  • return_all (bool, optional) – _description_, by default False

Returns:

A <gt2seg_map>, mapping ground truth keys to a dictionary of the best matching segmentation label and its iou