skimage 0.17.2

Given a shape (of length n) and a list of n-d offsets, return a two arrays of (n,) + shape: pos_edge_map and neg_edge_map. For each dimension xxx_edge_map[dim, ...] has zeros at indices at which none of the given offsets (in that dimension) of the given sign (positive or negative, respectively) will step out of bounds. If the value is nonzero, it gives the largest offset (in terms of absolute value) that will step out of bounds in that direction.

An example will be explanatory: >>> offsets = [[-2,0], [1,1], [0,2]] >>> pos_edge_map, neg_edge_map = _offset_edge_map((4,4), offsets) >>> neg_edge_map[0] array([[-1, -1, -1, -1], [-2, -2, -2, -2], [ 0, 0, 0, 0], [ 0, 0, 0, 0]], dtype=int8)

>>> pos_edge_map[1]
array([[0, 0, 2, 1],
      [0, 0, 2, 1],
      [0, 0, 2, 1],
      [0, 0, 2, 1]], dtype=int8)

Return an array with positions marked where offsets will step out of bounds.

Examples

See :

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: None#None
type: <class 'builtin_function_or_method'>
Commit: