chan-labsite / SC-Track

SC-Track: A biologically inspired algorithm for generating accurate single cell linages
https://github.com/chan-labsite/SC-Track
GNU General Public License v3.0
5 stars 2 forks source link

SC-Track: a robust cell tracking algorithm for generating accurate single cell linages from diverse cell segmentations


How to use SC-Track?

If you have a single-channel segmentation result, the segmentation results should be in a grayscale 2D+t tiff file with each segmented cell instance containing a unique pixel value with the beackground given a pixel value of 0. You will need to run SC-Track from the folder containing the image and mask TIFF files. The command to call SC-Track is as follows:

sctrack -i /path/to/image.tif -a /path/to/mask.tif

When the segmentation results are contained in a VIA2 compatible JSON file, you will need to run SC-Track from the folder containing the image and JSON files. The command to call SC-Track is as follows:

sctrack -i /path/to/image.tif -a /path/to/annotation.json

The file "image.tif" corresponds to the microscopy timelapse image stack, "mask.tif" represents the greyscale segmented cell instances and "annotation.json" is the VIA2 compatible JSON annotation files.

Below is the expected outputs from the tracking results assuming that the "image.tif" and "annotation.json" file was provided.

|__image.tif
|__annotation.json
|__tracking_output\
   ├─track.csv
   └─track_visualisation.tif

The track_visualization.tif are greyscale images visualising the tracking results, and track.csv is a detailed table of the tracking results.

For specific information about the track.csv, see https://github.com/chan-labsite/SC-Track/blob/master/notebook/quick-start.ipynb.

SC-Track can run without the corresponding "image.tif" file. In this case, SC-Track will output the tracking results without a corresponding track_visualization.tif folder containing the labelled cell linages.

To access our demo dataset, you can visit here.


Installation

To install the latest version of SC-Track, please download SC-Track from this github repository, navigate to the downloaded SC-Track folder where setup.py is located and run the command:

python setup.py install

Note:

On some systems, the required package pylibtiff cannot be installed directly by pip. Please use the following command instead:

conda install libtiff

or you can download the wheel package from here, and use the command pip install pylibtiff.whl to install the package.

On Linux or macOS, you can use the command pip install pylibtiff.

The installation times on a "normal" desktop computer should not exceed 5 minutes assuming that the computer is connected to a reasonably fast (10 Mbps) broadband connection.

If you encounter the following error ValueError: Failed to find TIFF header file, you can try running sudo apt-get install libtiff5-dev to fix the error.


Usage

To automate SC-Track for batch processing, please refer to our source code for additional documentation. Its basic usage is:

from SCTrack.track import start_track

image = 'path/to/image.tif'

# using mask annotation
annotation_mask = '/path/to/annotation.tif'
start_track(fannotation=annotation_mask, fimage=image, basename='image', track_range=None, fout='/path/to/dir')

# using json file annotation
annotation_json = '/path/to/annotation.json'
start_track(fannotation=annotation_json, fimage=image, basename='image', track_range=None, fout='/path/to/dir')

Using guidance

To see the using guidance, please refer our quick-start.


API Documentation

For more information, please see the reference documents.

Please cite our paper if you found this package useful.

SC-Track: a robust cell tracking algorithm for generating accurate single cell linages from diverse cell segmentations
Chengxin Li,Shuang Shuang Xie,Jiaqi Wang,Septavera Sharvia,Kuan Yoow Chan
https://doi.org/10.1101/2023.10.03.560639