ENH: Add on_inside kwarg to make_forward_solution #13307
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
on_inside="warn"
(a sensor or two end up inside the surface but okay)on_inside
)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 ...