segment_len#
- crispy.pruning.pruning.segment_len(wlk_idx, remove_axis=None)[source]#
Calculate the length of a skeleton segment.
This function computes the length of a skeleton segment from an ordered list of its pixel coordinates. The length is calculated as the sum of Euclidean distances between consecutive pixels. Optionally, a specified axis can be excluded from the calculation, which is useful for computing sky-projected lengths.
- Parameters:
- Returns:
length – The computed length of the skeleton segment.
- Return type:
Notes
The calculated length may underestimate the actual length by approximately one pixel due to measuring from the center of each pixel.
Excluding an axis (e.g., velocity in PPV space) computes the sky-projected length.