Jamie-Dean-Lab / Lineage-analysis

for private use only; work in progress
0 stars 1 forks source link

Create converter for btrack files #8

Open K-Meech opened 1 week ago

K-Meech commented 1 week ago

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

Output files

Btrack outputs to an HDF5 file containing various outputs:

Existing converters

There are no existing CTC converters, but btrack already seems to be using pretty much this format. We can extract the text file with python:

import h5py
with h5py.File("tracks.h5", "r") as f:
    dset = f['tracks']['obj_type_1']["LBEPR"]
    arr = dset[:]

or directly use their export_LBEP function We may want to consider adding options to the btrack napari plugin, for those who don't use any python code.

K-Meech commented 1 day ago

Extracting other features (not directly in CTC file)

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

Update: one of the main maintainers confirmed in their repo's discussions that: 'Unless the timestamps were explicitly added as metadata, then there's no guarantee that they will be stored. The file format uses an integer index by default for the frames.'

Right-censoring

Btrack assigns each track a fate which could be useful here. The different fates are available on their repo, but don't have much documentation. In the btrack paper under 2.3.4 Global Track Optimization they are listed as:

Browsing around in their example jupyter notebook, as well as visualising in napari would mark the following as relevant:

These are assigned with a certain likelihood based on their hypothesis model, so I think using them to create the right-censoring column should be optional. We could have two flags:

Missing frames

I couldn't see anything directly related to missing frames.