Skip to content

Commit b657d58

Browse files
authored
Merge pull request #144 from BBQuercus/trackmate_format_update
TrackMate output file changes
2 parents a621af2 + 3d1dae2 commit b657d58

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

deepblink/cli/_create.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ def convert_labels(
184184
df = df.rename(columns={"X": "c", "Y": "r"})[["r", "c"]]
185185
# TrackMate export format
186186
elif all(c in df.columns for c in ("POSITION_X", "POSITION_Y")):
187-
df = df[~df.index.isna()] # Remove unused headers for TrackMate v7.0.0+
187+
df = df[
188+
(~df.index.isna()) & (df.index.str.lower() != "label")
189+
] # Remove unused headers for TrackMate v7.0.0+
188190
df = df.rename(columns={"POSITION_X": "c", "POSITION_Y": "r"})[["r", "c"]]
189191
df = df.reset_index(drop=True)
190192
else:
File renamed without changes.
File renamed without changes.

tests/data/input_trackmate_7.7+.csv

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
LABEL,ID,TRACK_ID,QUALITY,POSITION_X,POSITION_Y,POSITION_Z,POSITION_T,FRAME,RADIUS,VISIBILITY
2+
Label,Spot ID,Track ID,Quality,X,Y,Z,T,Frame,Radius,Visibility
3+
Label,Spot ID,Track ID,Quality,X,Y,Z,T,Frame,R,Visibility
4+
,,,(quality),(micron),(micron),(micron),(sec),,(micron),
5+
ID2222,2222,,4370.76220703125,30.7670334432784,56.672136700919864,0.0,0.0,0,0.2017290601201014,1
6+
ID2223,2223,,6644.85693359375,32.286458801647804,59.79454990816701,0.0,0.0,0,0.2017290601201014,1
7+
ID2225,2225,,4078.255859375,31.736066013414028,70.03157152363852,0.0,0.0,0,0.2017290601201014,1
8+
ID2226,2226,,4022.391845703125,47.641303205975085,51.394360866478934,0.0,0.0,0,0.2017290601201014,1
9+
ID2227,2227,,6974.37548828125,46.74081825159567,48.52312950033919,0.0,0.0,0,0.2017290601201014,1
10+
ID2228,2228,,4659.05810546875,39.851282606785844,54.13192639279647,0.0,0.0,0,0.2017290601201014,1

tests/test_cli.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ def test_create():
5656

5757
labels = [
5858
os.path.join(os.path.dirname(__file__), "./data/input_manual.csv"),
59-
os.path.join(os.path.dirname(__file__), "./data/input_trackmate_post7.csv"),
60-
os.path.join(os.path.dirname(__file__), "./data/input_trackmate_pre7.csv"),
59+
os.path.join(os.path.dirname(__file__), "./data/input_trackmate_7.7+.csv"),
60+
os.path.join(os.path.dirname(__file__), "./data/input_trackmate_7.0+.csv"),
61+
os.path.join(os.path.dirname(__file__), "./data/input_trackmate_7.0-.csv"),
6162
]
6263
max_size = 100
6364
image = np.zeros((max_size, max_size))

0 commit comments

Comments
 (0)