skimage 0.17.2

ParametersReturnsBackRef
_resolve_neighborhood(selem, connectivity, ndim)

Depending on the values of :None:None:`connectivity` and selem this function either creates a new structuring element (selem is None) using :None:None:`connectivity` or validates the given structuring element (selem is not None).

Parameters

selem : ndarray

A 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 :None:None:`image`. If neither selem nor :None:None:`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 :None:None:`connectivity` are considered neighbors. Ignored if selem is not None.

ndim : int

Number of dimensions selem ought to have.

Returns

selem : ndarray

Validated or new structuring element specifying the neighborhood.

Validate or create structuring element.

Examples

This example is valid syntax, but we were not able to check execution
>>> _resolve_neighborhood(None, 1, 2)
array([[False,  True, False],
       [ True,  True,  True],
       [False,  True, False]])
This example is valid syntax, but we were not able to check execution
>>> _resolve_neighborhood(None, None, 3).shape
(3, 3, 3)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.morphology._util._resolve_neighborhood

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/morphology/_util.py#129
type: <class 'function'>
Commit: