Skip to main content
Ctrl+K

trackpy 0.7rc1

  • Introduction to Trackpy
  • Installing Trackpy
    • API reference
    • What’s new in the package
    • Walkthrough
    • Prediction (Linking)
    • Tracking in 3D
    • Uncertainty Estimation
    • Advanced Linking
    • Adaptive Linking
    • Streaming
    • Performance
    • Parallelized Feature Finding
    • Tracking Large Features Such As Bubbles
    • Tracking Particles' Rings in Bright-Field Microscopy
  • Introduction to Trackpy
  • Installing Trackpy
  • API reference
  • What’s new in the package
  • Walkthrough
  • Prediction (Linking)
  • Tracking in 3D
  • Uncertainty Estimation
  • Advanced Linking
  • Adaptive Linking
  • Streaming
  • Performance
  • Parallelized Feature Finding
  • Tracking Large Features Such As Bubbles
  • Tracking Particles' Rings in Bright-Field Microscopy

Section Navigation

  • trackpy.locate
  • trackpy.batch
  • trackpy.link
  • trackpy.grey_dilation
  • trackpy.find_link
  • trackpy.refine_com
  • trackpy.refine_leastsq
  • trackpy.link
  • trackpy.link_iter
  • trackpy.link_df_iter
  • trackpy.link_partial
  • trackpy.reconnect_traj_patch
  • trackpy.static.proximity
  • trackpy.static.pair_correlation_2d
  • trackpy.static.pair_correlation_3d
  • trackpy.static.cluster
  • trackpy.motion.msd
  • trackpy.motion.imsd
  • trackpy.motion.emsd
  • trackpy.motion.compute_drift
  • trackpy.motion.subtract_drift
  • trackpy.motion.vanhove
  • trackpy.motion.relate_frames
  • trackpy.motion.velocity_corr
  • trackpy.motion.direction_corr
  • trackpy.motion.is_typical
  • trackpy.motion.diagonal_size
  • trackpy.motion.theta_entropy
  • trackpy.motion.min_rolling_theta_entropy
  • trackpy.filtering.filter_stubs
  • trackpy.filtering.filter_clusters
  • trackpy.predict.NullPredict
  • trackpy.predict.ChannelPredict
  • trackpy.predict.DriftPredict
  • trackpy.predict.NearestVelocityPredict
  • trackpy.predict.predictor
  • trackpy.predict.instrumented
  • trackpy.annotate
  • trackpy.scatter
  • trackpy.plot_traj
  • trackpy.annotate3d
  • trackpy.scatter3d
  • trackpy.plot_traj3d
  • trackpy.plot_displacements
  • trackpy.subpx_bias
  • trackpy.plot_density_profile
  • trackpy.mass_ecc
  • trackpy.mass_size
  • trackpy.find.percentile_threshold
  • trackpy.preprocessing.bandpass
  • trackpy.preprocessing.lowpass
  • trackpy.preprocessing.scale_to_gamut
  • trackpy.preprocessing.invert_image
  • trackpy.preprocessing.convert_to_int
  • trackpy.PandasHDFStore
  • trackpy.PandasHDFStoreBig
  • trackpy.PandasHDFStoreSingleNode
  • trackpy.FramewiseData
  • trackpy.quiet
  • trackpy.handle_logging
  • trackpy.ignore_logging
  • trackpy.minmass_v03_change
  • trackpy.minmass_v04_change
  • trackpy.utils.fit_powerlaw
  • trackpy.diag.performance_report
  • trackpy.diag.dependencies
  • trackpy.enable_numba
  • trackpy.disable_numba
  • trackpy.link_iter
  • trackpy.link
  • trackpy.SubnetOversizeException
  • trackpy.masks.binary_mask
  • trackpy.masks.r_squared_mask
  • trackpy.masks.x_squared_masks
  • trackpy.masks.cosmask
  • trackpy.masks.sinmask
  • trackpy.masks.theta_mask
  • trackpy.masks.gaussian_kernel
  • trackpy.masks.mask_image
  • trackpy.masks.slice_image
  • trackpy
    • trackpy.api
    • trackpy.artificial
    • trackpy.diag
    • trackpy.feature
    • trackpy.filtering
    • trackpy.find
    • trackpy.framewise_data
    • trackpy.linking
      • trackpy.linking.find_link
      • trackpy.linking.legacy
      • trackpy.linking.linking
      • trackpy.linking.partial
      • trackpy.linking.subnet
      • trackpy.linking.subnetlinker
      • trackpy.linking.utils
    • trackpy.locate_functions
      • trackpy.locate_functions.brightfield_ring
    • trackpy.masks
    • trackpy.motion
    • trackpy.plots
    • trackpy.predict
    • trackpy.preprocessing
    • trackpy.refine
      • trackpy.refine.brightfield_ring
      • trackpy.refine.center_of_mass
      • trackpy.refine.least_squares
    • trackpy.static
    • trackpy.tracking
    • trackpy.try_numba
    • trackpy.uncertainty
    • trackpy.utils
  • API reference
  • trackpy.link_df_iter

trackpy.link_df_iter#

trackpy.link_df_iter(f_iter, search_range, pos_columns=None, t_column='frame', *, memory=0, predictor=None, adaptive_stop=None, adaptive_step=0.95, neighbor_strategy=None, link_strategy=None, dist_func=None, to_eucl=None)#

Link an iterable of DataFrames into trajectories.

Parameters:
f_iteriterable 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. For optimal performance, explicitly specify the column names using pos_columns and t_column kwargs.

search_rangefloat or tuple

the maximum distance features can move between frames, optionally per dimension

pos_columnslist of str, optional

Default is [‘y’, ‘x’], or [‘z’, ‘y’, ‘x’] when ‘z’ is present in f If this is not supplied, f_iter will be investigated, which might cost performance. For optimal performance, always supply this parameter.

t_columnstr, optional

Default is ‘frame’

memoryinteger, optional

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

predictorfunction, 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_stopfloat, 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_stepfloat, optional

Reduce search_range by multiplying it by this factor.

neighbor_strategy{‘KDTree’, ‘BTree’}

algorithm used to identify nearby features. Default ‘KDTree’.

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

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

dist_funcfunction or `sklearn.metrics.DistanceMetric` instance, optional

A custom python distance function or instance of the Scikit Learn DistanceMetric class. If a python distance function is passed, it must take two 1D arrays of coordinates and return a float. Must be used with the ‘BTree’ neighbor_strategy.

to_euclfunction, optional

function that transforms a N x ndim array of positions into coordinates in Euclidean space. Useful for instance to link by Euclidean distance starting from radial coordinates. If search_range is anisotropic, this parameter cannot be used.

Yields:
DataFrames with added column ‘particle’ containing trajectory labels

See also

link

previous

trackpy.link_iter

next

trackpy.link_partial

© Copyright 2010-2025, Trackpy Contributors.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.