Skip to content

Commit

Permalink
Merge pull request #26 from yfukai/change_license_BSD
Browse files Browse the repository at this point in the history
Change license to The 3-Clause BSD License
  • Loading branch information
yfukai authored Sep 21, 2021
2 parents af1fedc + 17fe76a commit 2e4f330
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 711 deletions.
2 changes: 1 addition & 1 deletion .cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"email": "[email protected]",
"friendly_name": "LapTrack",
"github_user": "yfukai",
"license": "GPL-3.0-only",
"license": "BSD-3-Clause",
"package_name": "laptrack",
"project_name": "laptrack",
"version": "0.0.0"
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Contributor Guide
=================

Thank you for your interest in improving this project.
This project is open-source under the `GNU General Public License version 3`_ and
This project is open-source under the `The 3-Clause BSD License`_ and
welcomes contributions in the form of bug reports, feature requests, and pull requests.

Here is a list of important resources for contributors:
Expand All @@ -12,7 +12,7 @@ Here is a list of important resources for contributors:
- `Issue Tracker`_
- `Code of Conduct`_

.. _GNU General Public License version 3: https://opensource.org/licenses/GPL-3.0
.. _The 3-Clause BSD License: https://opensource.org/licenses/BSD-3-Clause
.. _Source Code: https://github.com/yfukai/laptrack
.. _Documentation: https://laptrack.readthedocs.io/
.. _Issue Tracker: https://github.com/yfukai/laptrack/issues
Expand Down Expand Up @@ -43,7 +43,7 @@ Request features on the `Issue Tracker`_.
How to set up your development environment
------------------------------------------

You need Python 3.6+ and the following tools:
You need Python 3.8+ and the following tools:

- Poetry_
- Nox_
Expand Down
704 changes: 8 additions & 696 deletions LICENSE.rst

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LapTrack
:target: https://pypi.org/project/laptrack
:alt: Python Version
.. |License| image:: https://img.shields.io/pypi/l/laptrack
:target: https://opensource.org/licenses/GPL-3.0
:target: https://opensource.org/licenses/BSD-3-Clause
:alt: License
.. |Read the Docs| image:: https://img.shields.io/readthedocs/laptrack/latest.svg?label=Read%20the%20Docs
:target: https://laptrack.readthedocs.io/
Expand Down Expand Up @@ -66,7 +66,7 @@ To learn more, see the `Contributor Guide`_.
License
-------

Distributed under the terms of the `GNU General Public License version 3`_,
Distributed under the terms of the `The 3-Clause BSD License`_,
*LapTrack* is free and open source software.


Expand Down Expand Up @@ -94,7 +94,7 @@ Credits

.. _@cjolowicz: https://github.com/cjolowicz
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _GNU General Public License version 3: https://opensource.org/licenses/GPL-3.0
.. _The 3-Clause BSD License: https://opensource.org/licenses/BSD-3-Clause
.. _PyPI: https://pypi.org/
.. _Hypermodern Python Cookiecutter: https://github.com/cjolowicz/cookiecutter-hypermodern-python
.. _file an issue: https://github.com/yfukai/laptrack/issues
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tool.poetry]
name = "laptrack"
version = "0.1.1"
version = "0.1.2"
description = "LapTrack"
authors = ["Yohsuke Fukai <[email protected]>"]
license = "GPL-3.0-only"
license = "BSD-3-Clause"
readme = "README.rst"
homepage = "https://github.com/yfukai/laptrack"
repository = "https://github.com/yfukai/laptrack"
Expand All @@ -16,7 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"License :: OSI Approved :: BSD License",
]

[tool.poetry.urls]
Expand Down
15 changes: 11 additions & 4 deletions src/laptrack/_cost_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ def build_segment_cost_matrix(
cost_matrix : Optional[FloatArray]
the cost matrix for frame linking, None if not appropriate
"""
# https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/sparselap/costmatrix/JaqamanSegmentCostMatrixCreator.java # noqa:
# https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/sparselap/SparseLAPSegmentTracker.java#L148 # noqa:
M = gap_closing_dist_matrix.shape[0]
assert gap_closing_dist_matrix.shape[1] == M
assert splitting_dist_matrix.shape[0] == M
Expand All @@ -116,8 +114,17 @@ def build_segment_cost_matrix(
if len(all_data) == 0:
return None

# https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/sparselap/costmatrix/DefaultCostMatrixCreator.java#L186 # noqa :
# https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/TrackerKeys.java # noqa :
# Note:
# Though the way of assigning track_start_cost, track_end_cost, no_splitting_cost, no_merging_cost # noqa :
# and min_val is similar to that of TrackMate (link1, link2), GPL3 of TrackMate does not apply. (See link3 for license discussion.) # noqa :
# link1 https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/sparselap/costmatrix/DefaultCostMatrixCreator.java#L186 # noqa :
# https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/sparselap/costmatrix/JaqamanSegmentCostMatrixCreator.java # noqa:
# https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/sparselap/SparseLAPSegmentTracker.java#L148 # noqa:
# link2 (default parameters for alternative_cost_percentile, alternative_cost_factor) # noqa :
# https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/TrackerKeys.java # noqa :
# link3 https://forum.image.sc/t/linear-assignment-problem-based-tracking-package-in-python/57793 # noqa :
# https://web.archive.org/web/20210921134401/https://forum.image.sc/t/linear-assignment-problem-based-tracking-package-in-python/57793 # noqa :

if (
track_start_cost is None
or track_end_cost is None
Expand Down
2 changes: 1 addition & 1 deletion src/laptrack/_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ def laptrack(
def to_gap_closing_candidates(row):
target_coord = row["last_frame_coords"]
frame_diff = np.abs(segments_df["first_frame"] - row["last_frame"])
# https://github.com/fiji/TrackMate/blob/5a97426586b3c592c986c57aa1a09bab9d21419c/src/main/java/fiji/plugin/trackmate/tracking/sparselap/costmatrix/JaqamanSegmentCostMatrixCreator.java#L242 # noqa :
indices = (1 <= frame_diff) & (
frame_diff <= gap_closing_max_frame_count
)
df = segments_df[indices]
# note: can use KDTree if metric is distance,
# but might not be appropriate for general metrics
# https://stackoverflow.com/questions/35459306/find-points-within-cutoff-distance-of-other-points-with-scipy # noqa
# TrackMate also uses this (trivial) implementation.
if len(df) > 0:
target_dist_matrix = cdist(
[target_coord],
Expand Down

0 comments on commit 2e4f330

Please sign in to comment.