Skip to content

Commit 4f6b93c

Browse files
committed
Made the daughter2daughter and mother2mother matching unique, different to the AOGM measure where a computed mask can be assigned to multiple result masks (like in the FiJI plugin).
1 parent aee776b commit 4f6b93c

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

  • ctc_metrics/metrics/biological

ctc_metrics/metrics/biological/bc.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def is_matching(
9191
ind = np.argwhere(mr == id_ref).squeeze()
9292
if mc[ind] != id_comp:
9393
return False
94+
# Check if the parent match is unique, i.e. the computed track is only assigned to one gt
95+
if mc.count(mc[ind]) != 1:
96+
return False
9497
# Compare children
9598
# Iterate over all GT ids and check if the first detection is matched to the correct reference children
9699
# See discussion here https://github.com/CellTrackingChallenge/py-ctcmetrics/issues/22
@@ -106,10 +109,12 @@ def is_matching(
106109
if i in mapped_ref[t_max] and j in mapped_comp[t_max]:
107110
ind = mapped_ref[t_max].index(i)
108111
if mapped_comp[t_max][ind] == j:
109-
# There is a match!
110-
if j not in matched_children:
111-
matched_children.append(j)
112-
break
112+
# Check if the daughter match is unique, i.e. the computed track is only assigned to one gt
113+
if mapped_comp[t_max].count(j) == 1:
114+
# There is a match!
115+
if j not in matched_children:
116+
matched_children.append(j)
117+
break
113118

114119
if len(matched_children) != len(ref_children):
115120
return False
@@ -203,6 +208,7 @@ def raw_division_metrics(
203208
i
204209
):
205210
matches.append((ref, comp))
211+
206212
return (len(matches), len(ends_with_split_comp) - len(matches), len(ends_with_split_ref) - len(matches))
207213

208214

0 commit comments

Comments
 (0)