# Source Localisation Problem for EEG, not MEG

**URL:** <https://mne.discourse.group/t/source-localisation-problem-for-eeg-not-meg/8319>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization, eeg, visualization\
**Created:** [February 13, 2024, 2:52pm UTC](https://mne.discourse.group/t/source-localisation-problem-for-eeg-not-meg/8319 "2024-02-13T14:52:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ismail\_Huseynov](https://avatars.discourse-cdn.com/v4/letter/i/a183cd/32.png) [@Ismail\_Huseynov](https://mne.discourse.group/u/Ismail_Huseynov)\
**Post date:** [February 13, 2024, 2:52pm UTC](https://mne.discourse.group/t/source-localisation-problem-for-eeg-not-meg/8319/1 "2024-02-13T14:52:18Z")

</div>

Hi dear researchers! I am an initial stage for the source localisation problem for the EEG. I need your kind guidance in the following direction:

I would like to select a single source with a given location, amplitude and orientation on a standard head model. Afterward, I aim to calculate the lead field matrix of this source and visualize it as a topomap in the sensor space. Then, I would like to investigate how the lead field matrix changes when we modify the location or orientation of the source. I have come across some helpful code snippets for MEG frameworks involving multiple sources, with the assistance of specific codes. However, I wish to undertake this process for EEG modelling from scratch: starting within one source on the standard head model.

Could you please share any useful resources/ideas/code snippets pertaining to this? I am eagerly looking forward to hearing from you soon. Many thanks for your valuable insights in this matter.

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [February 13, 2024, 3:46pm UTC](https://mne.discourse.group/t/source-localisation-problem-for-eeg-not-meg/8319/2 "2024-02-13T15:46:25Z")

</div>

I don’t fully understand what you want to do, possibly because of some terminology confusion? Maybe this will help:

The leadfield matrix (also called “forward model”) gives the relationship between activity at _source vertices_ (on the cortical surface) or _voxels_ (in a brain volume) and electrodes/sensors. To get this matrix, you need to know both the locations of all your sensors/electrodes _and_ the locations of the source space vertices.

In your question, you seem to want to start with an EEG electrode (you mention C4), and end up with values for all EEG electrodes (a topomap). It’s not clear (to me at least) how you would do that / what it would tell you. On the other hand, it is a common practice to start with a single source _vertex_ or _voxel_ and see how activity at that source would manifest on the sensors — it’s basically just extraction of one row of the leadfield matrix — and a topomap would be a sensible way to visualize that. So maybe that’s what you meant? Please clarify, and then we can try to give more concrete guidance.

---

<div class="post-metadata">

**Author:** ![Ismail\_Huseynov](https://avatars.discourse-cdn.com/v4/letter/i/a183cd/32.png) [@Ismail\_Huseynov](https://mne.discourse.group/u/Ismail_Huseynov)\
**Post date:** [February 13, 2024, 4:23pm UTC](https://mne.discourse.group/t/source-localisation-problem-for-eeg-not-meg/8319/3 "2024-02-13T16:23:43Z")

</div>

Dear Dan (@drammock),

Thank you for your response. I apologize for the misunderstanding. I corrected my mistake and updated my post. I would like to proceed with the following initial stages:

- Place a source with a certain amplitude (i.e., xx nAm) and location (i.e., 2 cm below the EEG electrode/sensor C4) in a standard head model, with a current orientation pointing towards C4.
- Calculate the lead field for these sources and plot it as a topographic map in the sensor space.
- Investigate how the lead field changes when we modify the location or orientation of the source.

---

<div class="post-metadata">

**Author:** ![Ismail\_Huseynov](https://avatars.discourse-cdn.com/v4/letter/i/a183cd/32.png) [@Ismail\_Huseynov](https://mne.discourse.group/u/Ismail_Huseynov)\
**Post date:** [February 23, 2024, 4:56pm UTC](https://mne.discourse.group/t/source-localisation-problem-for-eeg-not-meg/8319/4 "2024-02-23T16:56:09Z")

</div>

Dear Dan (@drammock), could you please consider these questions? Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [February 23, 2024, 5:42pm UTC](https://mne.discourse.group/t/source-localisation-problem-for-eeg-not-meg/8319/5 "2024-02-23T17:42:56Z")

</div>

I published a dipole simulator a while back. Unfortunately I believe it’s broken these days.

> **[GitHub - mne-tools/dipole-simulator: Interactive demonstration of how dipole...](https://github.com/mne-tools/dipole-simulator)**
>
> Interactive demonstration of how dipole location and orientation affect MEG and EEG sensor signals - mne-tools/dipole-simulator

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/2/2b9c09e23bcb1ff4362eb2f360ac5e1fd6a0b55a.png)

---

<div class="post-metadata">

**Author:** ![Ismail\_Huseynov](https://avatars.discourse-cdn.com/v4/letter/i/a183cd/32.png) [@Ismail\_Huseynov](https://mne.discourse.group/u/Ismail_Huseynov)\
**Post date:** [March 1, 2024, 5:56pm UTC](https://mne.discourse.group/t/source-localisation-problem-for-eeg-not-meg/8319/6 "2024-03-01T17:56:13Z")

</div>

Dear Richard, thank you for your kind help!
