pyntbci.utilities.find_neighbours

pyntbci.utilities.find_neighbours(layout: NDArray, border_value: int = -1) NDArray[source]

Find the neighbour pairs (horizontal, vertical, diagonal) in a rectangular layout.

Parameters:
  • layout (NDArray) – A matrix of identities of shape (n_rows, n_columns).

  • border_value (int (default: -1)) – A value not existing in the layout to represent a border to prevent wrapping around edges.

Returns:

neighbours – A matrix of neighbour pairs of shape (n_pairs, 2).

Return type:

NDArray