# SEEG/iEEG bipolar reference setup

**URL:** <https://mne.discourse.group/t/seeg-ieeg-bipolar-reference-setup/9315>\
**Category:** Support & Discussions\
**Tags:** preprocessing, eeg, ieeg-and-ecog\
**Created:** [September 13, 2024, 6:57am UTC](https://mne.discourse.group/t/seeg-ieeg-bipolar-reference-setup/9315 "2024-09-13T06:57:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![const](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@const](https://mne.discourse.group/u/const)\
**Post date:** [September 13, 2024, 6:57am UTC](https://mne.discourse.group/t/seeg-ieeg-bipolar-reference-setup/9315/1 "2024-09-13T06:57:43Z")

</div>

Dear all,

I have recently been dealing with SEEG preprocessing using MNE. I want to use bipolar reference ([mne.set\_bipolar\_reference — MNE 1.8.0 documentation](https://mne.tools/stable/generated/mne.set_bipolar_reference.html)), but I am not sure what exactly I should do.

I noticed that `set_bipolar_reference` needs two required parameters: `anode` and `cathode`. So, do I have to build the bipolar pairs manually?

Assume we have two electrodes: `A` & `OB`.  
contacts at `A`: `A1 A2 A3 A5 A6 A7 A8` (missing `A4`)  
contacts at `OB`: `OB1 OB2 OB3 OB4 OB5 OB6 OB9 OB10` (missing `OB7 OB8`).

1. How should I determine which contacts belong to anode/cathode? Is there any general principle?
2. I knew that in a normal case, the new channel would be like `A1-A2`, `A2-A3`. But for missing contacts like `A4`/`OB7 OB8` above, can we create the new channel `A3-A5`? How about `OB6-OB9`?

Thank you!  
Kun

---

<div class="post-metadata">

**Author:** ![wmvanvliet](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/wmvanvliet/32/100_2.png) [@wmvanvliet](https://mne.discourse.group/u/wmvanvliet)\
**Post date:** [September 13, 2024, 8:35am UTC](https://mne.discourse.group/t/seeg-ieeg-bipolar-reference-setup/9315/2 "2024-09-13T08:35:20Z")

</div>

That function was originally designed with EOG in mind, where we usually have a horizontal and vertical setup. I’m not familiar with SEEG, so perhaps this makes no sense, but you can give lists of channels to the function to create bipolar pairs. So, if we would want A1-A2, A2-A3, A3-A5, we can do:

```python
raw_ref = mne.set_bipolar_reference(
    raw,
    ["A1", "A2", "A3"],
    ["A2", "A3", "A5"],
    ch_name=["A1-A2", "A2-A3", "A3-A5"]
)

```

---

<div class="post-metadata">

**Author:** ![SBeumer](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@SBeumer](https://mne.discourse.group/u/SBeumer)\
**Post date:** [September 13, 2024, 9:46am UTC](https://mne.discourse.group/t/seeg-ieeg-bipolar-reference-setup/9315/3 "2024-09-13T09:46:39Z")

</div>

It is advisable to make the bipolar montages in one direction, so A1-A2, A2-A3, etc. However, this gives you the same information as the other way around A8 - A7, the signals will only be inverted.

In my work, I skip the cases with missing contacts, but that is because the missing electrodes are used for intracranial stimulation. It mainly depends on your application and what you want to do with the data.

---

<div class="post-metadata">

**Author:** ![const](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@const](https://mne.discourse.group/u/const)\
**Post date:** [September 13, 2024, 11:29am UTC](https://mne.discourse.group/t/seeg-ieeg-bipolar-reference-setup/9315/4 "2024-09-13T11:29:52Z")

</div>

@wmvanvliet @SBeumer thank you both! It’s really helpful.

---

<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:** [September 20, 2024, 11:30am UTC](https://mne.discourse.group/t/seeg-ieeg-bipolar-reference-setup/9315/5 "2024-09-20T11:30:10Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
