Skip to main content

Biological particle tracking with Python

Project description

ByoTrack

Lint and Test Documentation Status

Unified python API for biological particle tracking.

Many bioimage informatics tools already implement their own tracking tools (Icy, ImageJ, TrackMate...) but most of them are implemented in Java which makes it difficult for non-Java developers to experiment with the code. It is also difficult to integrate deep learning algorithms (mainly developed in Python) into these software.

We provide a unified python API for tracking that can be easily extended with new (and old) algorithms. We also provide implementations of well-known algorithms following our API.

Overview:

  • Video
    • Able to read classical format (supported by opencv) + tiff
  • Particle Tracking
    • MultiStepTracker (Detect / Link / Refine)
  • Particle Detections
    • Wavelet Detector [2] (Similar as the one in Icy [1] but coded in pytorch)
    • Stardist [3] (Inference only. Training should be done with the official implementation)
  • Particle Linking
    • EMHT [4] (Wrapper to the one implemented in Icy [1], requires Icy to be installed)
  • Tracks Refining
    • Cleaning
    • EMC2 [5]: Track stitching (gap closing)
    • Interpolate missing positions

Install

$ pip install byotrack

Some tracker implementations require additional dependencies that are not installed with the library, to use them you need to install their dependencies on your own. Here is the complete list:

Getting started

import byotrack

# Load some specific implementations
from byotrack.implementation.detector.wavelet import WaveletDetector
from byotrack.implementation.linker.icy_emht import IcyEMHTLinker
from byotrack.implementation.refiner.cleaner import Cleaner
from byotrack.implementation.refiner.stitching import EMC2Stitcher

# Read a video from a path, normalize and aggregate channels
video = byotrack.Video(video_path)
transform_config = VideoTransformConfig(aggregate=True, normalize=True, q_min=0.01, q_max=0.999)
video.set_transform(transform_config)

# Create a multi step tracker
## First the detector
## Smaller scale <=> search for smaller spots
## The noise threshold is linear with k. If you increase it, you will retrieve less spots.
detector = WaveletDetector(scale=1, k=3.0, min_area=5)

## Second the linker
## Hyperparameters are automatically chosen by Icy
linker = IcyEMHTLinker(icy_path)

## Finally refiners
## If needed you can add Cleaning and Stitching operations
refiners = []
if True:
    refiners.append(Cleaner(5, 3.5))  # Split tracks on position jumps and drop small ones
    refiners.append(EMC2Stitcher())  # Merge tracks if they track the same particle

tracker = byotrack.MultiStepTracker(detector, linker, refiners)

# Run the tracker
tracks = tracker.run(video)

# Save tracks
byotrack.Track.save(tracks, output_path)

Please refer to the official documentation.

Contribute

In coming...

References

  • [1] F. De Chaumont, S. Dallongeville, N. Chenouard, et al., “Icy: an open bioimage informatics platform for extended reproducible research”, Nature methods, vol. 9, no. 7, pp. 690–696, 2012.
  • [2] J.-C. Olivo-Marin, “Extraction of spots in biological images using multiscale products”, Pattern Recognition, vol. 35, no. 9, pp. 1989–1996, 2002.
  • [3] U. Schmidt, M. Weigert, C. Broaddus, and G. Myers, “Cell de- tection with star-convex polygons,” in Medical Image Computing and Computer Assisted Intervention–MICCAI 2018: 21st International Conference, Granada, Spain, September 16-20, 2018, Proceedings, Part II 11. Springer, 2018, pp. 265–273.
  • [4] N. Chenouard, I. Bloch, and J.-C. Olivo-Marin, “Multiple hypothesis tracking for cluttered biological image sequences”, IEEE transactions on pattern analysis and machine intelligence, vol. 35, no. 11, pp. 2736–3750, 2013.
  • [5] T. Lagache, A. Hanson, J. Perez-Ortega, et al., “Tracking calcium dynamics from individual neurons in behaving animals”, PLoS computational biology, vol. 17, pp. e1009432, 10 2021.

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

byotrack-0.2.0.tar.gz (101.8 kB view details)

Uploaded Source

Built Distribution

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

byotrack-0.2.0-py3-none-any.whl (108.5 kB view details)

Uploaded Python 3

File details

Details for the file byotrack-0.2.0.tar.gz.

File metadata

  • Download URL: byotrack-0.2.0.tar.gz
  • Upload date:
  • Size: 101.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for byotrack-0.2.0.tar.gz
Algorithm Hash digest
SHA256 69250855a8d06dec16dc41c8cd26b6773f8d0fdf08cbd071326934670c033771
MD5 0e5741ae669469ac7fbe8d186688a718
BLAKE2b-256 2f924e270fe55192268f0dfaae528469dd9c713510a63fc13a557dfb011c42d9

See more details on using hashes here.

File details

Details for the file byotrack-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: byotrack-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 108.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for byotrack-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61b3bf6bb363d9cb7b0eec1684337ddcea76626678ea579406faea757842f8fe
MD5 f8f55b6b28c8666046ad9e282386b463
BLAKE2b-256 a3141b9362d69b4a68ab2d6237eea13989a8177a221e405504d32d22e78d649f

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