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_like
Indices of signals for which to compute connectivity from. Has
n_unique_seeds
array-like entries containing the channel indices for each seed. The number of channels within each seed can vary.- targetsarray_like
Indices of signals for which to compute connectivity to. Has
n_unique_targets
array-like entries containing the channel indices for each target. The number of channels within each target can vary.
- Returns:
- indices
tuple
of length 2 ofarray
A tuple of two numpy object arrays containing the seed and target indices, respectively, to use for connectivity computation. Each array has
n_cons
array entries containing the channel indices for each connection, wheren_cons = n_unique_seeds * n_unique_targets
. The number of channels within each connection can vary.
- indices
Notes
seeds
andtargets
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
andtargets
: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.