lumicks.pylake.kymotracker.kymoline.KymoLine

class KymoLine(time_idx, coordinate_idx, image_data=None)

A line on a kymograph

__init__(time_idx, coordinate_idx, image_data=None)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(time_idx, coordinate_idx[, image_data]) Initialize self.
append(time_idx, coordinate_idx) Append time, coordinate pair to the KymoLine
extrapolate(forward, n_estimate, …) This function linearly extrapolates a track segment towards positive time.
in_rect(rect) Check whether any point of this KymoLine falls in the rect given in rect.
interpolate() Interpolate Kymoline to whole pixel values
sample_from_image(num_pixels[, reduce]) Sample from image using coordinates from this KymoLine.
with_offset(time_offset, coordinate_offset) Returns an offset version of the KymoLine

Attributes

coordinate_idx
image_data
time_idx
append(time_idx, coordinate_idx)

Append time, coordinate pair to the KymoLine

extrapolate(forward, n_estimate, extrapolation_length)

This function linearly extrapolates a track segment towards positive time.

Parameters:
forward: boolean

extrapolate forward (True) or backward in time (False)

n_estimate: int

Number of points to use for linear regression.

extrapolation_length: float

How far to extrapolate.

in_rect(rect)

Check whether any point of this KymoLine falls in the rect given in rect.

Parameters:
rect : Tuple[Tuple[float, float], Tuple[float, float]]

Only perform tracking over a subset of the image. Pixel coordinates should be given as: ((min_time, min_coord), (max_time, max_coord)).

interpolate()

Interpolate Kymoline to whole pixel values

sample_from_image(num_pixels, reduce=<function sum>)

Sample from image using coordinates from this KymoLine.

This function samples data from the image given in data based on the points in this KymoLine. It samples from [time, position - num_pixels : position + num_pixels + 1] and then applies the function sum.

Parameters:
num_pixels : int

Number of pixels in either direction to include in the sample

reduce : callable

Function evaluated on the sample. (Default: np.sum which produces sum of photon counts).

with_offset(time_offset, coordinate_offset)

Returns an offset version of the KymoLine