(run, verbose=None)
return raw, event_id
Convert one run to raw.
Convert one run to raw.
Convert one run to raw .
def _convert_run_epfl(run, verbose=None):
    """Convert one run to raw."""
    # parse eeg data
    event_id = {}

    montage = make_standard_montage("standard_1005")
    eeg_data = 1e-6 * run.eeg
    sfreq = run.header.SampleRate

    ch_names = list(run.header.Label[:-1])
    ch_types = ["eeg"] * len(ch_names)

    trigger = np.zeros((len(eeg_data), 1))

    for ii, typ in enumerate(run.header.EVENT.TYP):
        if typ in [6, 9]:  # Error
            trigger[run.header.EVENT.POS[ii] - 1, 0] = 2
        elif typ in [5, 10]:  # correct
            trigger[run.header.EVENT.POS[ii] - 1, 0] = 1

    eeg_data = np.c_[eeg_data, trigger]
    ch_names = ch_names + ["stim"]
    ch_types = ch_types + ["stim"]
    event_id = {"correct": 1, "error": 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_epfl ( run , verbose = None ) : # parse eeg data event_id = { } montage = make_standard_montage ( "standard_1005" ) eeg_data = 1e-6 * run . eeg sfreq = run . header . SampleRate ch_names = list ( run . header . Label [ : - 1 ] ) ch_types = [ "eeg" ] * len ( ch_names ) trigger = np . zeros ( ( len ( eeg_data ) , 1 ) ) for ii , typ in enumerate ( run . header . EVENT . TYP ) : if typ in [ 6 , 9 ] : # Error trigger [ run . header . EVENT . POS [ ii ] - 1 , 0 ] = 2 elif typ in [ 5 , 10 ] : # correct trigger [ run . header . EVENT . POS [ ii ] - 1 , 0 ] = 1 eeg_data = np . c_ [ eeg_data , trigger ] ch_names = ch_names + [ "stim" ] ch_types = ch_types + [ "stim" ] event_id = { "correct" : 1 , "error" : 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