trackpy 0.3.0
  • Tutorial
  • Site
    • Introduction to Trackpy
    • Installing Trackpy
    • Updating Your Installation
    • API reference
    • What’s new in the package
    • Walkthrough
    • Prediction: Beyond Simple Random Walks
    • Feature finding in 3D confocal images
    • Subpixel Accuracy and Uncertainty Estimation
    • Advanced Linking: Subnetworks and search_range
    • Adaptive Search: Changing search_range on the Fly
    • Streaming: Processing Unlimited Frames On-Disk
    • Making trackpy fast(er)
    • Obtaining Diagnostic Information from Linking
    • Parallelized Feature Location using IPython Parallel
    • Custom Feature Detection: Bubble tracking in 2D foams
  • Page
    • trackpy.link_df_iter

trackpy.link_df_iter¶

trackpy.link_df_iter(features, search_range, memory=0, neighbor_strategy='KDTree', link_strategy='auto', predictor=None, adaptive_stop=None, adaptive_step=0.95, diagnostics=False, pos_columns=None, t_column=None, hash_size=None, box_size=None, verify_integrity=True, retain_index=False)¶

Link features into trajectories, assigning a label to each trajectory.

Parameters:

features : iterable of DataFrames

Each DataFrame must include any number of column(s) for position and a column of frame numbers. By default, ‘x’ and ‘y’ are expected for position, and ‘frame’ is expected for frame number. See below for options to use custom column names.

search_range : float

the maximum distance features can move between frames

memory : integer

the maximum number of frames during which a feature can vanish, then reppear nearby, and be considered the same particle. 0 by default.

neighbor_strategy : {‘KDTree’, ‘BTree’}

algorithm used to identify nearby features. Note that when using BTree, you must specify hash_size

link_strategy : {‘recursive’, ‘nonrecursive’, ‘numba’, ‘drop’, ‘auto’}

algorithm used to resolve subnetworks of nearby particles ‘auto’ uses numba if available ‘drop’ causes particles in subnetworks to go unlinked

predictor : function, optional

Improve performance by guessing where a particle will be in the next frame.

For examples of how this works, see the “predict” module.

adaptive_stop : float, optional

If not None, when encountering an oversize subnet, retry by progressively reducing search_range until the subnet is solvable. If search_range becomes <= adaptive_stop, give up and raise a SubnetOversizeException.

adaptive_step : float, optional

Reduce search_range by multiplying it by this factor.

diagnostics : boolean

Collect details about how each particle was linked, and return as columns in the output DataFrame.

pos_columns : DataFrame column names (unlimited dimensions)

Default is [‘x’, ‘y’]

t_column : DataFrame column name

Default is ‘frame’

hash_size : sequence

For ‘BTree’ mode only. Define the shape of the search region.

box_size : sequence

For ‘BTree’ mode only. Define the parition size to optimize performance. If None (default), the search_range is used, which is a reasonable guess for best performance.

verify_integrity : boolean

False by default, for fastest performance. Use True if you suspect a bug in linking.

retain_index : boolean

By default, the index is reset to be sequential. To keep the original index, set to True. Default is fine unless you devise a special use.

Returns:

trajectories : DataFrame

This is the input features DataFrame, now with a new column labeling each particle with an ID number for each frame.

Back to top

Source

© Copyright 2010-2014, Trackpy Contributors.
Created using Sphinx 1.2.3.