lumicks.pylake.track_greedy¶
-
track_greedy(data, line_width, pixel_threshold, window=8, sigma=None, vel=0.0, diffusion=0.0, sigma_cutoff=2.0, rect=None)¶ Track particles on an image using a greedy algorithm.
Note: This is ALPHA functionality. It has not been tested in a sufficient number of cases yet, and the API is still subject to change without a prior deprecation notice.
A method based on connecting feature points. Detection of the feature points is done analogously to [1], using a greyscale dilation approach to detect peaks, followed by a local centroid computation to achieve subpixel accuracy. After peak detection the feature points are linked together using a greedy forward search analogous to [2]. This in contrast with the linking algorithm in [1] which uses a graph based optimization approach.
The linking step traverses the kymograph, tracing lines starting from each frame. It starts with the highest line and proceeds to lines with lower signal intensity. For every point along the line, the algorithm makes a prediction for where the particle will be in the next frame. Points are considered candidates for line membership when they fall within a cone parameterized by a sigma and diffusion constant. The candidate point closest to the prediction is chosen and connected to the line. When no more candidates are available the line is terminated.
Parameters: - data : array_like
N by M image containing a single color channel.
- line_width : float
Expected line width in pixels.
- pixel_threshold : float
Intensity threshold for the pixels. Local maxima above this intensity level will be designated as a line origin.
- window : int
Number of kymograph lines in which the particle is allowed to disappear (and still be part of the same line).
- sigma : float or None
Uncertainty in the particle position. This parameter will determine whether a peak in the next frame will be linked to this one. Increasing this value will make the algorithm tend to allow more positional variation in the lines. If none, the algorithm will use half the line width.
- vel : float
Expected velocity of the traces in the image. This can be used for non-static particles that are expected to move at an expected rate (default: 0.0).
- diffusion : float
Expected diffusion constant (default: 0.0). This parameter will influence whether a peak in the next frame will be connected to this one. Increasing this value will make the algorithm allow more positional variation in.
- sigma_cutoff : float
Sets at how many standard deviations from the expected trajectory a particle no longer belongs to this trace. Lower values result in traces being more stringent in terms of continuing (default: 2.0).
- rect : tuple of two pixel coordinates
Only perform tracking over a subset of the image. Pixel coordinates should be given as: ((min_time, min_coord), (max_time, max_coord)).
References
[1] Sbalzarini, I. F., & Koumoutsakos, P. (2005). Feature point tracking and trajectory analysis for video imaging in cell biology. Journal of structural biology, 151(2), 182-195. [2] Mangeol, P., Prevo, B., & Peterman, E. J. (2016). KymographClear and KymographDirect: two tools for the automated quantitative analysis of molecular and cellular dynamics using kymographs. Molecular biology of the cell, 27(12), 1948-1957.