mne_connectivity.seed_target_multivariate_indices#

mne_connectivity.seed_target_multivariate_indices(seeds, targets)[source]#

Generate indices parameter for multivariate seed-based connectivity.

Parameters:
seedsarray of array of int, shape (n_unique_seeds, variable)

Seed indices.

targetsarray of array of int, shape (n_unique_targets, variable)

Target indices.

Returns:
indicestuple of array of array of int, shape (2, n_cons, variable)

The indices as a numpy object array.

Notes

seeds and targets should be array-likes representing the indices of the channel sets in the data for each connection. The indices for each connection should be an array-like of integers representing the individual channels in the data. The length of indices for each connection do not need to be equal. Furthermore, all indices within a connection must be unique.

Because the number of channels per connection can vary, the indices are stored as numpy arrays with dtype=object. E.g. seeds and targets:

seeds   = [[0]]
targets = [[1, 2], [3, 4, 5]]

would be returned as:

indices = (np.array([[0   ], [0      ]], dtype=object),  # seeds
           np.array([[1, 2], [3, 4, 5]], dtype=object))  # targets

Even if the number of channels does not vary, the indices will still be stored as object arrays for compatibility.

More information on working with multivariate indices and handling connections where the number of seeds and targets are not equal can be found in the Working with ragged indices for multivariate connectivity example.