Cueing Group Analysis

Setup

# Standard pythonic importa
import  os,sys,glob,numpy as np,pandas as pd
from collections import OrderedDict
import warnings
warnings.filterwarnings('ignore')
from matplotlib import pyplot as plt
import matplotlib.patches as patches

# MNE functions
from mne import Epochs, find_events, concatenate_raws
from mne.time_frequency import tfr_morlet

# EEG-Notebooks functions
from eegnb.datasets import datasets
from eegnb.analysis.utils import load_data

Download the data

eegnb_data_path = os.path.join(os.path.expanduser('~/'),'.eegnb', 'data')
cueing_data_path = os.path.join(eegnb_data_path, 'visual-cueing', 'kylemathlab_dev')

# If dataset hasn't been downloaded yet, download it
if not os.path.isdir(cueing_data_path):
      datasets.fetch_dataset(data_dir=eegnb_data_path, experiment='visual-cueing', site='kylemathlab_dev')

Load data into MNE objects

# MNE is a very powerful Python library for analyzing EEG data. It provides helpful functions for performing key tasks such as filtering EEG data, rejecting artifacts, and grouping EEG data into chunks (epochs).

# The first step after loading dependencies is use MNE to read the data we've collected into an MNE Raw object
subs = [101, 102, 103, 104, 105, 106, 108, 109, 110, 111, 112,
        202, 203, 204, 205, 207, 208, 209, 210, 211,
        301, 302, 303, 304, 305, 306, 307, 308, 309]

diff_out = []
Ipsi_out = []
Contra_out = []
Ipsi_spectra_out = []
Contra_spectra_out = []
diff_spectra_out = []
ERSP_diff_out = []
ERSP_Ipsi_out = []
ERSP_Contra_out = []

frequencies =  np.linspace(6, 30, 100, endpoint=True)
wave_cycles = 6

# time frequency window for analysis
f_low = 7 # Hz
f_high = 10
f_diff = f_high-f_low

t_low = 0 # s
t_high = 1
t_diff = t_high-t_low

bad_subs= [6, 7, 13, 26]
really_bad_subs = [11, 12, 19]
sub_count = 0



