Skip to content

ENH: Add on_inside kwarg to make_forward_solution #13307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

larsoner
Copy link
Member

@larsoner larsoner commented Jul 3, 2025

Closes #13272

@wadelab can you try this? The comparison in results of the deformed and non-deformed surface would be especially useful. Really just the forward solution for any sensors that are inside the surface would be most useful.

In particular I'm worried that if a sensor is very close to a vertex on the scalp surface (like 0.01 mm or something) then the volume current contribution from that vertex will be far too high in the forward solution. Maybe you can try a few scenarios:

  1. With the surfaces as they are from the MRI with on_inside="warn" (a sensor or two end up inside the surface but okay)
  2. With the surfaces deformed / shrunk near that sensor such that the surface is > 5 mm away from the sensor (no need for any on_inside)
  3. With the surfaces deformed / shrunk near that sensor less such that one of the surface vertices is 0.001 mm away from the sensor (and probably on_inside="warn" again). This could be done for example by starting from the original best alignment, finding the MRI surface vertex closest to the sensor, and moving it to 0.001mm from the sensor location (keeping in mind coord frames etc).

I suspect (1) and (2) might be similar but that (3) will be a problem. In which case having the sensors inside might be okay but having them close to a surface vertex will not be and we should add an additional check that ensures that the sensors are also sufficiently far from any BEM mesh vertex and at least warns if they are not ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning option for sensors in neck in file: _make_forward.py
1 participant