Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented KalmanTrackerFF for fast flows as a separate method #296

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Lollum89
Copy link

NOTE: This new pull request is in substitution of #295. All the modifications are made in a new tracking method, KalmanTrackerFF, to avoid interfering with the existing one, as suggested by @tinevez .

In this version I made an improvement in the tracking of fast flows using the Kalman Tracker. Essentially, I added a new field in the tracker, which is called expectedMovement. It is an array, therefore representing the X;Y;Z displacement vector.
In the fast flows, initiating a track is not optimal, as the spots might move a lot in a preferential direction. In the Jaquaman linking step of the tracker, the origin spots are moved by the expected movement vector, therefore moving them closer to the expected position of the target spots. This allows for a much smaller initial search radius, mitigating the issue of spurious tracks that are initiated in the wrong direction and must be terminated after 1 or 2 steps. The presence of these artifact tracks also impedes the initiation of the true tracks, therefore some visually very clear cases are ignored.
After determining the relation between an origin and a target spot, the tracking can then proceed using the unmodified Kalman filter.

TrackMate capture of MASK_Result
test4_trackingModLP

@Lollum89
Copy link
Author

Hello,
the build error seems to be related to the SpotCollection class, and at first sight unrelated to the new code. Do you have any suggestion to aid me in the debugging?

@Lollum89
Copy link
Author

When compiling using maven in my system I do not get the error:
image

whereas the same part of the code seems to fail here:
image

@tinevez
Copy link
Member

tinevez commented May 30, 2024

Weird.

Anyway I was thinking of another approach. How do you feel about making your tracker a TrackMate module? It would go in its own repo on which you would have full control, and would get a dedicated update site. A bit like TrackMate-StarDit
What do you think?

@Lollum89
Copy link
Author

Thank you. I will look into that.

In the meantime, I found the warning:
Redundant superinterface XYDataset for the type SpotCollectionDataset, already defined by ModelDataset

which sends me to these:
image
image

@Lollum89
Copy link
Author

Lollum89 commented May 30, 2024

I removed the tests for KalmanFF, which I created based on src/test/java/fiji/plugin/trackmate/tracking/Kalman/ . Maybe they were at the source of redundancy.
Could you try again the build?

@Lollum89
Copy link
Author

Perfect. The tests are not needed for my contribution I think. If you agree I think this pull request is complete.

@tinevez
Copy link
Member

tinevez commented May 30, 2024

Thanks :)

And about the idea of making it a dedicated module?

@Lollum89
Copy link
Author

It is definitely appealing. However I won't have time to dedicate to it until after July. Right now I am already using this implementation in my thesis which is due soon. I do plan to continue working on particle tracking in the future.

My future plans are to use not only a single value in all the domain, but also an expected velocity map. Also what you mentioned, augmenting it with optical flow to estimate the expected velocity.

@tinevez
Copy link
Member

tinevez commented May 30, 2024

Yes in that case it is worthwhile to dedicate a module to it. We would try to rewrite the mother class to avoid duplicate code as well.
Let's keep it this way for now, until the thesis defense. Then we will work together on migrating this PR to a proper module and new features.

@tinevez tinevez added enhancement new-module Make a new TrackMate module out of this PR. labels May 30, 2024
@Lollum89
Copy link
Author

Perfect! Thank you for making this code open-source btw! It is allowing me to do a bunch of work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new-module Make a new TrackMate module out of this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants