Howdy!
I started doing BEM based forward & inverse computations with the mne example data, and noticed some cortical nodes where the data looked a bit funny. Here are the leadfield magnitudes for each cortical node and source orientation:
There seem to be couple of nodes where the magnitude is 5-10x larger than anywhere else. This doesn’t occur with the sphere model. My memory of BEM mechanics is a bit hazy, but probably you get inaccurate results if your sources are too close to the conductor boundaries, right? I would like to know what’s the root issue here. Should I manually exclude sources close to the conductor boundary after running setup_source_space()? Or is something wrong with my code?
MRE here:
import mne
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
data_path = Path(mne.datasets.sample.data_path())
raw_file = data_path / 'MEG/sample/sample_audvis_raw.fif'
info = mne.io.read_info(raw_file)
head_mri_trans_file = data_path / 'MEG/sample/sample_audvis_raw-trans.fif'
bem_file = data_path / 'subjects/sample/bem/sample-5120-5120-5120-bem-sol.fif'
subjects_dir = data_path / 'subjects'
subject = 'sample'
use_bem = str(bem_file)
# first create the source space
src_cort = mne.setup_source_space(
subject, spacing='oct6', subjects_dir=subjects_dir, add_dist=False
)
# compute the forwards
fwd_cort = mne.make_forward_solution(
info, head_mri_trans_file, src_cort, use_bem, eeg=False
)
# plot leadfield magnitudes
plt.plot(np.linalg.norm(fwd_cort['sol']['data'], axis=0))