for sub in subs:
    print(sub)

    sub_count += 1


    if (sub_count in really_bad_subs):
        rej_thresh_uV = 90
    elif (sub_count in bad_subs):
        rej_thresh_uV = 90
    else:
        rej_thresh_uV = 90

    rej_thresh = rej_thresh_uV*1e-6


    # Load both sessions
    raw = load_data(sub,1, # subject, session
                    experiment='visual-cueing',site='kylemathlab_dev',device_name='muse2016',
                    data_dir = eegnb_data_path)

    raw.append(
          load_data(sub,2, # subject, session
                    experiment='visual-cueing', site='kylemathlab_dev', device_name='muse2016',
                    data_dir = eegnb_data_path))


    # Filter Raw Data
    raw.filter(1,30, method='iir')

    #Select Events
    events = find_events(raw)
    event_id = {'LeftCue': 1, 'RightCue': 2}
    epochs = Epochs(raw, events=events, event_id=event_id,
                    tmin=-1, tmax=2, baseline=(-1, 0),
                    reject={'eeg':rej_thresh}, preload=True,
                    verbose=False, picks=[0, 3])
    print('Trials Remaining: ' + str(len(epochs.events)) + '.')

    # Compute morlet wavelet

    # Left Cue
    tfr, itc = tfr_morlet(epochs['LeftCue'], freqs=frequencies,
                          n_cycles=wave_cycles, return_itc=True)
    tfr = tfr.apply_baseline((-1,-.5),mode='mean')
    #tfr.plot(picks=[0], mode='logratio',
    #         title='TP9 - Ipsi');
    #tfr.plot(picks=[3], mode='logratio',
    #         title='TP10 - Contra');
    power_Ipsi_TP9 = tfr.data[0,:,:]
    power_Contra_TP10 = tfr.data[1,:,:]

    # Right Cue
    tfr, itc = tfr_morlet(epochs['RightCue'], freqs=frequencies,
                          n_cycles=wave_cycles, return_itc=True)
    tfr = tfr.apply_baseline((-1,-.5),mode='mean')
    #tfr.plot(picks=[0], mode='logratio',
    #         title='TP9 - Contra');
    #tfr.plot(picks=[3], mode='logratio',
    #         title='TP10 - Ipsi');
    power_Contra_TP9 = tfr.data[0,:,:]
    power_Ipsi_TP10 = tfr.data[1,:,:]

    # Plot Differences
    #%matplotlib inline
    times = epochs.times
    power_Avg_Ipsi =   (power_Ipsi_TP9+power_Ipsi_TP10)/2;
    power_Avg_Contra = (power_Contra_TP9+power_Contra_TP10)/2;
    power_Avg_Diff = power_Avg_Ipsi-power_Avg_Contra;


    #find max to make color range
    plot_max = np.max([np.max(np.abs(power_Avg_Ipsi)), np.max(np.abs(power_Avg_Contra))])
    plot_diff_max = np.max(np.abs(power_Avg_Diff))



    #Ipsi
    fig, ax = plt.subplots(1)
    im = plt.imshow(power_Avg_Ipsi,
               extent=[times[0], times[-1], frequencies[0], frequencies[-1]],
               aspect='auto', origin='lower', cmap='coolwarm', vmin=-plot_max, vmax=plot_max)
    plt.xlabel('Time (sec)')
    plt.ylabel('Frequency (Hz)')
    plt.title('Power Average Ipsilateral to Cue')
    cb = fig.colorbar(im)
    cb.set_label('Power')
    # Create a Rectangle patch
    rect = patches.Rectangle((t_low,f_low),t_diff,f_diff,linewidth=1,edgecolor='k',facecolor='none')
    # Add the patch to the Axes
    ax.add_patch(rect)

    #TP10
    fig, ax = plt.subplots(1)
    im = plt.imshow(power_Avg_Contra,
               extent=[times[0], times[-1], frequencies[0], frequencies[-1]],
               aspect='auto', origin='lower', cmap='coolwarm', vmin=-plot_max, vmax=plot_max)
    plt.xlabel('Time (sec)')
    plt.ylabel('Frequency (Hz)')
    plt.title(str(sub) + ' - Power Average Contra to Cue')
    cb = fig.colorbar(im)
    cb.set_label('Power')
    # Create a Rectangle patch
    rect = patches.Rectangle((t_low,f_low),t_diff,f_diff,linewidth=1,edgecolor='k',facecolor='none')
    # Add the patch to the Axes
    ax.add_patch(rect)

    #difference between conditions
    fig, ax = plt.subplots(1)
    im = plt.imshow(power_Avg_Diff,
               extent=[times[0], times[-1], frequencies[0], frequencies[-1]],
               aspect='auto', origin='lower', cmap='coolwarm', vmin=-plot_diff_max, vmax=plot_diff_max)
    plt.xlabel('Time (sec)')
    plt.ylabel('Frequency (Hz)')
    plt.title('Power Difference Ipsi-Contra')
    cb = fig.colorbar(im)
    cb.set_label('Ipsi-Contra Power')
    # Create a Rectangle patch
    rect = patches.Rectangle((t_low,f_low),t_diff,f_diff,linewidth=1,edgecolor='k',facecolor='none')
    # Add the patch to the Axes
    ax.add_patch(rect)




    #output data into array
    Ipsi_out.append(np.mean(power_Avg_Ipsi[np.argmax(frequencies>f_low):
                                           np.argmax(frequencies>f_high)-1,
                            np.argmax(times>t_low):np.argmax(times>t_high)-1 ]
                           )
                   )
    Ipsi_spectra_out.append(np.mean(power_Avg_Ipsi[:,np.argmax(times>t_low):
                                                   np.argmax(times>t_high)-1 ],1
                                   )
                           )

    Contra_out.append(np.mean(power_Avg_Contra[np.argmax(frequencies>f_low):
                                               np.argmax(frequencies>f_high)-1,
                            np.argmax(times>t_low):np.argmax(times>t_high)-1 ]
                             )
                     )

    Contra_spectra_out.append(np.mean(power_Avg_Contra[:,np.argmax(times>t_low):
                                                       np.argmax(times>t_high)-1 ],1))


    diff_out.append(np.mean(power_Avg_Diff[np.argmax(frequencies>f_low):
                                           np.argmax(frequencies>f_high)-1,
                            np.argmax(times>t_low):np.argmax(times>t_high)-1 ]
                           )
                   )
    diff_spectra_out.append(np.mean(power_Avg_Diff[:,np.argmax(times>t_low):
                                                   np.argmax(times>t_high)-1 ],1
                                   )
                           )


    ERSP_diff_out.append(power_Avg_Diff)
    ERSP_Ipsi_out.append(power_Avg_Ipsi)
    ERSP_Contra_out.append(power_Avg_Contra)



