biapol_utilities.label.compare_labels

biapol_utilities.label.compare_labels(label_image_x, label_image_y)

Evaluate differences between two label images.

Compares two label images to determine the label-wise Jaccard- and Dice scores. The Jaccard-score is defined as the intersection over union of two labelled images 1. The Dice score S can be derived from the Jaccard-score J through the following relation:

\[S = \frac{2J}{1+J}\]
Parameters
  • label_image_x (ND-array, int) – label image of arbitrary dimensions.

  • label_image_y (ND-array, int) – label image which will be compared to label_image_x, must have the same dimensions.

Returns

The function returns a pandas dataframe with columns [‘label’, ‘jaccard_score’, ‘dice_score’]. Each row corresponds to the measured quantitiy (Jaccard- or Dice score) of the respective label.

Return type

Pandas dataframe

References

1

https://en.wikipedia.org/wiki/Jaccard_index