{ } Raw JSON

bundles / skimage latest / skimage / morphology / _util / _set_border_values

function

skimage.morphology._util:_set_border_values

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

Signature

def   _set_border_values ( image value border_width = 1 )

Summary

Set edge values along all axes to a constant value.

Parameters

image : ndarray

The array to modify inplace.

value : scalar

The value to use. Should be compatible with image's dtype.

border_width : int or sequence of tuples

A sequence with one 2-tuple per axis where the first and second values are the width of the border at the start and end of the axis, respectively. If an int is provided, a uniform border width along all axes is used.

Examples

image = np.zeros((4, 5), dtype=int)
_set_border_values(image, 1)
image
image = np.zeros((8, 8), dtype=int)
_set_border_values(image, 1, border_width=((1, 1), (2, 3)))
image

Aliases

  • skimage.morphology._flood_fill._set_border_values