braindecode.augmentation.functional.sensors_rotation#

braindecode.augmentation.functional.sensors_rotation(X, y, sensors_positions_matrix, axis, angles, spherical_splines)[source]#

Interpolates EEG signals over sensors rotated around the desired axis with the desired angle.

Suggested in [1]

Parameters:
  • X (torch.Tensor) – EEG input example or batch.

  • y (torch.Tensor) – EEG labels for the example or batch.

  • sensors_positions_matrix (numpy.ndarray) –

    Matrix giving the positions of each sensor in a 3D cartesian coordinate system. Should have shape (3, n_channels), where n_channels is the number of channels. Standard 10-20 positions can be obtained from mne through:

    >>> ten_twenty_montage = mne.channels.make_standard_montage(
    ...    'standard_1020'
    ... ).get_positions()['ch_pos']
    

  • axis ('x' | 'y' | 'z') – Axis around which to rotate.

  • angles (array-like) – Array of float of shape (batch_size,) containing the rotation angles (in degrees) for each element of the input batch.

  • spherical_splines (bool) – Whether to use spherical splines for the interpolation or not. When False, standard scipy.interpolate.Rbf (with quadratic kernel) will be used (as in the original paper).

References

[1]

Krell, M. M., & Kim, S. K. (2017). Rotational data augmentation for electroencephalographic data. In 2017 39th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC) (pp. 471-474).