Artifact rejection on select channels

Hi,

I want to run artifact rejection on a specific subset of channels without
modifying my epoch object otherwise (i.e. the other channels).

Thanks,

*Ghislain d'Entremont*
BSc, Neuroscience, Honors
Dalhousie University
tel: 902-802-5671 (text)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170301/7cb560b6/attachment.html

Hi Ghislaine,

You can select the subset of channels using pick_channels and use it for
artifact rejection. In the end, you could combine the data in the modified
channels and the original channels by concatenating them in numpy and by
using EpochsArray. It will require a few lines of python code. Something
along the lines of:

epochs_subset = epochs.copy().pick_channels(...)
# run artifact rejection
X_clean = epochs_subset.get_data()
X_rest = epochs.pick_channels(...).get_data() # pick the rest of the

channels

epochs = EpochsArray(np.concatenate((X_clean, X_rest), axis=0),

epochs.info)

I'm sure it doesn't work out of the box, so you may have to change the
code. Don't hesitate to let us know if you get stuck at any point.

Mainak