@@ -254,13 +254,13 @@ def compute_surface_distances(mask_gt,
254254 distmap_gt = ndimage .morphology .distance_transform_edt (
255255 ~ borders_gt , sampling = spacing_mm )
256256 else :
257- distmap_gt = np .Inf * np .ones (borders_gt .shape )
257+ distmap_gt = np .inf * np .ones (borders_gt .shape )
258258
259259 if borders_pred .any ():
260260 distmap_pred = ndimage .morphology .distance_transform_edt (
261261 ~ borders_pred , sampling = spacing_mm )
262262 else :
263- distmap_pred = np .Inf * np .ones (borders_pred .shape )
263+ distmap_pred = np .inf * np .ones (borders_pred .shape )
264264
265265 # compute the area of each surface element
266266 surface_area_map_gt = neighbour_code_to_surface_area [neighbour_code_map_gt ]
@@ -348,7 +348,7 @@ def compute_robust_hausdorff(surface_distances, percent):
348348 perc_distance_gt_to_pred = distances_gt_to_pred [
349349 min (idx , len (distances_gt_to_pred )- 1 )]
350350 else :
351- perc_distance_gt_to_pred = np .Inf
351+ perc_distance_gt_to_pred = np .inf
352352
353353 if len (distances_pred_to_gt ) > 0 : # pylint: disable=g-explicit-length-test
354354 surfel_areas_cum_pred = (np .cumsum (surfel_areas_pred ) /
@@ -357,7 +357,7 @@ def compute_robust_hausdorff(surface_distances, percent):
357357 perc_distance_pred_to_gt = distances_pred_to_gt [
358358 min (idx , len (distances_pred_to_gt )- 1 )]
359359 else :
360- perc_distance_pred_to_gt = np .Inf
360+ perc_distance_pred_to_gt = np .inf
361361
362362 return max (perc_distance_gt_to_pred , perc_distance_pred_to_gt )
363363
@@ -438,6 +438,6 @@ def compute_dice_coefficient(mask_gt, mask_pred):
438438 """
439439 volume_sum = mask_gt .sum () + mask_pred .sum ()
440440 if volume_sum == 0 :
441- return np .NaN
441+ return np .nan
442442 volume_intersect = (mask_gt & mask_pred ).sum ()
443443 return 2 * volume_intersect / volume_sum
0 commit comments