Misalignment/coordinate mismatch in source reconstruction

Hello!

I’m a relative beginner with MNE in general and source rec in particular. I’m doing source reconstruction of EEG data using fsaverage as a template (as I don’t have MRI data for my actual subjects).

So, like, pretty basic, I load fsaverage data from MNE, read the source space and solution matrix from those files, and I read my (autorejected, epoched) EEG data with mne.read_epochs. And then I check the alignment:

fig = mne.viz.plot_alignment(epochs.info, trans="fsaverage", src=src, dig=True, surfaces=dict(brain=0.6, outer_skull=0.4, head=0.1))
mne.viz.set_3d_view(fig, azimuth=0, elevation=90)

And I see this:

As you can see, while the electrodes are located properly in relation to each other, it looks as though there’s some kind of coordinate mismatch, with the electrodes being located a lot lower than they should be.

Attempting to check I have the right montage with print(epochs.get_montage().dig) gives me [<DigPoint | LPA : (-95.0, 0.0, 0.0) mm : head frame>, <DigPoint | Nasion : (0.0, 95.0, 0.0) mm : head frame>, <DigPoint | RPA : (95.0, 0.0, 0.0) mm : head frame>, <DigPoint | EEG #1 : (-29.4, 90.4, 0.0) mm : head frame>, <DigPoint | EEG #2 : (-51.8, 63.9, 47.5) mm : head frame>, etc.which doesn’t strike me as strange or unexpected.

I am a bit more puzzled by the transform file itself, as mne.read_trans("C:/Users/aportier/mne_data/MNE-fsaverage-data/fsaverage/bem/fsaverage-trans.fif") gives me the following:

<Transform | head->MRI (surface RAS)>
[[ 0.9999938  -0.00355761 -0.00000057  0.00187336]
 [ 0.00355187  0.99838907 -0.05662654 -0.02879576]
 [ 0.00020204  0.05662593  0.99839538 -0.0412941 ]
 [ 0.          0.          0.          1.        ]]

But I’m not entirely sure I’m understanding that correctly.

Again, I’m essentially a beginner here, so stupid mistakes wouldn’t be out of character, but what I see is essentially: I used a standard, predefined template that MNE can deal with. While my montage has only 63 channels (one being taken up for a stimulation), it is otherwise a pretty standard montage, and indeed I’ve had no problems with things (like making topomaps, etc.) that required knowing the relative positions of the electrodes.

And yet, something has gone wrong — meaning, probably, that I made a mistake somewhere. Anyone knows where?

Thanks in advance for any help!

try setting the montage to fsaverage_1005. That should give you electrode positions that are co-registered with the fsaverage template.

Thanks a lot! It worked!