{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / morphology / _util / _offsets_to_raveled_neighbors

function

skimage.morphology._util:_offsets_to_raveled_neighbors

source: /dev/scikit-image/src/skimage/morphology/_util.py :167

Signature

def   _offsets_to_raveled_neighbors ( image_shape footprint center order = C )

Summary

Compute offsets to a samples neighbors if the image would be raveled.

Parameters

image_shape : tuple

The shape of the image for which the offsets are computed.

footprint : ndarray

The footprint (structuring element) determining the neighborhood expressed as an n-D array of 1's and 0's.

center : tuple

Tuple of indices to the center of footprint.

order : {"C", "F"}, optional

Whether the image described by image_shape is in row-major (C-style) or column-major (Fortran-style) order.

Returns

raveled_offsets : ndarray

Linear offsets to a samples neighbors in the raveled image, sorted by their distance from the center.

Notes

This function will return values even if image_shape contains a dimension length that is smaller than footprint.

Examples

_offsets_to_raveled_neighbors((4, 5), np.ones((4, 3)), (1, 1))
_offsets_to_raveled_neighbors((2, 3, 2), np.ones((3, 3, 3)), (1, 1, 1))

Aliases

  • skimage.morphology._flood_fill._offsets_to_raveled_neighbors