(run, ch_types, verbose=None)
return raw, event_id
Convert one run to raw.
Convert one run to raw.
Convert one run to raw .
def _convert_run_bbci(run, ch_types, verbose=None):
    """Convert one run to raw."""
    # parse eeg data
    montage = make_standard_montage("standard_1005")
    eeg_data = 1e-6 * run.X
    sfreq = run.fs

    ch_names = list(run.channels)

    trigger = np.zeros((len(eeg_data), 1))
    trigger[run.trial - 1, 0] = run.y
    event_id = {ev: (ii + 1) for ii, ev in enumerate(run.classes)}

    flash = np.zeros((len(eeg_data), 1))
    flash[run.trial - 1, 0] = run.y_stim + 2
    ev_fl = {"Stim%d" % (stim): (stim + 2) for stim in np.unique(run.y_stim)}
    event_id.update(ev_fl)

    eeg_data = np.c_[eeg_data, trigger, flash]
    ch_names = ch_names + ["Target", "Flash"]
    ch_types = ch_types + ["stim"] * 2

    info = create_info(ch_names=ch_names, ch_types=ch_types, sfreq=sfreq)
    raw = RawArray(data=eeg_data.T, info=info, verbose=verbose)
    raw.set_montage(montage)
    return raw, event_id
def _convert_run_bbci ( run , ch_types , verbose = None ) : # parse eeg data montage = make_standard_montage ( "standard_1005" ) eeg_data = 1e-6 * run . X sfreq = run . fs ch_names = list ( run . channels ) trigger = np . zeros ( ( len ( eeg_data ) , 1 ) ) trigger [ run . trial - 1 , 0 ] = run . y event_id = { ev : ( ii + 1 ) for ii , ev in enumerate ( run . classes ) } flash = np . zeros ( ( len ( eeg_data ) , 1 ) ) flash [ run . trial - 1 , 0 ] = run . y_stim + 2 ev_fl = { "Stim%d" % ( stim ) : ( stim + 2 ) for stim in np . unique ( run . y_stim ) } event_id . update ( ev_fl ) eeg_data = np . c_ [ eeg_data , trigger , flash ] ch_names = ch_names + [ "Target" , "Flash" ] ch_types = ch_types + [ "stim" ] * 2 info = create_info ( ch_names = ch_names , ch_types = ch_types , sfreq = sfreq ) raw = RawArray ( data = eeg_data . T , info = info , verbose = verbose ) raw . set_montage ( montage ) return raw , event_id