interpolate_segments

ifermi.slice.interpolate_segments(segments, properties, max_spacing)[source]

Resample a series of line segments to a consistent density.

Note: the segments must be ordered so that they are adjacent.

Parameters:
  • segments (ndarray) – A (n, 2, 2) float array of the line segments.

  • properties (ndarray) – A (n, …) float array of the segment properties.

  • max_spacing (float) – The desired spacing after interpolation. Note, the spacing may be slightly smaller than this value.

Returns:

The interpolated segments and properties.

Return type:

(segments, properties)