Okay. I took this from your âCreating epochs and generating evoked responses (ERP/ERF)â tutorial.
import pathlib
import matplotlib
import mne
import mne_bids
matplotlib.use('Qt5Agg')
bids_root = pathlib.Path('out_data/sample_BIDS')
bids_path = mne_bids.BIDSPath(subject='01',
session='01',
task='audiovisual',
run='01',
datatype='meg',
root=bids_root)
raw = mne_bids.read_raw_bids(bids_path)
raw.load_data()
raw.filter(l_freq=0.1, h_freq=40)
events, event_id = mne.events_from_annotations(raw)
Opening raw data file out_data\sample_BIDS\sub-01\ses-01\meg\sub-01_ses-01_task-audiovisual_run-01_meg.fifâŠ
Read a total of 3 projection items:
PCA-v1 (1 x 102) idle
PCA-v2 (1 x 102) idle
PCA-v3 (1 x 102) idle
Range : 25800 ⊠192599 = 42.956 ⊠320.670 secs
Ready.
Reading events from out_data\sample_BIDS\sub-01\ses-01\meg\sub-01_ses-01_task-audiovisual_run-01_events.tsv.
Reading channel info from out_data\sample_BIDS\sub-01\ses-01\meg\sub-01_ses-01_task-audiovisual_run-01_channels.tsv.
Reading 0 ⊠166799 = 0.000 ⊠277.714 secsâŠ
C:\Users\S_Hei\AppData\Roaming\Python\Python39\site-packages\mne_bids\read.py:406: RuntimeWarning: The unit for channel(s) STI 001, STI 002, STI 003, STI 004, STI 005, STI 006, STI 014, STI 015, STI 016 has changed from V to NA.
raw.set_channel_types(channel_type_dict)
Filtering raw data in 1 contiguous segment
Setting up band-pass filter from 0.1 - 40 Hz
FIR filter parameters
Designing a one-pass, zero-phase, non-causal bandpass filter:
- Windowed time-domain design (firwin) method
- Hamming window with 0.0194 passband ripple and 53 dB stopband attenuation
- Lower passband edge: 0.10
- Lower transition bandwidth: 0.10 Hz (-6 dB cutoff frequency: 0.05 Hz)
- Upper passband edge: 40.00 Hz
- Upper transition bandwidth: 10.00 Hz (-6 dB cutoff frequency: 45.00 Hz)
- Filter length: 19821 samples (33.001 sec)
Used Annotations descriptions: [âAuditory/Leftâ, âAuditory/Rightâ, âButtonâ, âSmileyâ, âVisual/Leftâ, âVisual/Rightâ]
event_id
{âAuditory/Leftâ: 1,
âAuditory/Rightâ: 2,
âButtonâ: 3,
âSmileyâ: 4,
âVisual/Leftâ: 5,
âVisual/Rightâ: 6}
tmin = -0.3
tmax = 0.5
baseline = (None, 0)
epochs = mne.Epochs(raw,
events=events,
event_id=event_id,
tmin=tmin,
tmax=tmax,
baseline=baseline,
preload=True)
epochs
Not setting metadata
Not setting metadata
320 matching events found
Setting baseline interval to [-0.2996928197375818, 0.0] sec
Applying baseline correction (mode: mean)
Created an SSP operator (subspace dimension = 3)
3 projection items activated
Loading data for 320 events and 481 original time points âŠ
0 bad epochs dropped
<Epochs | 320 events (all good), -0.299693 - 0.499488 sec, baseline [-0.299693, 0] sec, ~444.8 MB, data loaded,
âAuditory/Leftâ: 72
âAuditory/Rightâ: 73
âButtonâ: 16
âSmileyâ: 15
âVisual/Leftâ: 73
âVisual/Rightâ: 71>
epochs.plot()
<MNEBrowseFigure size 1040x741 with 4 Axes>
Selecting epochs based on experimental conditions
epochs['Auditory/Right']
<Epochs | 73 events (all good), -0.299693 - 0.499488 sec, baseline [-0.299693, 0] sec, ~104.0 MB, data loaded,
âAuditory/Rightâ: 73>
epochs['Auditory']
<Epochs | 145 events (all good), -0.299693 - 0.499488 sec, baseline [-0.299693, 0] sec, ~203.4 MB, data loaded,
âAuditory/Leftâ: 72
âAuditory/Rightâ: 73>
epochs['Left']
<Epochs | 145 events (all good), -0.299693 - 0.499488 sec, baseline [-0.299693, 0] sec, ~203.4 MB, data loaded,
âAuditory/Leftâ: 72
âVisual/Leftâ: 73>
epochs['Visual'].plot_image()
Not setting metadata
Not setting metadata
144 matching events found
No baseline correction applied
0 projection items activated
0 bad epochs dropped
Not setting metadata
Not setting metadata
144 matching events found
No baseline correction applied
0 projection items activated
0 bad epochs dropped
Not setting metadata
Not setting metadata
144 matching events found
No baseline correction applied
0 projection items activated
0 bad epochs dropped
combining channels using âgfpâ
combining channels using âgfpâ
combining channels using âgfpâ