pyntbci.utilities.find_neighbours
- pyntbci.utilities.find_neighbours(layout: ndarray[tuple[int, ...], dtype[_ScalarType_co]], border_value: int = -1) ndarray[tuple[int, ...], dtype[_ScalarType_co]] [source]
Find the neighbour pairs in a rectangular layout.
- Parameters:
layout (NDArray) – A matrix of identities of shape (rows, columns).
border_value – 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