nchans = 34; refchans = ['EXG1','EXG2'] data_eeg = []; data_evnt = []; #data_loc = '/media/ravinderjit/Storage2/EEGdata' data_loc = '/media/ravinderjit/Data_Drive/Data/EEGdata/CMR_active/CMRactive_10Hz' subject = 'SVarsha' exclude = ['EXG3','EXG4','EXG5','EXG6','EXG7','EXG8'] datapath = os.path.join(data_loc,subject) data_eeg,data_evnt = EEGconcatenateFolder(datapath+'/',nchans,refchans,exclude) data_eeg.filter(l_freq=1,h_freq=100) #%% Blink Removal blinks = find_blinks(data_eeg,ch_name = ['A1'],thresh = 100e-6, l_trans_bandwidth = 0.5, l_freq =1.0, h_freq=10) blink_epochs = mne.Epochs(data_eeg,blinks,998,tmin=-0.25,tmax=0.25,proj=False, baseline=(-0.25,0),reject=dict(eeg=500e-6)) Projs = compute_proj_epochs(blink_epochs,n_grad=0,n_mag=0,n_eeg=8,verbose='DEBUG') blink_proj = Projs[0] data_eeg.add_proj(blink_proj) data_eeg.plot_projs_topomap() data_eeg.plot(events=blinks,show_options=True) #%% Plot labels = ['40 codev','40 comod']
refchans = None direct_IAC = '/media/ravinderjit/Data_Drive/Data/EEGdata/BinauralMseq_reCollect/StandardWay/' direct_Mseq = '/media/ravinderjit/Data_Drive/Data/EEGdata/DynamicBinaural/Mseq_4096fs_compensated.mat' Mseq_mat = sio.loadmat(direct_Mseq) Mseq = Mseq_mat['Mseq_sig'].T Mseq = Mseq.astype(float) exclude = ['EXG1','EXG2','EXG3','EXG4','EXG5','EXG6','EXG7','EXG8']; #don't need these extra external channels that are saved IAC_eeg,IAC_evnt = EEGconcatenateFolder(direct_IAC+Subject+'/',nchans,refchans,exclude) IAC_eeg.filter(1,40) #%% blink removal blinks_IAC = find_blinks(IAC_eeg, ch_name = ['A1'], thresh = 100e-6, l_trans_bandwidth=0.5, l_freq = 1.0) scalings = dict(eeg=40e-6) blinkIAC_epochs = mne.Epochs(IAC_eeg,blinks_IAC,998,tmin=-0.25,tmax=0.25,proj=False, baseline=(-0.25,0),reject=dict(eeg=500e-6)) Projs_IAC = compute_proj_epochs(blinkIAC_epochs, n_grad=0,n_mag=0,n_eeg=8,verbose='DEBUG') eye_projsIAC = [Projs_IAC[0],Projs_IAC[1]] IAC_eeg.add_proj(eye_projsIAC) IAC_eeg.plot_projs_topomap()
import scipy.io as sio import os import pickle import mne from anlffr.preproc import find_blinks from EEGpp import EEGconcatenateFolder from mne.preprocessing.ssp import compute_proj_epochs data_loc = '/media/ravinderjit/Data_Drive/Data/EEGdata/Sentences/' subject = 'S211' refchans = ['EXG1', 'EXG2'] nchans = 34 exclude = ['EXG3', 'EXG4', 'EXG5', 'EXG6', 'EXG7', 'EXG8'] sentEEG, sent_evnt = EEGconcatenateFolder(data_loc + subject + '/', nchans, refchans, exclude) sentEEG.filter(1, 75) blinks = find_blinks(sentEEG, ch_name=['A1'], thresh=100e-6, l_trans_bandwidth=0.5, l_freq=1.0) blink_epochs = mne.Epochs(sentEEG, blinks, 998, tmin=-0.25, tmax=0.25, proj=False,
data_sumMasker, _ = summ(data_masker_pos, data_masker_neg) return evoked_pos, evoked_neg, data_sumMasker, data_masker_diff, data_prob_diff, data_adpt_diff, numtrials_adpt ######################################################################################################################################################## froot = "C:\\Users\\racqu\\Documents\\Research\\Purdue\\HumanData\\AS\\SQ50\\" fs = 16384 topchans = [31] #CHANGE AS NEEDED bdfname = froot + bdf full_raw, full_eves = EEGconcatenateFolder(froot, nchans=34, refchans=['EXG1', 'EXG2'], exclude=[], fs_new=4e3) event_id = {'Positive': 1} epochs = mne.Epochs(full_raw, full_eves, event_id, tmin=0.0, tmax=1.5, reject_tmax=1.3, picks=31, reject=dict(eeg=100e-6)) epochs.load_data() epochs_filtered = epochs.filter(70, None)