pyntbci.utilities.find_neighbours
- pyntbci.utilities.find_neighbours(layout: ndarray[tuple[Any, ...], dtype[_ScalarT]], border_value: int = -1) ndarray[tuple[Any, ...], dtype[_ScalarT]] [source]
Find the neighbour pairs (horizontal, vertical, diagonal) in a rectangular layout.
- Parameters:
layout (NDArray) – A matrix of identities of shape (rows, 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_neighbours, 2).
- Return type:
NDArray