sarcasm.structure_modules.sarcomere_vectors

Sarcomere vector extraction and analysis module.

Functions

get_sarcomere_vectors(, interp_factor, linewidth, ...)

Extract sarcomere orientation and length vectors.

Module Contents

sarcasm.structure_modules.sarcomere_vectors.get_sarcomere_vectors(zbands: numpy.ndarray, mbands: numpy.ndarray, orientation_field: numpy.ndarray, pixelsize: float, median_filter_radius: float = 0.25, slen_lims: Tuple[float, float] = (1, 3), interp_factor: int = 4, linewidth: float = 0.3, interpolation_method: str = 'linear') Tuple[numpy.ndarray | List, numpy.ndarray | List, numpy.ndarray | List, numpy.ndarray | List, numpy.ndarray | List, numpy.ndarray | List, numpy.ndarray | List][source]

Extract sarcomere orientation and length vectors.

Parameters:
  • zbands (np.ndarray) – 2D array representing the semantic segmentation map of Z-bands.

  • mbands (np.ndarray) – 2D array representing the semantic segmentation map of mbands.

  • orientation_field (np.ndarray) – 2D array representing the orientation field.

  • pixelsize (float) – Size of a pixel in micrometers.

  • median_filter_radius (float, optional) – Radius of kernel to smooth orientation field before assessing orientation at M-points, in µm (default 0.25 µm).

  • slen_lims (tuple of float, optional) – Sarcomere size limits in micrometers (default is (1, 3)).

  • interp_factor (int, optional) – Interpolation factor for profiles to calculate sarcomere length. Defaults to 4.

  • linewidth (float, optional) – Line width of profiles to calculate sarcomere length. Defaults to 0.3 µm.

  • interpolation_method (str, optional) – Interpolation method: ‘linear’ (fast) or ‘akima’ (smooth). Defaults to ‘linear’.

Returns:

  • pos_vectors (np.ndarray) – Array of position vectors for sarcomeres.

  • sarcomere_orientation_vectors (np.ndarray) – Sarcomere orientation values at midline points.

  • sarcomere_length_vectors (np.ndarray) – Sarcomere length values at midline points.

  • sarcomere_mask (np.ndarray) – Mask indicating the presence of sarcomeres.