sarcasm.structure_modules.z_band_analysis

Z-band segmentation and analysis module.

Functions

segment_z_bands(→ Tuple[numpy.ndarray, numpy.ndarray])

Segment z-bands from U-Net result (threshold, make binary, skeletonize, label regions).

analyze_z_bands(→ Tuple)

Analyzes segmented z-bands in a single frame, extracting metrics such as length, intensity, orientation,

Module Contents

sarcasm.structure_modules.z_band_analysis.segment_z_bands(image: numpy.ndarray, threshold: float = 0.15) Tuple[numpy.ndarray, numpy.ndarray][source]

Segment z-bands from U-Net result (threshold, make binary, skeletonize, label regions).

Parameters:
  • image (np.ndarray) – Input image from U-Net.

  • threshold (float, optional) – Threshold value for binarizing the image. Defaults to 0.15.

Returns:

  • labels (np.ndarray) – Labeled regions in the thresholded image.

  • labels_skel (np.ndarray) – Labeled regions in the skeletonized image.

sarcasm.structure_modules.z_band_analysis.analyze_z_bands(zbands: numpy.ndarray, labels: numpy.ndarray, labels_skel: numpy.ndarray, image_raw: numpy.ndarray, orientation_field: numpy.ndarray, pixelsize: float, min_length: float = 1.0, threshold: float = 0.5, median_filter_radius: float = 0.25, a_min: float = 0.3, theta_phi_min: float = 0.2, d_max: float = 4.0, d_min: float = 0.25) Tuple[source]

Analyzes segmented z-bands in a single frame, extracting metrics such as length, intensity, orientation, straightness, lateral distance, alignment, number of lateral neighbors per z-band, and characteristics of groups of lateral z-bands (length, alignment, size).

Parameters:
  • zbands (np.ndarray) – The segmented map of z-bands.

  • labels (np.ndarray) – The labeled image of z-bands.

  • labels_skel (np.ndarray) – The skeletonized labels of z-bands.

  • image_raw (np.ndarray) – The raw image.

  • orientation_field (np.ndarray) – Sarcomere orientation field.

  • pixelsize (float) – The size of pixels in the image.

  • min_length (float, optional) – The minimum length threshold for z-bands. Default is 1.0.

  • threshold (float, optional) – The threshold value for intensity. Default is 0.1.

  • median_filter_radius (float, optional) – Radius of kernel to smooth orientation field. Default is 0.2 µm.

  • a_min (float, optional) – The minimum value for alignment. Default is 0.25. Links with smaller alignment are set to np.nan.

  • theta_phi_min (float, optional) – The minimum dot product/cosine between the direction of a Z-band end and the direction of line from end to other Z-band end.

  • d_max (float, optional) – The maximum distance between z-band ends. Default is 5.0 µm. Larger distances are set to np.nan.

  • d_min (float, optional) – The minimum distance between z-band ends. Default is 0 µm. Smaller distances are set to np.nan.

Returns:

A comprehensive tuple containing arrays and values describing the analyzed properties of z-bands: - Lengths, intensities, straightness, ratio of intensities, average intensity, orientations,

orientational order parameter, list of z-band labels, processed labels image, number of lateral neighbors, lateral distances, lateral alignments, links between z-band ends, coordinates of z-band ends, linked groups of z-bands, and their respective sizes, lengths, and alignments.

Return type:

tuple