Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create converter for Trackmate files #5

Closed
K-Meech opened this issue Sep 25, 2024 · 4 comments
Closed

Create converter for Trackmate files #5

K-Meech opened this issue Sep 25, 2024 · 4 comments

Comments

@K-Meech
Copy link
Contributor

K-Meech commented Sep 25, 2024

Create a converter for trackmate output files to the cell tracking challenge format.

Output files

Trackmate has two types of output files:

  • a .xml file storing tracks/spots + all information about the trackmate session (made by clicking the save button in the bottom left)
  • three track csv files for edges, spots and tracks (made by clicking the Tracks button then Export to csv for each)

The xml file seems to contain all the information of the csv files plus some extras. The csv files seem to be provided just to give a more convenient output.

Existing converters

There's an existing CTC converter that comes by default with Trackmate. Can only set the location it saves to, and whether it is gold truth, silver truth or results. Seems to always output both images + text files of tracks (image output can be slow, ideally this could be turned off)

@K-Meech
Copy link
Contributor Author

K-Meech commented Oct 2, 2024

Extracting other features (not directly in CTC file)

Inter-frame time (i.e. time in seconds that each frame represents)

  • This is stored in the Trackmate .xml: timeunits under Model and timeinterval under ImageData.
  • It should also be possible to extract this from a trackmate spots .csv. This has columns for both time (T) and Frame, so by comparing two spots with different T/F you could calculate the time/frame. The time unit is also listed in the fourth row for time-related columns.

Right-censoring

There doesn't seem to be much information that could be relevant to right-censoring. There are no explicit features for a cell going out of frame vs a cell dying or the track being stopped for another reason. See the summary of trackmate features

  • spots table: information about detected spots e.g. location, average intensity, quality score
  • edges table: information about how spots are connected with edges e.g. spot id of source and target, other statistics like velocity / displacement...
  • tracks table: numerical features that apply to a whole track e.g. number of splits, number of merges, average speed...

Missing frames

Again, not much information here that could be relevant. The tracks table does have Number of gaps and Longest gap - these relate to links between two spots that span more than one frame. This could be due to a certain spot disappearing for a frame due to moving out of focus / segmentation failures etc.. It doesn't really indicate that the entire frame was unusable though, rather that it had to infer the presence of certain spots.

@K-Meech
Copy link
Contributor Author

K-Meech commented Oct 7, 2024

Manual labelling of dead / right-censored

Trackmate has the TrackScheme view that displays the lineage tree for each track + various values. This seems to offer two options for manual labels:

  • Spot name: the spot name can be changed by right clicking on a spot in TrackScheme and selecting 'Edit spot name' (to view all spot names can change 'Style' in the top menu bar to 'full'). Note you can also select the spot on the image to highlight it in the TrackScheme. These new names will appear in the spot table under the Label column.

  • Spot colour: in display options of the main trackmate menu, have to select 'Color spots by: Manual spot color'. Can then right click on a spot in TrackScheme and select 'Manual color for one spot'. The r/g/b values for this colour will be saved to the spot table under 'Spot color'

@K-Meech
Copy link
Contributor Author

K-Meech commented Oct 8, 2024

Existing CTC converter

Running the CTC converter and browsing through the output, shows that it will disregard any 'gaps' i.e. edges that span more time than a single frame. This means that if a track contains edges that bridge over small gaps (e.g. from a failed detection on one frame) the track will be split into two in the final file. I don't think this is what we want? (I assume this is done for the image export in CTC format - this will need some kind of segmentation / overlay for every frame. For us, we just want to represent the trackmate tracks as close as possible in the .txt file, so I think we need to allow gaps)

Additional issue: the labels of the tracks in the CTC export don't match ids in the original file. To add information about e.g. manually labelled dead cells we'd have to be able to know which trackmate track corresponds to which row in the CTC table. Challenging with just the start / end frame to go on - would be ambiguous if multiple tracks shared the same...

@K-Meech
Copy link
Contributor Author

K-Meech commented Oct 17, 2024

Closing as complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant