{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / draw / draw_nd / line_nd

function

skimage.draw.draw_nd:line_nd

source: /dev/scikit-image/src/skimage/draw/draw_nd.py :52

Signature

def   line_nd ( start stop * endpoint = False integer = True )

Summary

Draw a single-pixel thick line in n dimensions.

Extended Summary

The line produced will be ndim-connected. That is, two subsequent pixels in the line will be either direct or diagonal neighbors in n dimensions.

Parameters

start : array-like, shape (N,)

The start coordinates of the line.

stop : array-like, shape (N,)

The end coordinates of the line.

endpoint : bool, optional

Whether to include the endpoint in the returned line. Defaults to False, which allows for easy drawing of multi-point paths.

integer : bool, optional

Whether to round the coordinates to integer. If True (default), the returned coordinates can be used to directly index into an array. False could be used for e.g. vector drawing.

Returns

coords : tuple of (ndarray, ...)

The coordinates of points on the line.

Examples

lin = line_nd((1, 1), (5, 2.5), endpoint=False)
lin
im = np.zeros((6, 5), dtype=int)
im[lin] = 1
im
line_nd([2, 1, 1], [5, 5, 2.5], endpoint=True)

Aliases

  • skimage.draw.line_nd

Referenced by