Skip to main content

Adaptation of Jean-Yves Tinevez's Simple Tracker in Python

Project description

PeasyTracker - An adaptation of SimpleTracker in Python

License: CC BY-NC-SA 4.0

Tracking, or particle linking, consists in building the particles' trajectory as they move along time. The particles are localized at each frames but not identified ! This tracking algorithm aims at solving this problem.

PeasyTracker is a Python implementation of the Matlab addon SimpleTracker developed by Jean-Yves Tinevez and is also able to deal with gaps. A gap happens when a particle that was detected in one frame is not detected in the next one. If not dealt with, this generates 2 short tracks.

PeasyTracker first tries to link particles across 2 consecutive frames (frame_1 and frame_2) using HungarianLinker function. This function computes the euclidean distance matrix between particles in frame_1 and the others in frame_2; and uses it as the cost matrix for the linear sum assignment optimization algorithm which minimizes the overall sum of the euclidean distances paired points.

Then it tries from the created matching matrix to link a track end to another track beginning that are close temporally and spatially using NearestNeighborLinker function. This allows to bridge the gaps in the matching matrix and to restore the track.

Finally, the tracks identification are generated by searching for connected components of the matching graph and by filtering the tracks according to their lengths. The unmatched points are designated by -1 in the track_no field.

Installation

The Github repository was published on PyPI · The Python Package Index site. In this way, ``PeasyTracker` can be simply installed using the following command:

pip install PeasyTracker

API

SimpleTracker is the main function of PeasyTracker library.

from peasyTracker import SimpleTracker

tracks = SimpleTracker(data=localizedPts, 
                       max_linking_dist=maxDistBtwnPairedPts,
                       max_gap_closing = maxGap,
                       min_track_len = minTrackLen)

Inputs

  • data is a numpy structured array with:

    • the field pos designating the particle position as a 1D array,
    • the field frame_no designating the frame number where the particle was localized.
  • max_linking_dist is the maximal distance from which 2 particles will not be linked if they're separated by a greater distance. Its default value is infinite, thus not preventing any linking.

  • max_gap_closing is the maximal size of a gap in terms of frames so that the linking of a beginning track and another track end will not be investigated if the difference between their associated frame number is greater than this value. By default, it has the value of 3.

  • min_track_len is the minimal track length so that the tracks, for which the number of matched points is smaller than this value, will be removed and their associated points will be considered as unmatched. By default, the minimal track length is 2.

Output

  • track is a numpy structured array which is a copy of data input but with the extra field track_no corresponding to a track id. The value of this field for an associated point is -1 as the point was unmatched.

Corresponding authors

Codes: Jacques Battaglia, Jean-Baptiste Deloges

Materials, collaborations, rights and others: Olivier Couture

Code Available under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International

Laboratoire d'Imagerie Biomédicale, Team PPM. 15 rue de l'Ecole de Médecine, 75006, Paris, France. CNRS, Sorbonne Université, INSERM

Disclaimer

THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

by JB, J-BD, OC.

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

peasytracker-0.0.1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

peasyTracker-0.0.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file peasytracker-0.0.1.tar.gz.

File metadata

  • Download URL: peasytracker-0.0.1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.1

File hashes

Hashes for peasytracker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dcee77a64a7cf35a1ad14b41131fd616ad3e09e045f555867c6d580e05fb9173
MD5 92a4fbda15c61ad40a46c9f00b5164b5
BLAKE2b-256 29ffbd07ffb9587e663aa4dcae216132cc2b8129dfc695d2e3a2e114f52a6135

See more details on using hashes here.

File details

Details for the file peasyTracker-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: peasyTracker-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.1

File hashes

Hashes for peasyTracker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a897e6d43e950642f3ddfcd57e8b45cf8c8f6f038159f7333993f0d17f74f33a
MD5 33c0221d39bd3eb960bcd912fb43b58d
BLAKE2b-256 200139687cd1a5340f8b673ba41c3180ddd8b384ff06046cee9623dedd158981

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