# Artifact rejection on select channels

**URL:** <https://mne.discourse.group/t/artifact-rejection-on-select-channels/1179>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 1, 2017, 1:40pm UTC](https://mne.discourse.group/t/artifact-rejection-on-select-channels/1179 "2017-03-01T13:40:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 1, 2017, 1:40pm UTC](https://mne.discourse.group/t/artifact-rejection-on-select-channels/1179/1 "2017-03-01T13:40:02Z")

</div>

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](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170301/7cb560b6/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 1, 2017, 5:41pm UTC](https://mne.discourse.group/t/artifact-rejection-on-select-channels/1179/2 "2017-03-01T17:41:40Z")

</div>

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
