基于模板MRI的MNE体积源估计

2024-05-09 10:18:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我想使用^{}库提供的模板MRI进行体积源估计。我所拥有的只是脑电图数据,它是用standard_1020蒙太奇进行采样的

通过参考以下文件,我成功地用模板MRI绘制了源估算图:

但是,像这样的数字不是我想要的: enter image description here

我想要一个这样的数字: enter image description here

我检查了这些文档,通过调整来自EEG forward operator with a template MRI的解决方案来获得解决方案,但发现我首先必须获得volume source estimate,而不是source estimate

我还检查了The typical M/EEG workflow,了解了工作流的一般概念

我想如果我不能使用模板MRI,我想我可以使用来自MNE的样本数据集,但我不知道从哪里开始。我读了又读,但是找不到任何提示

以下是我发现的与我的问题相关的文件:

涉及量源估算的MNE文件

示例库

教程


Tags: 文件数据in模板sourcewithspaceoperator
1条回答
网友
1楼 · 发布于 2024-05-09 10:18:45

我想出来了。但是把东西拼凑在一起是很痛苦的

# %% Importing libraries
import os.path as op

import mne
from mne.datasets import fetch_fsaverage
from mne.minimum_norm import apply_inverse

####################################
## data manipulation part omitted ##
####################################

# %% Template MRI
fs_dir = fetch_fsaverage(verbose=True)
subjects_dir = op.dirname(fs_dir)

# Trans, and BEM
subject = 'fsaverage'
trans = 'fsaverage'
bem = op.join(fs_dir, 'bem', 'fsaverage-5120-5120-5120-bem-sol.fif')
mri = op.join(fs_dir, 'mri', 'T1.mgz')

# %% Setup volumn source space (This is the part how to create volSourceEstimate)
vol_src = mne.setup_volume_source_space(
    subject, mri=mri, pos=10.0, bem=bem,
    subjects_dir=subjects_dir,
    add_interpolator=True,
    verbose=True)

# %% Forward solution
fwd = mne.make_forward_solution(raw.info, trans=trans, src=vol_src,
                                bem=bem, eeg=True, meg=False, mindist=5.0, n_jobs=1)

# %% Inverse operator
info = evoked.info
inv = mne.minimum_norm.make_inverse_operator(info, fwd, noise_cov,
                                                          loose=1, depth=0.8)
# %% Source space
snr = 3.0
lambda2 = 1.0 / snr ** 2
method = "dSPM"
stc = apply_inverse(evoked, inv, lambda2, method)
stc.crop(0.0, 0.2)

stc.plot(vol_src, subject='fsaverage', subjects_dir=subjects_dir)

相关问题 更多 >