tumourkit.segmentation.evaluate.get_pairs

tumourkit.segmentation.evaluate.get_pairs(gt_centroids: List[Tuple[int, int, int]], pred_centroids: List[Tuple[int, int, int]]) Tuple[ndarray, ndarray]

Retrieves true and predicted labels ordered by their correspondences.

Each centroid is represented by a 3-tuple with (X, Y, class). The class is represented as 1=non-tumour, 2=tumour. The returned labels are ordered starting from 0.

Parameters:
  • gt_centroids (List[Tuple[int, int, int]]) – The ground truth centroids represented as a list of 3-tuples (X, Y, class).

  • pred_centroids (List[Tuple[int, int, int]]) – The predicted centroids represented as a list of 3-tuples (X, Y, class).

Returns:

A tuple containing the true labels and predicted labels ordered by their correspondences.

Return type:

Tuple[np.ndarray, np.ndarray]