Skip to content

Commit

Permalink
Fix division checks
Browse files Browse the repository at this point in the history
  • Loading branch information
anwai98 committed Aug 27, 2024
1 parent 582c2bd commit 979e9c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
10 changes: 5 additions & 5 deletions scripts/automatic_tracks.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
,Cell_ID,Start,End,Parent_ID
0,1,0,0,0
1,2,1,6,0
1,2,1,6,1
2,10,1,1,1
3,3,7,14,0
3,3,7,14,2
4,8,7,8,2
5,4,15,15,3
6,6,15,23,3
Expand All @@ -22,11 +22,11 @@
20,45,4,23,44
21,47,4,23,44
22,50,0,4,0
23,51,5,13,0
23,51,5,13,50
24,62,5,23,50
25,52,14,15,51
26,54,14,14,0
27,55,15,16,0
26,54,14,14,51
27,55,15,16,54
28,60,15,15,54
29,56,17,22,55
30,58,17,23,55
Expand Down
15 changes: 7 additions & 8 deletions scripts/measure_for_automatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,28 @@ def _get_tracks_to_isbi():
parent_id = int(parent_id)
frames = np.where(segmentation == parent_id)[0]

if parent_id in track_info:
parent_val = track_info[parent_id]['parent']
else:
parent_val = None

# store the parent's track information
track_info[parent_id] = {
'frames': list(np.unique(frames)),
'daughters': list(daughter_ids),
'frame_div': frames.max() + 1,
'parent': None,
'parent': parent_val,
'label': parent_id,
}

# next, store the daughter's track information
for daughter_id in daughter_ids:
frames = np.where(segmentation == daughter_id)[0]

if daughter_id in data: # we check if this daughter undergoes further divisions
parent_val = None
else:
parent_val = parent_id

track_info[daughter_id] = {
'frames': list(np.unique(frames)),
'daughters': [],
'frame_div': None,
'parent': parent_val,
'parent': parent_id,
'label': daughter_id
}

Expand Down

0 comments on commit 979e9c8

Please sign in to comment.