sarcasm.structure_modules.kymograph

Kymograph generation module.

Functions

kymograph_movie(movie, line[, linewidth, order])

Generate a kymograph using multiprocessing.

process_frame(args)

Process a single frame for kymograph generation.

curved_line_profile_coordinates(points[, linewidth])

Calculate the coordinates of a curved line profile composed of multiple segments with specified linewidth.

Module Contents

sarcasm.structure_modules.kymograph.kymograph_movie(movie: numpy.ndarray, line: numpy.ndarray, linewidth: int = 10, order: int = 0)[source]

Generate a kymograph using multiprocessing.

Parameters:
  • movie (np.ndarray, shape (N, H, W)) – The movie.

  • line (np.ndarray, shape (N, 2)) – The coordinates of the segmented line (N>1)

  • linewidth (int, optional) – Width of the scan in pixels, perpendicular to the line

  • order (int in {0, 1, 2, 3, 4, 5}, optional) – The order of the spline interpolation, default is 0 if image.dtype is bool and 1 otherwise. The order has to be in the range 0-5. See skimage.transform.warp for detail.

Returns:

return_value – Kymograph along segmented line

Return type:

ndarray

Notes

Adapted from scikit-image (https://scikit-image.org/docs/0.22.x/api/skimage.measure.html#skimage.measure.profile_line).

sarcasm.structure_modules.kymograph.process_frame(args)[source]

Process a single frame for kymograph generation.

sarcasm.structure_modules.kymograph.curved_line_profile_coordinates(points: numpy.ndarray, linewidth: int = 10)[source]

Calculate the coordinates of a curved line profile composed of multiple segments with specified linewidth.

Parameters:
  • points (np.ndarray) – A list of points (y, x) defining the segments of the curved line.

  • linewidth (int, optional) – The width of the line in pixels.

Returns:

coords – The coordinates of the curved line profile. Shape is (2, N, linewidth), where N is the total number of points in the line.

Return type:

ndarray