mne-tools / mne-tools/mne-python

Extract scalp-projected sensor locations as DigMontage

Open
#13,188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ENH
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Describe the new feature or enhancement

When using mne.viz.plot_alignment (and in all forward modelling code), EEG sensors are projected onto the scalp, even if they are actually within, or outside of the skull.

See for example the dark red discs (scalp-projected sensors) versus the light red balls (actual sensor positions):

Image

This projection happens in this private function:

https://github.com/mne-tools/mne-python/blob/618932d7fbb6ef7e4d9f110c90a1cc77f51ab082/mne/surface.py#L447-L472

It would be a nice feature to be able to extract these scalp-projected sensor positions for downstream analyses, or for creating "realistic/biological' sensor positions ... or simply to have the data that is then actually being used in forward modelling.

I also believe that we could benefit from documenting more clearly that all forward modelling (including fit_dipoles etc.) is using the scalp-projected sensor positions.

Describe your proposed implementation

Write a public version of _project_onto_surface that works well with fsaverage out of the box, or any other scalp surface that is passed into it. The function should return a DigMontage.

Add this functionality to a tutorial/example to showcase it.

And also document better that these positions are used in forward modelling.

Describe possible alternatives

Alternatively, we could start by first only documenting that scalp-projected sensors are being used.

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the private _project_onto_surface implementation in mne/surface.py and the surrounding forward-modelling and plot_alignment code. Trace how sensor locations are represented as a DigMontage and identify the relevant tutorial or example entry points. Done means a public function can return scalp-projected locations, with an example and clearer documentation of their use in forward modelling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.