trackpy.refine

trackpy.refine(raw_image, image, radius, coords, separation=0, max_iterations=10, engine='auto', shift_thresh=0.6, break_thresh=0.005, characterize=True, walkthrough=False)

Find the center of mass of a bright feature starting from an estimate.

Characterize the neighborhood of a local maximum, and iteratively hone in on its center-of-brightness. Return its coordinates, integrated brightness, size (Rg), eccentricity (0=circular), and signal strength.

Parameters:

raw_image : array (any dimensions)

used for final characterization

image : array (any dimension)

processed image, used for locating center of mass

coord : array

estimated position

separation : float or tuple

Minimum separtion between features. Default is 0. May be a tuple, see diameter for details.

max_iterations : integer

max number of loops to refine the center of mass, default 10

engine : {‘python’, ‘numba’}

Numba is faster if available, but it cannot do walkthrough.

shift_thresh : float, optional

Default 0.6 (unit is pixels). If the brightness centroid is more than this far off the mask center, shift mask to neighboring pixel. The new mask will be used for any remaining iterations.

break_thresh : float, optional

Default: 0.005 (unit is pixels). When the subpixel refinement along all dimensions is less than this number, declare victory and stop refinement.

characterize : boolean, True by default

Compute and return mass, size, eccentricity, signal.

walkthrough : boolean, False by default

Print the offset on each loop and display final neighborhood image.