Skip to main content

traccuracy: Evaluate Cell Tracking Solutions

License PyPI Python Version CI Benchmarking Documentation Status codecov

traccuracy provides a suite of benchmarking functions that can be used to evaluate cell tracking solutions against ground truth annotations. The goal of this library is to provide a convenient way to run rigorous evaluation and to document and consolidate the wide variety of metrics used in the field.

traccuracy can compute a comprehensive set of metrics for evaluating cell linking and division performance, and can compute biologically meaningful metrics such as the number of correctly reconstructed lineages over N frames and cell cycle length accuracy. As matching ground truth and predicted lineages is a crucial step for performing evaluation, traccuracy includes a number of algorithms for matching ground truth and predicted lineages, both with and without segmentation masks.

Learn more in the documentation or check out the source code.

Installation

pip install traccuracy

How It Works

The traccuracy library has three main components: loaders, matchers, and metrics.

Loaders load tracking graphs from other formats, such as the CTC format, into a TrackingGraph object. A TrackingGraph is a spatiotemporal graph backed by a networkx.DiGraph Nodes represent a single cell in a given time point, and are annotated with a time and a location. Edges point forward in time from a node representing a cell in time point t to the same cell or its daughter in frame t+1 (or beyond, to represent skip edges). Additional terminology is documented in the glossary To load TrackingGraphs from a custom format, you will likely need to implement a loader: see documentation here for more information. Alternatively you can initialize a TrackingGraph with a networkx.DiGraph and ArrayLike objects of segmentation masks if needed.

Matchers take a ground truth and a predicted TrackingGraph with optional segmentation masks and match the nodes and edges to allow evaluation to occur. A list of matchers is available here.

In order to compute metrics, traccuracy begins by annotating the matched graphs with error flags such as False Positive and False Negative. The annotated graph can be exported and used for visualization in other tools. Finally, metrics inspect the error annotations to report both error counts and summary statistics.

The traccuracy library has a flexible Python API, shown in this example notebook. Additionally there is a command line interface for running standard CTC metrics, documented here.

from traccuracy.loaders import load_ctc_data
from traccuracy.matchers import PointMatcher
from traccuracy.metrics import DivisionMetrics, BasicMetrics

# Load data in TrackingGraph objects
gt_data = load_ctc_data(
    "path/to/GT/TRA",
    "path/to/GT/TRA/man_track.txt",
    name="GT"
)
pred_data = load_ctc_data(
    "path/to/prediction",
    "path/to/prediction/track.txt",
    name="prediction"
)

results, matched = run_metrics(
    gt_data=gt_data,
    pred_data=pred_data,
    matcher=PointMatcher(),
    metrics=[DivisionMetrics(), BasicMetrics()]
)

Implemented Metrics

If you use traccuracy in your own work, please let us know so that we can feature it here!

Metadata

Release files for traccuracy 0.4.3

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

Source distribution (sdist)

Source distribution for traccuracy 0.4.3
File Size Uploaded
traccuracy-0.4.3.tar.gz 1.3 MB Details

Built distribution (wheel)

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

Total release size: 1.4 MB

Release files / traccuracy-0.4.3.tar.gz

Download URL traccuracy-0.4.3.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
a1b9b5f1a56248a48ff0ed18456fb26e60b0d7142606a401c9878e30e7d753ef
BLAKE2b-256 checksum
How to use checksums
30cdc31a16d65abdb1c4a43f9f348084cc5a72ef76a7c77107baa36ef9725c48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / traccuracy-0.4.3-py3-none-any.whl

Download URL traccuracy-0.4.3-py3-none-any.whl
Size 69.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
422275d8607b409985f8448234167b19f660899ee05a4467a3e8fad9716c630f
BLAKE2b-256 checksum
How to use checksums
b549860f4666cb46e0e8d4cc0ea292620cd7477fe85bb0ce1ae5e11b5ce31670
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.4.3 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

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