print(np.shape(ERSP_diff_out))
print(np.shape(Contra_spectra_out))

print(diff_out)
  • Power Average Ipsilateral to Cue
  • 101 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 102 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 103 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 104 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 105 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 106 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 108 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 109 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 110 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 111 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 112 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 202 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 203 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 204 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 205 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 207 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 208 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 209 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 210 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 211 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 301 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 302 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 303 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 304 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 305 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 306 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 307 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 308 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
  • Power Average Ipsilateral to Cue
  • 309 - Power Average Contra to Cue
  • Power Difference Ipsi-Contra
101


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0101/session001/subject101_session1_recording_2018-11-20-16.42.02.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0101/session002/subject101_session2_recording_2018-11-20-16.53.23.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

122 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 10.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
102


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0102/session001/subject102_session1_recording_2018-11-20-17.05.27.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0102/session002/subject102_session2_recording_2018-11-20-17.14.10.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

92 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 40.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
103


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0103/session001/subject103_session1_recording_2018-11-20-17.26.43.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0103/session002/subject103_session2_recording_2018-11-20-17.33.59.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

160 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 58.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
104


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0104/session001/subject104_session1_recording_2018-11-21-18.18.35.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0104/session002/subject104_session2_recording_2018-11-21-18.27.12.csv

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0104/session002/subject104_session2_recording_2018-11-20-17.49.47.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
Filtering raw data in 3 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

272 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 39.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
105


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0105/session001/subject105_session1_recording_2018-11-20-18.17.07.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0105/session002/subject105_session2_recording_2018-11-20-18.23.37.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

111 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 21.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
106


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0106/session001/subject106_session1_recording_2018-11-20-18.00.27.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0106/session002/subject106_session2_recording_2018-11-20-18.07.03.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

201 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 2.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
108


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0108/session001/subject108_session1_recording_2018-11-22-17.07.36.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0108/session002/subject108_session2_recording_2018-11-22-17.15.34.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

130 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 0.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
109


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0109/session001/subject109_session1_recording_2018-11-22-17.27.44.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0109/session002/subject109_session2_recording_2018-11-22-17.34.20.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

160 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 5.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
110


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0110/session001/subject110_session1_recording_2018-11-22-16.46.55.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0110/session002/subject110_session2_recording_2018-11-22-16.56.10.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

107 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 28.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
111


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0111/session001/subject111_session1_recording_2018-11-22-17.43.50.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0111/session002/subject111_session2_recording_2018-11-22-17.49.42.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

223 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 32.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
112


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0112/session001/subject112_session1_recording_2018-11-22-17.59.31.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0112/session002/subject112_session2_recording_2018-11-22-18.07.30.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

86 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 0.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
202


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0202/session001/subject202_session1_recording_2018-11-20-16.39.02.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0202/session002/subject202_session2_recording_2018-11-20-16.46.28.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

156 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 61.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
203


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0203/session001/subject203_session1_recording_2018-11-20-16.59.53.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0203/session002/subject203_session2_recording_2018-11-20-17.08.00.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

