非官方中文翻译 本页译自 MNE-Python 官方文档: 查看英文原文 ↗。 文档版权归 MNE Developers 所有(BSD-3-Clause)。

重映射 MEG 通道类型#

本示例把 MEG 数据从一种通道类型重映射为另一种,适用于:

  • 把磁强计与梯度计合并后以磁强计或梯度计的形式可视化。

  • 在只使用一种通道类型的情况下,对磁强计与梯度计的数据做统计。

# Author: Mainak Jas <mainak.jas@telecom-paristech.fr>

# License: BSD-3-Clause
# Copyright the MNE-Python contributors.
import mne
from mne.datasets import sample

print(__doc__)

# read the evoked
data_path = sample.data_path()
meg_path = data_path / "MEG" / "sample"
fname = meg_path / "sample_audvis-ave.fif"
evoked = mne.read_evokeds(fname, condition="Left Auditory", baseline=(None, 0))
Reading /home/circleci/mne_data/MNE-sample-data/MEG/sample/sample_audvis-ave.fif ...
    Read a total of 4 projection items:
        PCA-v1 (1 x 102) active
        PCA-v2 (1 x 102) active
        PCA-v3 (1 x 102) active
        Average EEG reference (1 x 60) active
    Found the data of interest:
        t =    -199.80 ...     499.49 ms (Left Auditory)
        0 CTF compensation matrices available
        nave = 55 - aspect type = 100
Projections have already been applied. Setting proj attribute to True.
Applying baseline correction (mode: mean)

首先把梯度计重映射为磁强计,并绘制磁强计的原始与重映射地形图。

# go from grad + mag to mag and plot original mag
virt_evoked = evoked.as_type("mag")
fig = evoked.plot_topomap(ch_type="mag")
fig.suptitle("mag (original)")
mag (original), -0.200 s, 0.033 s, 0.266 s, 0.499 s, fT
Computing dot products for 305 MEG channels...
Computing cross products for 305 → 102 MEG channels...
Preparing the mapping matrix...
Truncating at 80/305 components to omit less than 0.0001 (9.4e-05)
# plot interpolated grad + mag
fig = virt_evoked.plot_topomap(ch_type="mag")
fig.suptitle("mag (interpolated from mag + grad)")
mag (interpolated from mag + grad), -0.200 s, 0.033 s, 0.266 s, 0.499 s, fT

然后把磁强计重映射为梯度计,并绘制梯度计的原始与重映射地形图

# go from grad + mag to grad and plot original grad
virt_evoked = evoked.as_type("grad")
fig = evoked.plot_topomap(ch_type="grad")
fig.suptitle("grad (original)")
grad (original), -0.200 s, 0.033 s, 0.266 s, 0.499 s, fT/cm
Computing dot products for 305 MEG channels...
Computing cross products for 305 → 203 MEG channels...
Preparing the mapping matrix...
Truncating at 80/305 components to omit less than 0.0001 (9.4e-05)
# plot interpolated grad + mag
fig = virt_evoked.plot_topomap(ch_type="grad")
fig.suptitle("grad (interpolated from mag + grad)")
grad (interpolated from mag + grad), -0.200 s, 0.033 s, 0.266 s, 0.499 s, fT/cm

脚本总运行时间:(0 分 3.907 秒)

图库由 Sphinx-Gallery 生成