eelbrain.set_connectivity

eelbrain.set_connectivity(data, dim=None, connectivity='none', name=None)

Change the connectivity of an NDVar or a Dimension

Parameters:
  • data (NDVar | Dimension) – NDVar for which to change the connectivity.

  • dim (str) – Dimension for which to set the connectivity.

  • connectivity (str | Sequence) – Connectivity between elements. Set to "none" for no connections or "grid" to use adjacency in the sequence of elements as connection. Set to numpy.ndarray to specify custom connectivity. The array should be of shape (n_edges, 2), and each row should specify one connection [i, j] with i < j, with rows sorted in ascending order. If the array’s dtype is uint32, property checks are disabled to improve efficiency.

  • name (str) – Name for the new NDVar (default is data.name).

Returns:

Shallow copy of data with the new connectivity.

Return type:

data_with_connectivity