Hi,
I’m currently developing a pre-processing pipeline for a memory study consisting of 57 datasets, each of which is ~1.5 GB. So far, I’ve been sticking to typical EEG pre-processing procedures: I’ve imported the raw data; set the EEG reference (in my case, to the ‘Fz’ electrode); down-sampled from 2048 to 256 Hz; applied low- and high-pass filtering at 30 and 0.1 Hz, respectively; imported event IDs; and created epochs. Up to this point in the pipeline, everything seems to be going swimmingly.
Following this minimal preprocessing, I also wish to perform artifact rejection by implementing Autoreject and ICA. I’ve read through numerous tutorials on the MNE and Autoreject websites, yet these seem to be laden with inconsistent suggestions for how to properly sequence these methods. Based on what I’ve taken away from the tutorials and examples, I’ve structured these additional steps in my pipeline as follows :
- First run of autoreject
- Apply ICA
- Second run of autoreject
Translating these steps into code (which I brought in from the examples) yields the following:
#First instance of Autoreject
ar = autoreject.AutoReject(n_interpolate=[1, 4, 32], random_state=42,
n_jobs=1, verbose=True)
ar.fit(epochs)
epochs_ar, reject_log = ar.transform(epochs, return_log=True)
#Apply ICA
ica = mne.preprocessing.ICA(random_state=99)
ica.fit(epochs[~reject_log.bad_epochs])
exclude = [0, # blinks
2 # saccades
]
ica.plot_components(exclude)
ica.exclude = exclude
#Second instance of Autoreject
ar = autoreject.AutoReject(n_interpolate=[1, 4, 32], random_state=42,
n_jobs=1, verbose=True)
ar.fit(epochs)
epochs_ar, reject_log = ar.transform(epochs, return_log=True)
Note that the epochs that were fed into the first instance of Autoreject were not baseline corrected, so as not to affect their subsequent processing when applying ICA. Hence, baseline correction was only applied before submitting the ICA-ed epochs to the second instance of Autoreject. Can someone please confirm/disconfirm whether these steps are appropriate?
EDIT: I’m working with the latest release of MNE (1.11.0) on a Window’s 10 system.
Best,
Jacob