Skip to main content

Utilities for computing common accuracy metrics on cell tracking challenge solutions with ground truth

Project description

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

Featured Works

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traccuracy-0.4.2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traccuracy-0.4.2-py3-none-any.whl (69.8 kB view details)

Uploaded Python 3

File details

Details for the file traccuracy-0.4.2.tar.gz.

File metadata

  • Download URL: traccuracy-0.4.2.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for traccuracy-0.4.2.tar.gz
Algorithm Hash digest
SHA256 8a90a470b88a4e84d3db954365dc62527813ef49a37d5b054ec30f6d5bea73c3
MD5 c08ea790f1e262432a21700696b3d3f6
BLAKE2b-256 6977f1a714a74f24380c97f11077ccbd01e3537945855a2314ac0458c4afb4dc

See more details on using hashes here.

File details

Details for the file traccuracy-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: traccuracy-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 69.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for traccuracy-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1cd6979c55412bebeeb8b65ed647d497829d2045f5e7894e82eefa49aaa25a8e
MD5 6329cdd007822f42ad916a6f370f7964
BLAKE2b-256 475e7190bdd381cfc0b538e5e133d692071da4f53e4c9cc73d243611b975f62f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page