Skip to main content

track2p

Cell tracking for longitudinal calcium imaging recordings.

PyPI version All time downloads Monthly downloads License: GPL v3

For more detailed information on installation and use visit:

https://track2p.github.io/

Or read the preprint.

Installation

Installing via pip

First we need to set up a conda environment with python 3.9:

conda create --name track2p python=3.9
conda activate track2p

Then simply install the track2p package using pip:

pip install track2p

Thats it, track2p should be succesfully set up :) You can simply run it by:

python -m track2p

This opens a GUI allowing the user to launch the algorithm and visualise the results interactively.

(For instructions on running track2p without the GUI see the 'Run via script' under the 'Usage' section)

Note: For common installation issues see 'Installation > Common issues' in documentation.

Reinstall

To reinstall, open anaconda and remove the environment with:

conda env remove -n track2p

Then follow the 'Installing via pip' instructions above :)

Usage

Run track2p through the GUI

After activating the GUI through python -m track2p the user should navigate to the 'Run' tab on the top left of the window and select 'Run track2p algorithm' from the dropdown menu.

This will open a pop-up window that will allow the user to set the paths to suite2p datasets and to set the algorithm parameters. After configuring these settings, the user can click 'Run' to run the track2p algorithm, and the progress will be displayed in the terminal.

Once the algorithm finishes a subsequent pop-up window will prompt the user to decide whether they wish to visualize the results within the interface.

For more details on how to run the algorithm through the GUI see run track2p and for more description of parameters see documentation parameters.

Run track2p via script

To run via script you can use the run_track2p.py script in the root of this repo as a template. It is exactly the same as running thrugh the gui, only that the paths and the parameters are defined within the script (for more on parameters etc. see documentation). When running make sure you are running it within the track2p environment, for example:

conda activate track2p
python -m run_track2p

Visualising track2p outputs within the GUI

After activating the GUI through python -m track2p the user can import the results of any previous analysis by clicking on 'File' tab on the top left of the window and select 'Load processed data' from the dropdown menu. This will open a pop-up window that will allow the user to set the path to the track2p folder (containing the results of the algorithm) and the plane they want to open.

Once completed, the interface showcases multiple visualizations:

ex_all_vizualizations.png

In this example we are using the track2p GUI to visualise the outputs for an experiment containing 7 consecutive daily recordings in mouse barrel cortex (between P8 and P14).

In the upper left, the GUI visualises the mean image of the motion-corrected functional channel (usually green / GCaMP). The image is overlayed with ROIs of the cells detected by track2p across all days, with the color of a particular cell matching across days. These images are interactive, allowing the user to click on a cell, which displays the fluorescence traces on each day at the bottom of the window (sorted from the first day to the last).

In addition, a zoomed-in image of the cell for each day is shown in the top right. Underneath each zoomed-in image the GUI displays this cell's index in the corresponding 'suite2p’ dataset and the 'iscell' probability suite2p has assigned to it on that day.

Finally, the user can browse all the putative matches detected by the algorithm using the bar at the bottom to toggle through matches, or alternatively they can enter the index of a specific number to display it within the GUI. This bar is also used for manual curation, where we allow the user to evaluate the quality of the tracking for each individual match.

For more details on how to use the GUI see GUI usage

Outputs

All the outputs of the script will be saved in a track2p folder created within the track_ops.save_path directory specified by the user when running the algorithm. For an introduction on how to use the outputs for further downstream analysis we provide a useful demo notebook demo_t2p_output.ipynb in the root of this repository. Note: You will need to additionally install jupyter for this to work. For example:

conda install conda-forge::jupyterlab

For more information see documentation relating to track2p viusalisations and outputs.

Reference

For now if you use the algorithm please reference the preprint:

Majnik, J., Mantez, M., Zangila, S., Bugeon S., Guignard L., Platel, J. C. & Cossart, R. (2025). Longitudinal tracking of neuronal activity from the same cells in the developing brain using Track2p. bioRxiv.

You can also see a Youtube recording of a talk related to the preprint: Link to video (starting at 47:20)


By Cossart Lab (Jure Majnik & Manon Mantez)

Logo by Eleonora Ambrad Giovannetti

© Copyright 2025.

Metadata

Release files for track2p 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for track2p 0.6.2
File Size Uploaded
track2p-0.6.2.tar.gz 121.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for track2p 0.6.2
File Interpreter ABI Platform
track2p-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 247.6 kB

Release files / track2p-0.6.2.tar.gz

Download URL track2p-0.6.2.tar.gz
Size 121.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3c4c5be4a0437658221ce53285cf962099070d3a75ae7a55d234371cca1a3c24
BLAKE2b-256 checksum
How to use checksums
6b80d684f9a07b7ed3ae0d8882455c9844c5ab76d5ac26d388d72cf992715698
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / track2p-0.6.2-py3-none-any.whl

Download URL track2p-0.6.2-py3-none-any.whl
Size 125.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b75435370d193740efec59b3de88bb0df6a85c74f4dcf54c1e6a98cb20d59cbc
BLAKE2b-256 checksum
How to use checksums
e32349ea1e53339913487f9692d7c6fb411e8c94244f3c23b0a0816c9aef544b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

1 release file

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page