Dear all,
I have an issue that appear with 0.24 (my code was working with 0.23) with stc_near_sensor
.
Basically, for a sEEG analysis, I was importing my data in mri coord_frame, running my analysis and using stc_near_sensor
to prepare the plotting. All working well with 0.23.
montage = mne.channels.make_dig_montage(ch_pos, coord_frame='mri')
raw.set_montage(montage)
fig = mne.viz.plot_alignment(raw.info, trans=None, subject=subject,
subjects_dir=subjects_dir, show_axes=True,
surfaces=["pial"], coord_frame='mri')
...
stc = mne.stc_near_sensors(evoked_plot, None, subject, src=vol_src,
mode='nearest', subjects_dir=subjects_dir,
distance=0.02)
With 0.24, I now get the following issue when using stc_near_sensor
:
RuntimeError: Channels must be in the head coordinate frame, got [0 (FIFFV_COORD_UNKNOWN)]
I believe it appeared because of this change introduced by @larsoner in this PR.
From what I could understand, it is a desired feature that all the coord_frames are in the head space.
To adapt to this change, I tried to add a transform as in the sEEG tutorial:
lpa, nasion, rpa = mne.coreg.get_mni_fiducials(
patient, subjects_dir=subjects_dir)
lpa, nasion, rpa = lpa['r'], nasion['r'], rpa['r']
montage = mne.channels.make_dig_montage(ch_pos, coord_frame='mri', nasion=nasion, lpa=lpa, rpa=rpa)
trans = mne.channels.compute_native_head_t(montage)
raw.set_montage(montage)
fig = mne.viz.plot_alignment(raw.info, trans=trans, subject=subject,
subjects_dir=subjects_dir, show_axes=True,
surfaces=["pial"])
but raw.info['chs'][0]['coord_frame']
still gives me 0 (FIFFV_COORD_UNKNOWN)
, which will then results in an error in stc_near_sensors
.
So my questions:
- how to set the coordinate frame so that it is in the head space for sEEG data (somehow it works for the sEEG and ECoG tutorials, but I don’t quite get why (BTW, the sEEG electrodes are outside the brain in the sEEG tutorial, is this the desired output?))
- is it really not possible to leave it open to just use the mri coord_frame as before?
Thanks a lot for the help
Tim