{ } Raw JSON

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

function

skimage.morphology._util:_resolve_neighborhood

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

Signature

def   _resolve_neighborhood ( footprint connectivity ndim enforce_adjacency = True )

Summary

Validate or create a footprint (structuring element).

Extended Summary

Depending on the values of connectivity and footprint this function either creates a new footprint (footprint is None) using connectivity or validates the given footprint (footprint is not None).

Parameters

footprint : ndarray

The footprint (structuring) element used to determine the neighborhood of each evaluated pixel (True denotes a connected pixel). It must be a boolean array and have the same number of dimensions as image. If neither footprint nor connectivity are given, all adjacent pixels are considered as part of the neighborhood.

connectivity : int

A number used to determine the neighborhood of each evaluated pixel. Adjacent pixels whose squared distance from the center is less than or equal to connectivity are considered neighbors. Ignored if footprint is not None.

ndim : int

Number of dimensions footprint ought to have.

enforce_adjacency : bool

A boolean that determines whether footprint must only specify direct neighbors.

Returns

footprint : ndarray

Validated or new footprint specifying the neighborhood.

Examples

_resolve_neighborhood(None, 1, 2)
_resolve_neighborhood(None, None, 3).shape

Aliases

  • skimage.morphology._flood_fill._resolve_neighborhood