예제 #1
0
refchans = ['EXG1', 'EXG2']
exclude = ['EXG6', 'EXG7', 'EXG8']
data_AM5, evnts_AM5 = EEGconcatenateFolder(data_loc + '4' + pathThing, nchans,
                                           refchans, exclude)
data_AM5.filter(2, 40)
data_AM5.set_channel_types({'EXG4': 'eeg', 'EXG3': 'eeg', 'EXG5': 'eeg'})
#data_eeg.notch_filter(60)

#bad_chs = [0,5,8,9,16,24,25,26,27]
bad_chs = [23, 24, 25, 26, 27]
All_chs = np.arange(32)
channels = np.delete(All_chs, bad_chs)
bad_chs = [
    'A24', 'A25', 'A26', 'A27', 'A28', 'EXG1', 'EXG2', 'EXG3', 'EXG4', 'EXG5'
]
data_AM5.drop_channels(bad_chs)
data_AM5.set_eeg_reference(ref_channels='average')

scalings = dict(eeg=20e-6, stim=1)
data_AM5.plot(events=evnts_AM5, scalings=scalings, show_options=True)

epochs_AM5 = mne.Epochs(data_AM5,
                        evnts_AM5, [255],
                        tmin=-0.5,
                        tmax=2.3,
                        baseline=(-0.2, 0),
                        reject=dict(eeg=200e-6))
evoked_AM5 = epochs_AM5.average()
evoked_AM5.plot(titles='AM 4')

data_AM40, evnts_AM40 = EEGconcatenateFolder(data_loc + '40' + pathThing,
예제 #2
0
folder = 'Chin_CMRrandMod_anesth/'
#data_loc = '/media/ravinderjit/Storage2/ChinCap/'
data_loc  = '/media/ravinderjit/Data_Drive/Data/ChinCap/'
#data_loc = '/home/ravinderjit/Documents/ChinCapData/'
nchans = 35
# refchans = ['A1','A2','A3','A4','A5','A6','A7','A8','A9','A10','A11','A12','A13','A14','A15','A16','A17','A18','A19',
#             'A20','A21','A22','A23','A29','A30','A31','A32']
refchans = ['EXG1','EXG2']
exclude = ['EXG4','EXG5','EXG6','EXG7','EXG8']
data_eeg,evnts_eeg = EEGconcatenateFolder(data_loc + folder ,nchans,refchans,exclude)
data_eeg.filter(1,300) 
data_eeg.set_channel_types({'EXG3':'eeg'})

bad_chs = ['A1','A25','A26','A27','A28','EXG3']#,'EXG1','EXG2','A20']
data_eeg.drop_channels(bad_chs)
#data_eeg.set_eeg_reference(ref_channels='average')

scalings = dict(eeg=20e-6,stim=1)
data_eeg.plot(events = evnts_eeg, scalings=scalings,show_options=True)

epochs_all = []
for m in np.arange(4):
    epochs_m = mne.Epochs(data_eeg,evnts_eeg,[m+1],tmin=-0.50,tmax=4.5,baseline=(-0.2,0))#,reject=dict(eeg=200e-6))
    evoked_m = epochs_m.average()
    evoked_m.plot(titles = str(m+1))
    epochs_all.append(epochs_m)
    


Aud_picks = ['A30', 'A6', 'A29', 'A7', 'A4', 'A17', 'A32', 'A10', 'A3']