本文整理汇总了Python中mne.preprocessing.ICA.plot_topomap方法的典型用法代码示例。如果您正苦于以下问题:Python ICA.plot_topomap方法的具体用法?Python ICA.plot_topomap怎么用?Python ICA.plot_topomap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mne.preprocessing.ICA
的用法示例。
在下文中一共展示了ICA.plot_topomap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_plot_ica_topomap
# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import plot_topomap [as 别名]
def test_plot_ica_topomap():
"""Test plotting of ICA solutions
"""
ica = ICA(noise_cov=read_cov(cov_fname), n_components=2,
max_pca_components=3, n_pca_components=3)
ica.decompose_raw(raw, picks=ica_picks)
for components in [0, [0], [0, 1], [0, 1] * 7]:
ica.plot_topomap(components)
ica.info = None
assert_raises(RuntimeError, ica.plot_topomap, 1)
示例2: test_plot_ica_topomap
# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import plot_topomap [as 别名]
def test_plot_ica_topomap():
"""Test plotting of ICA solutions
"""
raw = _get_raw()
ica = ICA(noise_cov=read_cov(cov_fname), n_components=2,
max_pca_components=3, n_pca_components=3)
ica_picks = fiff.pick_types(raw.info, meg=True, eeg=False, stim=False,
ecg=False, eog=False, exclude='bads')
ica.decompose_raw(raw, picks=ica_picks)
for components in [0, [0], [0, 1], [0, 1] * 7]:
ica.plot_topomap(components)
ica.info = None
assert_raises(RuntimeError, ica.plot_topomap, 1)
plt.close('all')
示例3: test_plot_ica_topomap
# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import plot_topomap [as 别名]
def test_plot_ica_topomap():
"""Test plotting of ICA solutions
"""
raw = _get_raw()
ica = ICA(noise_cov=read_cov(cov_fname), n_components=2, max_pca_components=3, n_pca_components=3)
ica_picks = pick_types(raw.info, meg=True, eeg=False, stim=False, ecg=False, eog=False, exclude="bads")
ica.decompose_raw(raw, picks=ica_picks)
warnings.simplefilter("always", UserWarning)
with warnings.catch_warnings(record=True):
for components in [0, [0], [0, 1], [0, 1] * 7]:
ica.plot_topomap(components)
ica.info = None
assert_raises(RuntimeError, ica.plot_topomap, 1)
plt.close("all")
示例4: dict
# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import plot_topomap [as 别名]
tmin, tmax = -0.2, 0.6
baseline = None # no baseline as high-pass is applied
reject = dict(mag=1.5e-12)
epochs = mne.Epochs(raw, events, event_ids, tmin, tmax, picks=picks, baseline=baseline, preload=True, reject=reject)
# Fit ICA, find and remove major artifacts
ica = ICA(None, 50).decompose_epochs(epochs, decim=2)
for ch_name in ["MRT51-2908", "MLF14-2908"]: # ECG, EOG contaminated chs
scores = ica.find_sources_epochs(epochs, ch_name, "pearsonr")
ica.exclude += list(np.argsort(np.abs(scores))[-2:])
ica.plot_topomap(np.unique(ica.exclude)) # plot components found
# select ICA sources and reconstruct MEG signals, compute clean ERFs
epochs = ica.pick_sources_epochs(epochs)
evoked = [epochs[k].average() for k in event_ids]
contrast = evoked[1] - evoked[0]
evoked.append(contrast)
for e in evoked:
e.plot(ylim=dict(mag=[-400, 400]))
示例5: range
# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import plot_topomap [as 别名]
max_pca_components=100,
noise_cov=None)
ica.decompose_epochs(epochs)
eog_scores_1_normal = ica.find_sources_epochs(epochs, target="EOG001",
score_func="pearsonr")
eog_scores_2_normal = ica.find_sources_epochs(epochs, target="EOG003",
score_func="pearsonr")
# get maximum correlation index for EOG
eog_source_idx_1_normal = np.abs(eog_scores_1_normal).argmax()
eog_source_idx_2_normal = np.abs(eog_scores_2_normal).argmax()
source_idx = range(0, ica.n_components_)
ica.plot_topomap(source_idx, ch_type="mag")
# select ICA sources and reconstruct MEG signals, compute clean ERFs
# Add detected artefact sources to exclusion list
# We now add the eog artefacts to the ica.exclusion list
if eog_source_idx_1_normal == eog_source_idx_2_normal:
ica.exclude += [eog_source_idx_1_normal]
elif eog_source_idx_1_normal != eog_source_idx_2_normal:
ica.exclude += [eog_source_idx_1_normal, eog_source_idx_2_normal]
# remove ECG
ecg_ch_name = 'ECG002'
ecg_scores = ica.find_sources_epochs(epochs, target=ecg_ch_name,
score_func='pearsonr')