train_tools.measures — spacr 0.5.0 documentation

# train_tools.measures

Adapted from the following references: [1] https://github.com/JunMa11/NeurIPS-CellSeg/blob/main/baseline/compute_metric.py [2] https://github.com/stardist/stardist/blob/master/stardist/matching.py

## Module Contents

train_tools.measures.evaluate_f1_score_cellseg(masks_true, masks_pred, threshold=0.5)

  Get confusion elements for cell segmentation results. Boundary pixels are not considered during evaluation.

train_tools.measures.evaluate_f1_score(tp, fp, fn)

  Evaluate F1-score for the given confusion elements