120 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 4.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
204


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0204/session001/subject204_session1_recording_2018-11-20-17.22.49.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0204/session002/subject204_session2_recording_2018-11-20-17.29.51.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

183 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 49.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
205


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0205/session001/subject205_session1_recording_2018-11-20-17.41.48.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0205/session002/subject205_session2_recording_2018-11-20-17.48.11.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

194 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 87.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
207


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0207/session001/subject207_session1_recording_2018-11-22-16.33.38.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0207/session002/subject207_session2_recording_2018-11-22-16.41.04.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

181 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 70.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
208


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0208/session001/subject208_session1_recording_2018-11-22-16.54.46.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0208/session002/subject208_session2_recording_2018-11-22-17.02.17.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

181 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 70.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
209


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0209/session001/subject209_session1_recording_2018-11-22-17.21.18.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0209/session002/subject209_session2_recording_2018-11-22-17.29.01.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

118 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 5.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
210


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0210/session001/subject210_session1_recording_2018-11-22-17.42.48.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0210/session002/subject210_session2_recording_2018-11-22-17.49.59.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

170 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 67.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
211


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0211/session001/subject211_session1_recording_2018-11-20-18.01.25.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0211/session002/subject211_session2_recording_2018-11-20-18.11.42.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

96 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 9.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
301


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0301/session001/subject301_session1_recording_2018-11-20-16.52.26.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=30564
    Range : 0 ... 30563 =      0.000 ...   119.387 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0301/session002/subject301_session2_recording_2018-11-20-16.57.44.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=30564
    Range : 0 ... 30563 =      0.000 ...   119.387 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

54 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 26.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
302


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0302/session001/subject302_session1_recording_2018-11-20-17.10.25.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0302/session002/subject302_session2_recording_2018-11-20-17.31.03.csv

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0302/session002/subject302_session2_recording_2018-11-20-17.18.04.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 3 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

213 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 11.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
303


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0303/session001/subject303_session1_recording_2018-11-20-17.49.48.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0303/session002/subject303_session2_recording_2018-11-20-17.39.08.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

198 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 8.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
304


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0304/session001/subject304_session1_recording_2018-11-20-17.59.43.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0304/session002/subject304_session2_recording_2018-11-20-18.06.46.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61284
    Range : 0 ... 61283 =      0.000 ...   239.387 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

195 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 24.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
305


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0305/session001/subject305_session1_recording_2018-11-20-18.22.30.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0305/session002/subject305_session2_recording_2018-11-20-18.29.57.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

166 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 9.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
306


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0306/session001/subject306_session1_recording_2018-11-22-16.40.52.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0306/session002/subject306_session2_recording_2018-11-22-16.48.01.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

147 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 1.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
307


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0307/session001/subject307_session1_recording_2018-11-22-17.02.17.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0307/session002/subject307_session2_recording_2018-11-22-17.09.25.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

171 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 49.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
308


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0308/session001/subject308_session1_recording_2018-11-22-17.21.43.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61296
    Range : 0 ... 61295 =      0.000 ...   239.434 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0308/session002/subject308_session2_recording_2018-11-22-17.28.31.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

180 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 71.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
309


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0309/session001/subject309_session1_recording_2018-11-22-17.41.24.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.


Loading these files:

/home/runner/.eegnb/data/visual-cueing/kylemathlab_dev/muse2016/subject0309/session002/subject309_session2_recording_2018-11-22-17.48.17.csv




