{ } Raw JSON

bundles / skimage latest / skimage / morphology / _util / _validate_connectivity

function

skimage.morphology._util:_validate_connectivity

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

Signature

def   _validate_connectivity ( image_dim connectivity offset )

Summary

Convert any valid connectivity to a footprint and offset.

Parameters

image_dim : int

The number of dimensions of the input image.

connectivity : int, array, or None

The neighborhood connectivity. An integer is interpreted as in scipy.ndimage.generate_binary_structure, as the maximum number of orthogonal steps to reach a neighbor. An array is directly interpreted as a footprint and its shape is validated against the input image shape. None is interpreted as a connectivity of 1.

offset : tuple of int, or None

The coordinates of the center of the footprint.

Returns

c_connectivity : array of bool

The footprint (structuring element) corresponding to the input connectivity.

offset : array of int

The offset corresponding to the center of the footprint.

Raises

: ValueError:

If the image dimension and the connectivity or offset dimensions don't match.

Aliases

  • skimage.morphology._util._validate_connectivity