Exemplo n.º 1
0
def read_eeg(path):
    eeg = octave.pop_loadset(path)
    new_trial_list = []
    for i in range(eeg.data.shape[2]):
        trial = eeg.data[:, :, i]
        time = np.linspace(-1000, -20, num=trial.shape[1])
        trial = pd.DataFrame(np.transpose(trial), columns=eeg.chanlocs.labels[0])
        trial['time'] = time
        new_trial_list.append(trial)
    return new_trial_list
Exemplo n.º 2
0
    'C:/Program Files/MATLAB/eeglab_current/eeglab2021.0/functions/miscfunc')
octave.addpath(
    'C:/Program Files/MATLAB/eeglab_current/eeglab2021.0/functions/statistics')
octave.addpath(
    'C:/Program Files/MATLAB/eeglab_current/eeglab2021.0/functions/studyfunc')
octave.addpath(
    'C:/Program Files/MATLAB/eeglab_current/eeglab2021.0/functions/supportfiles'
)
octave.addpath(
    'C:/Program Files/MATLAB/eeglab_current/eeglab2021.0/functions/timefreqfunc'
)
octave.addpath(
    'C:/Program Files/MATLAB/eeglab_current/eeglab2021.0/plugins/firfilt')

EEG = octave.pop_loadset(
    'C:/Program Files/MATLAB/eeglab_current/eeglab2021.0/project/Depression_REST/Matlab_Files/507_Depression_REST.mat'
)
#EEG = octave.pop_loadset('C:/Program Files/MATLAB/eeglab_current/eeglab2021.0/sample_data/eeglab_data.set') #example use sample_data/eeglab_data_epochs_ica.set

#plot first trail of channel 1
import matplotlib.pyplot as plt
#plt.plot(EEG.data[10][0:249000])
#plt.show()

EEG_data = EEG
EEG_data.data = EEG.data[:][0:248000]
EEG2 = octave.pop_eegfiltnew(EEG_data, 0.5, 100, [], 0, [], 0)

plt.plot(EEG2.data[0][0:248000])
plt.show()