['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
['TP9', 'AF7', 'AF8', 'TP10', 'Right AUX', 'stim']
Creating RawArray with float64 data, n_channels=6, n_times=61308
    Range : 0 ... 61307 =      0.000 ...   239.480 secs
Ready.
Filtering raw data in 2 contiguous segments
Setting up band-pass filter from 1 - 30 Hz

IIR filter parameters
---------------------
Butterworth bandpass zero-phase (two-pass forward and reverse) non-causal filter:
- Filter order 16 (effective, after forward-backward)
- Cutoffs at 1.00, 30.00 Hz: -6.02, -6.02 dB

196 events found on stim channel stim
Event IDs: [ 1  2 11 12 21 22]
Trials Remaining: 74.
Applying baseline correction (mode: mean)
Applying baseline correction (mode: mean)
(29, 100, 769)
(29, 100)
[-1.8633016529356232e-10, -5.194492698041424e-11, 3.965717366845577e-11, -9.439937924298538e-11, 1.5395426956926177e-10, nan, nan, 1.437520530470476e-10, 6.156413801290107e-12, -3.4542289627374594e-11, nan, 1.404002269024156e-10, 4.5250575579728836e-11, 8.13341442171729e-11, 1.7562617842729167e-12, 3.498985471214225e-11, -7.358448888412755e-11, -2.066739867471836e-11, 5.833832231476192e-11, -1.1353507280272121e-10, 2.0578545669354385e-10, 8.13612907825663e-11, 2.231124565129559e-09, 4.417204016507064e-13, 1.5824220701839133e-10, nan, 2.972694444208325e-11, -2.7053453190038292e-11, 1.0032262566342049e-10]

Combine subjects

GrandAvg_diff = np.nanmean(ERSP_diff_out,0)
GrandAvg_Ipsi = np.nanmean(ERSP_Ipsi_out,0)
GrandAvg_Contra = np.nanmean(ERSP_Contra_out,0)

GrandAvg_spec_Ipsi = np.nanmean(Ipsi_spectra_out,0)
GrandAvg_spec_Contra = np.nanmean(Contra_spectra_out,0)
GrandAvg_spec_diff = np.nanmean(diff_spectra_out,0)

num_good = len(diff_out) - sum(np.isnan(diff_out))
GrandAvg_spec_Ipsi_ste = np.nanstd(Ipsi_spectra_out,0)/np.sqrt(num_good)
GrandAvg_spec_Contra_ste = np.nanstd(Contra_spectra_out,0)/np.sqrt(num_good)
GrandAvg_spec_diff_ste = np.nanstd(diff_spectra_out,0)/np.sqrt(num_good)

#Spectra error bars
fig, ax = plt.subplots(1)
plt.errorbar(frequencies,GrandAvg_spec_Ipsi,yerr=GrandAvg_spec_Ipsi_ste)
plt.errorbar(frequencies,GrandAvg_spec_Contra,yerr=GrandAvg_spec_Contra_ste)

plt.legend(('Ipsi','Contra'))
plt.xlabel('Frequency (Hz)')
plt.ylabel('Power (uV^2)')
plt.hlines(0,3,33)

#Spectra Diff error bars
fig, ax = plt.subplots(1)
plt.errorbar(frequencies,GrandAvg_spec_diff,yerr=GrandAvg_spec_diff_ste)

plt.legend('Ipsi-Contra')
plt.xlabel('Frequency (Hz)')
plt.ylabel('Power (uV^2)')
plt.hlines(0,3,33)

#Grand Average Ipsi
plot_max = np.max([np.max(np.abs(GrandAvg_Ipsi)), np.max(np.abs(GrandAvg_Contra))])
fig, ax = plt.subplots(1)
im = plt.imshow(GrandAvg_Ipsi,
           extent=[times[0], times[-1], frequencies[0], frequencies[-1]],
           aspect='auto', origin='lower', cmap='coolwarm', vmin=-plot_max, vmax=plot_max)
plt.xlabel('Time (sec)')
plt.ylabel('Frequency (Hz)')
plt.title('Power Ipsi')
cb = fig.colorbar(im)
cb.set_label('Power')
# Create a Rectangle patch
rect = patches.Rectangle((t_low,f_low),t_diff,f_diff,linewidth=1,edgecolor='k',facecolor='none')
# Add the patch to the Axes
ax.add_patch(rect)

#Grand Average Contra
fig, ax = plt.subplots(1)
im = plt.imshow(GrandAvg_Contra,
           extent=[times[0], times[-1], frequencies[0], frequencies[-1]],
           aspect='auto', origin='lower', cmap='coolwarm', vmin=-plot_max, vmax=plot_max)
plt.xlabel('Time (sec)')
plt.ylabel('Frequency (Hz)')
plt.title('Power Contra')
cb = fig.colorbar(im)
cb.set_label('Power')
# Create a Rectangle patch
rect = patches.Rectangle((t_low,f_low),t_diff,f_diff,linewidth=1,edgecolor='k',facecolor='none')
# Add the patch to the Axes
ax.add_patch(rect)

#Grand Average Ipsi-Contra Difference
plot_max_diff = np.max(np.abs(GrandAvg_diff))
fig, ax = plt.subplots(1)
im = plt.imshow(GrandAvg_diff,
           extent=[times[0], times[-1], frequencies[0], frequencies[-1]],
           aspect='auto', origin='lower', cmap='coolwarm', vmin=-plot_max_diff, vmax=plot_max_diff)
plt.xlabel('Time (sec)')
plt.ylabel('Frequency (Hz)')
plt.title('Power Difference Ipsi-Contra')
cb = fig.colorbar(im)
cb.set_label('Ipsi-Contra Power')
# Create a Rectangle patch
rect = patches.Rectangle((t_low,f_low),t_diff,f_diff,linewidth=1,edgecolor='k',facecolor='none')
# Add the patch to the Axes
ax.add_patch(rect)
  • 02r  cueing group analysis
  • 02r  cueing group analysis
  • Power Ipsi
  • Power Contra
  • Power Difference Ipsi-Contra
<matplotlib.patches.Rectangle object at 0x7ff720bb15b0>

Compute t test

import scipy
num_good = len(diff_out) - sum(np.isnan(diff_out))

[tstat, pval] = scipy.stats.ttest_ind(diff_out,np.zeros(len(diff_out)),nan_policy='omit')
print('Ipsi Mean: '+  str(np.nanmean(Ipsi_out)))
print('Contra Mean: '+  str(np.nanmean(Contra_out)))
print('Mean Diff: '+  str(np.nanmean(diff_out)))
print('t(' + str(num_good-1) + ') = ' + str(round(tstat,3)))
print('p = ' + str(round(pval,3)))
Ipsi Mean: 9.02456136295644e-11
Contra Mean: -2.617586361170848e-11
Mean Diff: 1.164214772412729e-10
t(24) = 1.394
p = 0.169

Save average powers ipsi and contra

import pandas as pd
print(diff_out)
raw_data = {'Ipsi Power': Ipsi_out,
        'Contra Power': Contra_out}
df = pd.DataFrame(raw_data, columns = ['Ipsi Power', 'Contra Power'])
df.to_csv('375CueingEEG.csv')
print('Saved subject averages for each condition to 375CueingEEG.csv file in present directory')
[-1.8633016529356232e-10, -5.194492698041424e-11, 3.965717366845577e-11, -9.439937924298538e-11, 1.5395426956926177e-10, nan, nan, 1.437520530470476e-10, 6.156413801290107e-12, -3.4542289627374594e-11, nan, 1.404002269024156e-10, 4.5250575579728836e-11, 8.13341442171729e-11, 1.7562617842729167e-12, 3.498985471214225e-11, -7.358448888412755e-11, -2.066739867471836e-11, 5.833832231476192e-11, -1.1353507280272121e-10, 2.0578545669354385e-10, 8.13612907825663e-11, 2.231124565129559e-09, 4.417204016507064e-13, 1.5824220701839133e-10, nan, 2.972694444208325e-11, -2.7053453190038292e-11, 1.0032262566342049e-10]
Saved subject averages for each condition to 375CueingEEG.csv file in present directory

Save spectra

df = pd.DataFrame(Ipsi_spectra_out,columns=frequencies)
df.to_csv('375CueingIpsiSpec.csv')

df = pd.DataFrame(Contra_spectra_out,columns=frequencies)
df.to_csv('375CueingContraSpec.csv')
print('Saved Spectra to 375Cueing*Spec.csv file in present directory')
Saved Spectra to 375Cueing*Spec.csv file in present directory

Total running time of the script: (0 minutes 30.377 seconds)

Gallery generated by Sphinx-Gallery