Shortcuts

OrderElectrode

class torcheeg.transforms.OrderElectrode(source_electrodes: List[str], target_electrodes: List[str], padding_value: float = 0)[source][source]

Pick specific electrodes from the input EEG representation.

Parameters:
  • source_electrodes (List[str]) – List of electrode names in the source EEG data.

  • target_electrodes (List[str]) – List of electrode names to pick from the source.

  • padding_value (float) – Value to use for padding when a target electrode is not in the source.

from torcheeg import transforms

fake_eeg = np.random.rand(3, 3000)
source_electrodes = ['F3', 'F4', 'C3', 'C4', 'O1', 'O2']
target_electrodes = ['F3', 'F4', 'C3']

t = transforms.PickTransform(source_electrodes=source_electrodes,
                             target_electrodes=target_electrodes,
                             padding_value=0)
t_eeg = t(eeg=fake_eeg)['eeg']
print(t_eeg.shape)
>>> (3, 3000)
__call__(*args, eeg: ndarray, baseline: ndarray | None = None, **kwargs) Dict[str, ndarray][source][source]
Parameters:
  • eeg (np.ndarray) – The input EEG signals.

  • baseline (np.ndarray, optional) – The corresponding baseline signal, if apply_to_baseline is set to True and baseline is passed, the baseline signal will be transformed with the same way as the experimental signal.

Returns:

The transformed results.

Return type:

Dict[str, np.ndarray]

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources