本文整理汇总了Python中mne.make_field_map函数的典型用法代码示例。如果您正苦于以下问题:Python make_field_map函数的具体用法?Python make_field_map怎么用?Python make_field_map使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了make_field_map函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_plot_evoked_field
def test_plot_evoked_field():
"""Test plotting evoked field."""
evoked = read_evokeds(evoked_fname, condition='Left Auditory',
baseline=(-0.2, 0.0))
evoked = pick_channels_evoked(evoked, evoked.ch_names[::10]) # speed
for t in ['meg', None]:
with pytest.warns(RuntimeWarning, match='projection'):
maps = make_field_map(evoked, trans_fname, subject='sample',
subjects_dir=subjects_dir, n_jobs=1,
ch_type=t)
evoked.plot_field(maps, time=0.1)
示例2: test_plot_evoked_field
def test_plot_evoked_field():
trans_fname = op.join(data_dir, 'MEG', 'sample',
'sample_audvis_raw-trans.fif')
evoked = io.read_evokeds(evoked_fname, condition='Left Auditory',
baseline=(-0.2, 0.0))
evoked = pick_channels_evoked(evoked, evoked.ch_names[::10]) # speed
for t in ['meg', None]:
maps = make_field_map(evoked, trans_fname=trans_fname,
subject='sample', subjects_dir=subjects_dir,
n_jobs=1, ch_type=t)
evoked.plot_field(maps, time=0.1)
示例3: test_plot_evoked_field
def test_plot_evoked_field():
"""Test plotting evoked field
"""
trans_fname = op.join(data_dir, "MEG", "sample", "sample_audvis_raw-trans.fif")
evoked = read_evokeds(evoked_fname, condition="Left Auditory", baseline=(-0.2, 0.0))
evoked = pick_channels_evoked(evoked, evoked.ch_names[::10]) # speed
for t in ["meg", None]:
maps = make_field_map(
evoked, trans_fname=trans_fname, subject="sample", subjects_dir=subjects_dir, n_jobs=1, ch_type=t
)
evoked.plot_field(maps, time=0.1)
示例4: test_plot_evoked_field
def test_plot_evoked_field():
"""Test plotting evoked field
"""
evoked = read_evokeds(evoked_fname, condition='Left Auditory',
baseline=(-0.2, 0.0))
evoked = pick_channels_evoked(evoked, evoked.ch_names[::10]) # speed
for t in ['meg', None]:
with warnings.catch_warnings(record=True): # bad proj
maps = make_field_map(evoked, trans_fname, subject='sample',
subjects_dir=subjects_dir, n_jobs=1,
ch_type=t)
evoked.plot_field(maps, time=0.1)
示例5: test_plot_evoked_field
def test_plot_evoked_field(backends_3d):
"""Test plotting evoked field."""
backend_name = get_3d_backend()
evoked = read_evokeds(evoked_fname, condition='Left Auditory',
baseline=(-0.2, 0.0))
evoked = pick_channels_evoked(evoked, evoked.ch_names[::10]) # speed
for t in ['meg', None]:
with pytest.warns(RuntimeWarning, match='projection'):
maps = make_field_map(evoked, trans_fname, subject='sample',
subjects_dir=subjects_dir, n_jobs=1,
ch_type=t)
fig = evoked.plot_field(maps, time=0.1)
if backend_name == 'mayavi':
import mayavi # noqa: F401 analysis:ignore
assert isinstance(fig, mayavi.core.scene.Scene)
示例6: BSD
This process can be computationally intensive.
"""
# Authors: Eric Larson <[email protected]>
# Denis A. Engemann <[email protected]>
# Alexandre Gramfort <[email protected]>
# License: BSD (3-clause)
print(__doc__)
from mne.datasets import sample
from mne import make_field_map, read_evokeds
data_path = sample.data_path()
subjects_dir = data_path + '/subjects'
evoked_fname = data_path + '/MEG/sample/sample_audvis-ave.fif'
trans_fname = data_path + '/MEG/sample/sample_audvis_raw-trans.fif'
# If trans_fname is set to None then only MEG estimates can be visualized
condition = 'Left Auditory'
evoked = read_evokeds(evoked_fname, condition=condition, baseline=(-0.2, 0.0))
# Compute the field maps to project MEG and EEG data to MEG helmet
# and scalp surface
maps = make_field_map(evoked, trans_fname=trans_fname, subject='sample',
subjects_dir=subjects_dir, n_jobs=1)
# explore several points in time
[evoked.plot_field(maps, time=time) for time in [0.09, .11]]
示例7: data
title = 'MNE sample data (condition : %s)'
evoked_l_aud.plot_topo(title=title % evoked_l_aud.comment)
colors = 'yellow', 'green', 'red', 'blue'
mne.viz.plot_evoked_topo(evoked, color=colors,
title=title % 'Left/Right Auditory/Visual')
###############################################################################
# Visualizing field lines in 3D
# -----------------------------
#
# We now compute the field maps to project MEG and EEG data to MEG helmet
# and scalp surface.
#
# To do this we'll need coregistration information. See
# :ref:`tut_forward` for more details.
#
# Here we just illustrate usage.
subjects_dir = data_path + '/subjects'
trans_fname = data_path + '/MEG/sample/sample_audvis_raw-trans.fif'
maps = mne.make_field_map(evoked_l_aud, trans=trans_fname, subject='sample',
subjects_dir=subjects_dir, n_jobs=1)
# explore several points in time
field_map = evoked_l_aud.plot_field(maps, time=.1)
###############################################################################
# .. note::
# If trans_fname is set to None then only MEG estimates can be visualized.
示例8:
plt.show()
# estimate noise covarariance
noise_cov = mne.compute_covariance(epochs, tmax=0, method='shrunk',
rank=None)
###############################################################################
# Visualize fields on MEG helmet
# The transformation here was aligned using the dig-montage. It's included in
# the spm_faces dataset and is named SPM_dig_montage.fif.
trans_fname = data_path + ('/MEG/spm/SPM_CTF_MEG_example_faces1_3D_'
'raw-trans.fif')
maps = mne.make_field_map(evoked[0], trans_fname, subject='spm',
subjects_dir=subjects_dir, n_jobs=1)
evoked[0].plot_field(maps, time=0.170)
###############################################################################
# Look at the whitened evoked daat
evoked[0].plot_white(noise_cov)
###############################################################################
# Compute forward model
src = data_path + '/subjects/spm/bem/spm-oct-6-src.fif'
bem = data_path + '/subjects/spm/bem/spm-5120-5120-5120-bem-sol.fif'
forward = mne.make_forward_solution(contrast.info, trans_fname, src, bem)
示例9: read_evoked
args = parser.parse_args()
##script for creating average field map
data_path = "/home/custine/MEG/data/krns_kr3/9367/s5/"
evoked_fname = data_path + "ave_projon/9367_s5_Noun_Place_All-ave.fif"
subjects_dir = "/mnt/file1/binder/KRNS/anatomies/surfaces/"
trans_fname = "/mnt/file1/binder/KRNS/anatomies/surfaces/9367/mri/T1-neuromag/sets/COR-custine-140827-120918.fif"
# If trans_fname is set to None then only MEG estimates can be visualized
condition = 1
evoked = read_evoked(evoked_fname, baseline=(-0.2, 0.0))
# Compute the field maps to project MEG and EEG data to MEG helmet
# and scalp surface
maps = make_field_map(evoked, trans_fname=trans_fname, subject="9367", subjects_dir=subjects_dir, n_jobs=1)
# explore several points in time
[evoked.plot_field(maps, time=time) for time in [0.09, 0.11]]
evoked.save(
"/home/custine/MEG/data/krns_kr3/9367/s5/results/fieldmaps/9367_s5_"
+ str(args.ave_name)
+ "_All-"
+ "-"
+ str(args.time1)
+ "-"
+ str(args.time2)
+ "-ave.fif"
)
# evoked.save(data_path + args.prefix+'-'+str(args.set)+'-'+str(args.time1)+'-'+str(args.time2)+'-ave.fif')
示例10:
# we plot only the ``left_auditory``, and then we plot them all in the same
# figure for comparison. Click on the individual plots to open them bigger.
left_auditory.plot_topo()
colors = 'yellow', 'green', 'red', 'blue'
mne.viz.plot_evoked_topo(evoked, color=colors)
###############################################################################
# Visualizing field lines in 3D
# -----------------------------
#
# We now compute the field maps to project MEG and EEG data to MEG helmet
# and scalp surface.
#
# To do this we'll need coregistration information. See
# :ref:`tut_forward` for more details.
#
# Here we just illustrate usage.
subjects_dir = data_path + '/subjects'
trans_fname = data_path + '/MEG/sample/sample_audvis_raw-trans.fif'
maps = mne.make_field_map(left_auditory, trans=trans_fname, subject='sample',
subjects_dir=subjects_dir, n_jobs=1)
# explore several points in time
field_map = left_auditory.plot_field(maps, time=.1)
###############################################################################
# .. note::
# If trans_fname is set to None then only MEG estimates can be visualized
示例11: print
from mne.datasets import sample
from mne import make_field_map, read_evokeds
print(__doc__)
data_path = sample.data_path()
subjects_dir = data_path + '/subjects'
evoked_fname = data_path + '/MEG/sample/sample_audvis-ave.fif'
trans_fname = data_path + '/MEG/sample/sample_audvis_raw-trans.fif'
# If trans_fname is set to None then only MEG estimates can be visualized
condition = 'Left Auditory'
evoked = read_evokeds(evoked_fname, condition=condition, baseline=(-0.2, 0.0))
# Compute the field maps to project MEG and EEG data to MEG helmet
# and scalp surface
maps = make_field_map(evoked, trans_fname, subject='sample',
subjects_dir=subjects_dir, n_jobs=1)
# Plot MEG and EEG fields in the helmet and scalp surface in the same figure.
evoked.plot_field(maps, time=0.11)
# Compute the MEG fields in the scalp surface
evoked.pick_types(meg=True, eeg=False)
maps_head = make_field_map(evoked, trans_fname, subject='sample',
subjects_dir=subjects_dir, n_jobs=1,
meg_surf='head')
# Plot MEG fields both in scalp surface and the helmet in the same figure.
evoked.plot_field([maps_head[0], maps[1]], time=0.11)