Utilities
Utils.
Utils functions used in EEGrasp.
- eegrasp.utils.compute_distance(coordinates=None, method='Euclidean', normalize=True)[source]
Compute the distance based on electrode coordinates.
- Parameters:
- coordinatesndarray | None
N-dim array with position of the electrodes. If None the class instance will use the coordinates passed at initialization. Default is None.
- methodstring
Options are: ‘Euclidean’. Method used to compute the distance matrix.
- normalizebool
If True, the distance matrix will be normalized before being returned. If False, then the distance matrix will be returned and assigned to the class’ instance without normalization.
- Returns:
- distancesndarray
Distances to be used for the graph computation.
- eegrasp.utils.euc_dist(pos)[source]
Compute the euclidean distance based on a given set of positions.
- Parameters:
- posndarray.
2d or 3d array of channels by feature dimensions.
- Returns:
- output: ndarray.
Dimension of the array is number of channels by number of channels containing the euclidean distance between each pair of channels.