weigertlab / trackastra

BSD 3-Clause "New" or "Revised" License
49 stars 10 forks source link

Conversion of .txt tracks to .csv to work with CellTracksColab #12

Open raeesahhy opened 2 weeks ago

raeesahhy commented 2 weeks ago

Hi all,

I managed to get Trackastra to work on my 4D dataset (515x512 xy with 81 z-steps and 5 timepoints), however I'd like to convert the tracking file from .txt to .csv format so I can work with it in CellTracksColab. However, my data is in this form:

1 0 1 0 2 0 4 0 3 0 4 0 ... (Full .txt file: res_track.txt)

And I don't think I'm fully understanding the format of this result; the first column should be unique track ID and the second may be timepoints, but the meaning of the third column eludes me as some values jump up to 1339. I can't figure out how to get x/y/z coordinates out of this result, which I need for CellTracksColab. Alternatively, would appreciate pointers to any tracking analysis packages you may know which can work with this .txt file (if I did everything correctly).

maweigert commented 2 weeks ago

Hi,

The output file is in CTC format, i.e.

text file representing an acyclic graph for the whole video. Every line corresponds
to a single track that is encoded by four numbers separated by a space:

L B E P where

L - a unique label of the track (label of markers, 16-bit positive value)
B - a zero-based temporal index of the frame in which the track begins
E - a zero-based temporal index of the frame in which the track ends
P - label of the parent track (0 is used when no parent is defined)

Hope that helps!