Hi everyone,
I am trying to understand how surface based field maps are implemented in MNE.
example code/script:
##########################
test codes with slight modification:
aim:
to plot surface based field topography # plot the maps for individual channel types and combination
#########################
import os.path as op
import mne
sample_path = mne.datasets.sample.data_path()
subjects_dir = op.join(sample_path, ‘subjects’)
fname_evoked = op.join(sample_path, ‘MEG’, ‘sample’, ‘sample_audvis-ave.fif’)
fname_inv = op.join(sample_path, ‘MEG’, ‘sample’,
‘sample_audvis-meg-oct-6-meg-inv.fif’)
fname_trans = op.join(sample_path, ‘MEG’, ‘sample’,
‘sample_audvis_raw-trans.fif’)
inv = mne.minimum_norm.read_inverse_operator(fname_inv)
evoked = mne.read_evokeds(fname_evoked, baseline=(None, 0),
proj=True, verbose=False, condition=‘Left Auditory’)
channels= [‘grad’, ‘mag’, ‘comb’]
for ch in channels:
if ch==‘comb’:
meg=True
else:
meg= ch
evk = evoked.copy().pick_types(eeg=False, meg=meg)
#evk.plot()
maps = mne.make_field_map(evk, trans=fname_trans, ch_type=‘meg’,meg_surf=‘head’,
subject=‘sample’, subjects_dir=subjects_dir)
time = 0.083
fig = mne.viz.create_3d_figure((256, 256))
mne.viz.plot_alignment(
evk.info, subject=‘sample’, subjects_dir=subjects_dir, fig=fig,
trans=fname_trans, meg=False, eeg=False, surfaces=‘white’,
coord_frame=‘mri’)
evk.plot_field(maps, time=time, fig=fig, time_label=None)
mne.viz.set_3d_view(fig, azimuth=40, elevation=87, focalpoint=(0., -0.01, 0.04), roll=-25,
distance=0.55)
Results:
scale: I have used vmax as absolute max() of the mapped data.
Questions:
-
Gradiometer topography looks quite symmetric to magnetometer, I am not sure if the coil definitions have been changed/transform to magnetometer to reconstruct these grad maps. I looked at the codes but I found only change has been done i.e., ch_def to head coordinates since its surface based mapping. Plus, I looked at the vmax value and its in e-12 range, is it in ft/cm for grad in this case?
-
When you do a combination of channels mapping, how do you combine the channel data without using the any conversion factor like, ft/cm to ft or similar? Can you provide me some info on it?
-
feature request: a global scaling/color range for multiple time points comparison. I am interested in looking at the surface based topography at different time points to understand the source pattern at the sensor level. A color normalization would help instead of looking the float values with different scale. I tried z-scoring normalization earlier but somehow the maps shows only positive pattern. (but honestly, I have to check again). Any other suggestions would be helpful.
best,
Dip