organoid_tracker.linking.nearest_neighbor_linker module

Ultra-simple linker. Used as a starting point for more complex links.

organoid_tracker.linking.nearest_neighbor_linker.nearest_neighbor(experiment: Experiment, *, tolerance: float = 1.0, back: bool = True, forward: bool = True, max_distance_um: float = inf) Links

Simple nearest neighbour linking, keeping a list of potential candidates based on a given tolerance.

A tolerance of 1.05 also links positions 5% from the closest position, so you end up with more links than you have positions.

If the experiment has images loaded, then no links outside the images will be created.

Nearest neighbor-linking can happen both forwards (every position is linked to the nearest in the next time point) and backwards (every position is linked to the nearest in the previous time point). If you do both, note that the tolerance is calculated independently for both directions: with a tolerance of for example 2, you’ll get all forward links that are at most twice as long as the shortest forward link, and you’ll get all backward links that are at most twice as long as the shortest backward link.