Note
Click here to download the full example code
This example shows how to use the ERP functions
from sab_dataset import *
from os.path import isdir, join
import seaborn as sns
sns.set()
sns.set_context('paper')
Load the data : sab dataset
sab_dataset_dirpath = join('pySAB', 'sample_data') if isdir('pySAB') else join('..', '..', 'pySAB', 'sample_data')
sab_dataset_filename = 'sab_dataset_rec_subject_id_040119_1153.p'
rec_dataset = load_sab_dataset(join(sab_dataset_dirpath, sab_dataset_filename))
See information about this dataset
print(rec_dataset)
Out:
SAB dataset REC - subject_id
7 channels, 359 points [-0.10, 0.60s], sampling rate 512.0 Hz
356 trials : 183 hits, 173 correct rejects, 0 omissions, 0 false alarms
Channel Info : 7 channels and 1 electrodes
7 EEG channels - 0 non-EEG channels
1 EEG electrodes - 0 non-EEG electrodes
Plot the evoked response of channel 6 for ‘hits’ and ‘correct reject’ conditions (default)
rec_dataset.plot_erp(6)
Plot the ERPs of channels containing ‘TB‘4’ one for hits condition
rec_dataset.plot_erp('EEG TP\'3-TP\'4', plot_hits=1, plot_cr=0, plot_fa=0, plot_omissions=0)
Plot ERPs of the first electrode
rec_dataset.plot_electrode_erps(0)
Total running time of the script: ( 0 minutes 0.163 seconds)