Skip to content

Commit

Permalink
return nan in surface metrics for empty labels
Browse files Browse the repository at this point in the history
  • Loading branch information
rnfinnegan committed Feb 1, 2022
1 parent 0b5eba7 commit a32080b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions platipy/imaging/label/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def compute_metric_masd(label_a, label_b, auto_crop=True):
sitk.GetArrayViewFromImage(label_a).sum() == 0
or sitk.GetArrayViewFromImage(label_b).sum() == 0
):
return -1
return np.nan

if auto_crop:
largest_region = (label_a + label_b) > 0
Expand Down Expand Up @@ -278,7 +278,7 @@ def compute_metric_hd(label_a, label_b, auto_crop=True):
sitk.GetArrayViewFromImage(label_a).sum() == 0
or sitk.GetArrayViewFromImage(label_b).sum() == 0
):
return -1
return np.nan
if auto_crop:
largest_region = (label_a + label_b) > 0
crop_box_size, crop_box_index = label_to_roi(largest_region)
Expand Down

0 comments on commit a32080b

Please sign in to comment.