Git Product home page Git Product logo

laptrack's Introduction

LapTrack

PyPI Status Python Version License Total Download

Read the documentation at https://laptrack.readthedocs.io/ Tests Codecov pre-commit Black

Bioinformatics bioRxiv Zenodo

Features

Provides a robust particle tracking algorithm using the Linear Assignment Problem, with various cost functions for linking.

See the publication and associated repository for the algorithm and parameter optimization by Ray-Tune.

Requirements

Python >= 3.8 is supported. The software is tested against Python 3.8-3.12 in Ubuntu, and 3.12 in MacOS and Windows environments, but the other combinations should also be fine. Please file an issue if you encounter any problem.

Installation

You can install LapTrack via pip from PyPI:

$ pip install laptrack

In Google Colaboratory, try

$ pip install --upgrade laptrack spacy flask matplotlib

to update the pre-installed packages.

Usage

Please see the Usage for details. The example notebooks are provided in docs/examples.

notebook name short description Google Colaboratory
api_example.ipynb Introducing the package API by a simple example. colab
bright_spots.ipynb Application example: detecting bright spots by scikit-image blob_log and tracking them.  
cell_segmentation.ipynb Application example: tracking centroids of the segmented C2C12 cells undergoing divisions.  
napari_interactive_fix.ipynb Illustrates the usage of the ground-truth-preserved tracking with napari.  
overlap_tracking.ipynb Illustrates the usage of the custom metric to use segmentation overlaps for tracking.  

The API reference covers the main classes and functions provided by LapTrack.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the The 3-Clause BSD License, LapTrack is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

Citation

If you use this program for your research, please cite it and help us build more.

@article{fukai_2022,
  title = {{{LapTrack}}: Linear Assignment Particle Tracking with Tunable Metrics},
  shorttitle = {{{LapTrack}}},
  author = {Fukai, Yohsuke T and Kawaguchi, Kyogo},
  year = {2022},
  month = dec,
  journal = {Bioinformatics},
  pages = {btac799},
  issn = {1367-4803},
  doi = {10.1093/bioinformatics/btac799},
}

@misc{laptrack,
   author = {Yohsuke T. Fukai},
   title = {laptrack},
   year  = {2021},
   url   = {https://doi.org/10.5281/zenodo.5519537},
}

laptrack's People

Contributors

dependabot[bot] avatar yfukai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laptrack's Issues

Column name issue in `predict_dataframe`

When using the predict_dataframe, a column named frame_y appears (possibly since I used pd.merge). The column name should be modified and the documentation should be added to let the users understand what it is. Note the values can have different values from those for the frame index when the minimum frame in the dataframe is larger than zero.

Napari-plugin

Hi @yfukai ,

this is just to let you know that I started a napari-laptrack plugin which uses LapTrack as dependency. It has just basic functionality yet. I'm planning to expand it iteratively based on collaborations; implementing what people need. In case you would like to collaborate on this, just let me know. Contributions (issues, PRs) are welcome. I'm also happy to share write-access to github and pypi repositories if that's of interest for you. Otherwise, it's fine, too. I'm happy to maintain it alone. No pressure. May I just ask for one little thing: In case you update LapTrack and break backwards compatibility, consider letting me know by creating an issue.

Big thanks for programming LapTrack! It's awesome.

Best,
Robert

P.S.: Feel free to close this issue; it's just a notification anyway 🙂

`calc_scores` assumes overlapping tracks share a `track-id`

Hello, I've been using laptrack to generate tracks for some cell tracking challenge data, and I wanted to compute the TE and TP scores using the calc_scores function. However, I realized the calc_scores function was finding fewer overlapping tracks than expected, and after looking at the implementation and the tests, I think it's because it expects that track-id is the same in ground truth and predicted tracks.

For example, if I change the current pred_tree in test_scores.py by swapping track indices 1 and 2, all the tests fail, even though the graph and the tracks are exactly the same:

    pred_tree = nx.from_edgelist(
        [
            ((0, 0), (1, 0)),
            ((1, 0), (2, 0)),
            ((2, 0), (3, 0)),
            ((4, 0), (5, 0)),
            ((2, 0), (3, 2)), # 1
            ((1, 2), (2, 1)), # 2
            ((2, 2), (3, 1)), # 2
            ((3, 2), (4, 2)), # 1
            ((4, 1), (5, 2)), # 1
        ]
    )

It's possible I'm misunderstanding how to use the function, but I would've expected that as long as the tracks overlap, it wouldn't matter what integer value was assigned to the track-id. Otherwise, it seems like some track id matching is required?

Please let me know if I've misunderstood anything!

Assertion error with: convert_dataframe_to_coords_frame_index

Hello

I am new to your cool work here.

I am doing some 3D tracking (in time) of some labeled images.

I am trying some preliminary runs with your example @ laptrack/docs/examples
/3D_tracking.ipynb

And I get an AssertionError at:

track_df, split_df, merge_df = lt.predict_dataframe(

File ~.conda\envs\tracking\Lib\site-packages\laptrack_tracking.py:763 in predict_dataframe
coords, frame_index = convert_dataframe_to_coords_frame_index(

File ~.conda\envs\tracking\Lib\site-packages\laptrack\data_conversion.py:81 in convert_dataframe_to_coords_frame_index
coords = convert_dataframe_to_coords(

File ~.conda\envs\tracking\Lib\site-packages\laptrack\data_conversion.py:45 in convert_dataframe_to_coords
assert np.array_equal(np.arange(df[frame_col].max() + 1), [g[0] for g in grps])

I am not an expert here. But i would like to get some idea on where this could be going wrong.
In the labels are not always continuous, meaning that in some frames some labels are not present and so on. so there is not a good trajectory like you have your example.

Hope this is enough information.

Thanks
:)

Data conversion

Sometimes we represent the data with pd.DataFrame or other formats. Conversion b/w input/output representations should be implemented.

Raise coverage to 100%

Now some of the code is not covered by the test. It will be great if we could raise the coverage to 100% (excluding some special-case part that are hard to cover.)

allow frame with no point

Currently, frames with no point is not allowed. This, annotated by None or an empty array, should be allowed.

Bug: fails linking exactly same positions

Using a sparse matrix with lap, the value 0 is assumed to be infinite, and thus not connected. One needs to add an offset to the matrix elements corresponding to finite values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.