# Bipolar EEG and Epochs rejection

**URL:** <https://mne.discourse.group/t/bipolar-eeg-and-epochs-rejection/2115>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 18, 2020, 3:53pm UTC](https://mne.discourse.group/t/bipolar-eeg-and-epochs-rejection/2115 "2020-03-18T15:53:37Z")\
**Posts on this page:** 5\
**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 18, 2020, 3:53pm UTC](https://mne.discourse.group/t/bipolar-eeg-and-epochs-rejection/2115/1 "2020-03-18T15:53:37Z")

</div>

External Email - Use Caution

Goodmorning,

I am new to python and MNE.

I am trying to replicate a brain vision analyzer pre-processing in MNE. In this pre-processing authors rejected epochs in which horizontal EOG exceeded 30 mV and/or vertical EOG exceeded 60 mV. I'm trying to achieve this result using the command mne.Epochs. However, in the reject dictionary I don't know how to specify this "double condition".

Ideally I would to write somenthing like that:

reject = dict(eeg = 160e-6, ["VEOG"] = 120e-6, ["HEOG"] = 30e-6)

epochs = mne.Epochs(raw, events=events[0], event\_id=[71, 72], tmin=-0.1, tmax=0.6, proj=True, baseline=(-0.1,0), reject=reject, preload=True)

However in reject dictionary, if I understood correctly, I can only use one key 'eog'.

Thank you very much for your help,  
Any advice will be usefull,  
Bests,  
Pietro  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200318/30f0be10/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200318/30f0be10/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 18, 2020, 7:11pm UTC](https://mne.discourse.group/t/bipolar-eeg-and-epochs-rejection/2115/2 "2020-03-18T19:11:54Z")

</div>

I don't think there's a way to do this via the Epochs constructor. There  
are two questions I have:

(1) Did BVA use? peak-to-peak and or absolute threshold? I'm guessing  
absolute (see next question), but the Epochs constructor uses peak-to-peak.

(2) Did you mean mV (1e-3) or ?V (1e-6)? You use mV in your text, but  
the scaling in your example is ?V.

If you want absolute thresholds and not peak-to-peak, checkout  
philistine.abs\_threshold. Assuming you want mV

[https://philistine.readthedocs.io/en/latest/api/philistine.mne.abs\_threshold.html](https://philistine.readthedocs.io/en/latest/api/philistine.mne.abs_threshold.html)

epochs = ....

hmask = abs\_threshold(epochs.copy().pick("HEOG"), 30e-3, eog=True)

vmask = abs\_threshold(epochs.copy().pick("VEOG"), 120e-3, eog=True)

eye\_mask = np.logical\_or(hmask, vmask)

epochs.drop(eye\_mask, reason="EOG")

(note that I'm the author of philistine)

Best,

Phillip

> ???External Email - Use Caution???
> 
> Goodmorning,
> 
> I am new to python and MNE.
> 
> I am trying to replicate a brain vision analyzer pre-processing in  
> MNE. In this pre-processing authors rejected epochs in which  
> horizontal EOG exceeded 30 mV and/or vertical EOG exceeded 60 mV. I'm  
> trying to achieve this result using the command mne.Epochs. However,  
> in the reject dictionary I don't know how to specify this "double  
> condition".
> 
> Ideally I would to write somenthing like that:
> 
> reject = dict(eeg = 160e-6, ["VEOG"] = 120e-6, ["HEOG"] = 30e-6)
> 
> epochs = mne.Epochs(raw, events=events[0], event\_id=[71, 72],  
> tmin=-0.1, tmax=0.6, proj=True, baseline=(-0.1,0), reject=reject,  
> preload=True)
> 
> However in reject dictionary, if I understood correctly, I can only  
> use one key 'eog'.
> 
> Thank you very much for your help,  
> Any advice will be usefull,  
> Bests,  
> Pietro
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200318/28a310ce/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200318/28a310ce/attachment.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: signature.asc  
Type: application/pgp-signature  
Size: 488 bytes  
Desc: OpenPGP digital signature  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200318/28a310ce/attachment.bin](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200318/28a310ce/attachment.bin)  
-------------- next part --------------  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20200318/28a310ce/attachment-0001.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200318/28a310ce/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:** [March 19, 2020, 12:21am UTC](https://mne.discourse.group/t/bipolar-eeg-and-epochs-rejection/2115/3 "2020-03-19T00:21:32Z")

</div>

External Email - Use Caution

I think this might be possible, if you change one of them (say, the HEOG) to type 'misc', then you could use separate reject criteria for EOG and MISC channel types. Only works if you don't have other MISC channels already, of course. Example: [https://gist.github.com/drammock/475d6a0aef16468d2013f145d7dd0151](https://gist.github.com/drammock/475d6a0aef16468d2013f145d7dd0151)

-- dan  
Daniel McCloy  
[https://dan.mccloy.info](https://dan.mccloy.info)  
Research Scientist  
Institute for Learning and Brain Sciences  
University of Washington

??? Original Message ???

---

<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 19, 2020, 12:31pm UTC](https://mne.discourse.group/t/bipolar-eeg-and-epochs-rejection/2115/4 "2020-03-19T12:31:09Z")

</div>

External Email - Use Caution

(putting the list back in CC)

Yes, all that should work, but two comments:

1. Those are rather strict thresholds you're using. Depends on other  
things in your data, but those are much stricter than the ones I'm used to.

2. You don't need to use copy for the eeg\_mask; you need it in the  
eog\_mask because of the pick() step.

Best,

Phillip

---

<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 20, 2020, 9:04am UTC](https://mne.discourse.group/t/bipolar-eeg-and-epochs-rejection/2115/5 "2020-03-20T09:04:57Z")

</div>

External Email - Use Caution

Thank you for you reply!
