Skip to content

Commit 7773e94

Browse files
author
anna-grim
committed
bug: erl
1 parent 5858ca4 commit 7773e94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/segmentation_skeleton_metrics/skeleton_metric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ def compute_erl(self):
754754

755755
path_length = gutils.compute_path_length(target_graph)
756756
run_lengths = gutils.compute_run_lengths(pred_graph)
757-
wgt = run_lengths / np.sum(run_lengths)
757+
wgt = run_lengths / max(np.sum(run_lengths), 1)
758758

759759
self.erl[swc_id] = np.sum(wgt * run_lengths)
760760
self.normalized_erl[swc_id] = self.erl[swc_id] / path_length

0 commit comments

Comments
 (0)