The number of trajectories is different from the number of unique particle IDs
lxfhfut opened this issue · 2 comments
In the walkthrough tutorial, running the link function "t = tp.link(f, 5, memory=3)" returns "Frame 299: 624 trajectories present", where dataframe 't' contains an additional column, 'particle', identifying each feature with a label. My understanding is that we could run "t['particle'].nunique()" to get the number of tracks/trajecgtories, but this returns "13715" which is inconsistent with the message from running link function. I am confused about this. How can we get the data for each track/trajectory? Any help would be appreciated!
This most likely means there are 624 trajectories in frame #299 but 13715 in the overall file. You should be able to check with :
t[t.frame==299].particle.nunique()
@BptGrm Thanks for your reply. Yes, 624 is the number of trajectories of the last frame. It seems to be caused by the behavior of generator used in 'link_iter' function. It is confusing to just show the track number of the last frame. The first time I ran 'link' function I was wondering why the number of resultant trajectories did not change for two quite different search ranges ;(