Hemispheric data in forward solution?

Do the forward solutions computed from mne.make_forward_solution return information about which hemisphere the data lies in? One of the utility functions I’m using looks to differentiate the number of vertices per hemisphere in the following way:

n_lhverts = len(fwd['src'][0]['vertno'])
n_rhverts = len(fwd['src'][1]['vertno'])

but fwd['src'][1] does not exist. So I’m wondering how else I might determine which source points belong to each hemisphere?

  • MNE version: 1.0.3
  • operating system: macOS Monterey 12.3.1
1 Like

Hello @jadrew43,

how did you create that forward model?

With our sample data, everything works as you would expect:

# %%
import mne

sample_dir = mne.datasets.sample.data_path()
fwd_fname = sample_dir / 'MEG' / 'sample' / 'sample_audvis-eeg-oct-6-fwd.fif'

fwd = mne.read_forward_solution(fwd_fname)

1 Like

Ah apologies, I didn’t realize that forward model was part of the sample data, for some reason my search in Finder does not show that file when searching fwd.fif.

I used fwd = mne.make_forward_solution(raw.info, trans=None, src=src, bem=sphere) to make the solution myself.

Reading the file instead of computing it works as expected, thank you!

Oh, no no no, don’t use this one unless you’re actually working with our sample dataset! :sweat_smile: if you’re using your own data, you must create the forward model from scratch.

How did you generate src?

I am using the sample dataset!

fwd = mne.read_forward_solution(fwd_fname)
src = fwd['src']

If I want to use data from all MEG/EEG sensors would I use sample_audvis_meg-eeg-oct-6-fwd.fif?

I would guess so, yes!

1 Like