trackpy.find_link¶
- trackpy.find_link(reader, search_range, separation, diameter=None, memory=0, minmass=0, noise_size=1, smoothing_size=None, threshold=None, percentile=64, preprocess=True, before_link=None, after_link=None, refine=False, **kwargs)¶
Find and link features, using image data to re-find lost features.
- Parameters:
- readerpims.FramesSequence
- search_rangenumber or tuple
maximum displacement of features between subsequent frames
- separationnumber or tuple
minimum separation distance between features
- diameternumber or tuple, optional
feature diameter, used for characterization only. Also determines the margin (margin = diameter // 2). Default:
separation
.- memorynumber, optional
number of frames that features are allowed to disappear. Experimental. Default 0.
- minmassnumber, optional
minimum integrated intensity (in masked image). Default 0.
- noise_sizenumber or tuple, optional
Size of Gaussian kernel with which the image is convoluted for noise reduction. Default 1.
- smoothing_sizenumber or tuple, optional
Size of rolling average box for background subtraction. By default, equals
separation
. This may introduce bias when refined on the background subtracted image!- thresholdnumber, optional
Threshold value for image. Default None.
- percentilenumber, optional
The upper percentile of intensities in the image are considered as feature locations. Default 64.
- preprocessboolean
Set to False to turn off bandpass preprocessing.
- before_linkfunction, optional
This function is executed after the initial find of each frame, but but before the linking and relocating. It should take the following arguments (or
**kwargs
):coords
: `ndarray``containing the initially found feature coordinatesreader
: unprocessed reader (for access to other frames)image
: unprocessed imageimage_proc
: the processed imagediameter
separation
search_range
margin
minmass
It should return an ndarray of the same shape as
coords
.- after_linkfunction, optional
This function is executed after the find and link of each frame. It should not change the number of features. It should take the following arguments (or
**kwargs
):features
: a DataFrame containing the feature coordinates and characterization.reader
: unprocessed reader (for access to other frames)image
: unprocessed imageimage_proc
: the processed imagediameter
separation
search_range
margin
minmass
It should return a DataFrame like
features
.- refineboolean, optional
Convenience parameter to do center-of-mass refinement. Cannot be used combined with an
after_link
function. Default False.
Notes
This feature is a recent addition to trackpy that is still in its experimental phase. Please report any issues you encounter on Github.
If you use this specific algorithm for your scientific publications, please mention the accompanying publication [1]
References
[1]van der Wel C., Kraft D.J. Automated tracking of colloidal clusters
with sub-pixel accuracy and precision. J. Phys. Condens. Mat. 29:44001 (2017) DOI: http://dx.doi.org/10.1088/1361-648X/29/4/044001