lentil.helper.boundary_slice#

lentil.helper.boundary_slice(x, threshold=0, pad=(0, 0))[source]#

Find bounding row and column indices of data within an array and return the results as slice objects.

Parameters:
  • x (array_like) – Input array

  • threshold (float, optional) – Masking threshold to apply before boundary finding. Only values in x that are larger than threshold are considered in the boundary finding operation. Default is 0.

  • pad (int or tuple of ints) – Additional number of pixels to pad the boundary finding result by. Default is (0,0).

Returns:

row_slice, col_slice – Boundary slices

Return type:

tuple of slices