# Autoreject

**URL:** <https://mne.discourse.group/t/autoreject/1416>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [February 8, 2018, 1:48am UTC](https://mne.discourse.group/t/autoreject/1416 "2018-02-08T01:48:36Z")\
**Posts on this page:** 4\
**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:** [February 8, 2018, 1:48am UTC](https://mne.discourse.group/t/autoreject/1416/1 "2018-02-08T01:48:36Z")

</div>

Hi,

I'm starting to investigate using autoreject and so far it looks quite  
promising. One thing I'm running into is using ICA and EOG/ECG projectors.

In the paper it is suggested to "first run autoreject only for detection of  
bad channels but without interpolation" then exclude those channels from  
ssp, ica or sss computations.

This seems like a sensible approach but from a practical stand point how is  
that done. Should I estimate the model first  
using

ar.fit(epochs)

and then look at ar.bad\_segments to exclude any channel that is ever bad?  
Would it be better to do this on the epochs created using the EOG/ECG  
events as part of SSP determination?

I assume a similar iterative approach would be recommended for dealing with  
motion correction?

Thanks  
Luke  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20180208/9ecf10d6/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180208/9ecf10d6/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:** [February 8, 2018, 1:34pm UTC](https://mne.discourse.group/t/autoreject/1416/2 "2018-02-08T13:34:50Z")

</div>

Hi Luke,

You can supply the reject dictionary to ICA in mne-python after estimating  
it using autoreject. Something like:

> > > from autoreject import get\_rejection\_threshold\>\>\> reject = get\_rejection\_threshold(epochs)\>\>\> ica.fit(epochs, picks=picks, reject=reject)

I?m not sure if it would help a lot though. It depends on your data.

As for running autoreject without interpolation, you can use  
LocalAutoreject(n\_interpolate=0,  
...) so that it does not interpolate. Set n\_consensus to something  
reasonable like 0.8.

In terms of SSS, maybe look into Eric?s new method, oversampled temporal  
projection \<[Reducing Sensor Noise in MEG and EEG Recordings Using Oversampled Temporal Projection | IEEE Journals & Magazine | IEEE Xplore](http://ieeexplore.ieee.org/document/7997929/&gt;%5C). It?s available  
in the dev version of mne-python.

Mainak

Hi,

> I'm starting to investigate using autoreject and so far it looks quite  
> promising. One thing I'm running into is using ICA and EOG/ECG projectors.
> 
> In the paper it is suggested to "first run autoreject only for detection  
> of bad channels but without interpolation" then exclude those channels from  
> ssp, ica or sss computations.
> 
> This seems like a sensible approach but from a practical stand point how  
> is that done. Should I estimate the model first  
> using
> 
> ar.fit(epochs)
> 
> and then look at ar.bad\_segments to exclude any channel that is ever bad?  
> Would it be better to do this on the epochs created using the EOG/ECG  
> events as part of SSP determination?
> 
> I assume a similar iterative approach would be recommended for dealing  
> with motion correction?
> 
> Thanks  
> Luke

?  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20180208/c1f4da8c/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180208/c1f4da8c/attachment-0001.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:** [February 8, 2018, 3:34pm UTC](https://mne.discourse.group/t/autoreject/1416/3 "2018-02-08T15:34:30Z")

</div>

> I assume a similar iterative approach would be recommended for dealing
> 
> > with motion correction?

Can you describe the sorts of artifacts you're dealing with in particular?  
maxwell\_filter can be used to compensate for movements. If you are seeing  
artifacts due to this compensation step, let me know -- it would be good to  
improve the method so that artifacts are reduced or eliminated, so I'd be  
interested to look at problematic files if you have some. Using tSSS with  
movement compensation can help sometimes.

Eric  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20180208/97aae6a6/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180208/97aae6a6/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:** [February 8, 2018, 3:59pm UTC](https://mne.discourse.group/t/autoreject/1416/4 "2018-02-08T15:59:30Z")

</div>

At the moment, I'm just repairing an automated pipeline that had been using  
FASTER, from mne-sandbox, to identify bad channels. Then SSP for  
eye-blinks/ecg etc. and a fixed reject dictionary, Since FASTER is no  
longer in mne-sandbox, I'm looking at using autoreject.

Once that is working I plan on looking at various motion correction  
techniques, at which time I will certainly be in touch.

-Luke
