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: ndarrayThe footprint (structuring) element used to determine the neighborhood of each evaluated pixel (
Truedenotes a connected pixel). It must be a boolean array and have the same number of dimensions asimage. If neitherfootprintnorconnectivityare given, all adjacent pixels are considered as part of the neighborhood.connectivity: intA number used to determine the neighborhood of each evaluated pixel. Adjacent pixels whose squared distance from the center is less than or equal to
connectivityare considered neighbors. Ignored iffootprintis not None.ndim: intNumber of dimensions
footprintought to have.enforce_adjacency: boolA boolean that determines whether footprint must only specify direct neighbors.
Returns
footprint: ndarrayValidated 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