当前位置: 首页>>代码示例>>Python>>正文


Python ICA.info方法代码示例

本文整理汇总了Python中mne.preprocessing.ICA.info方法的典型用法代码示例。如果您正苦于以下问题:Python ICA.info方法的具体用法?Python ICA.info怎么用?Python ICA.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mne.preprocessing.ICA的用法示例。


在下文中一共展示了ICA.info方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_plot_ica_topomap

# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import info [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)
开发者ID:emanuele,项目名称:mne-python,代码行数:12,代码来源:test_viz.py

示例2: test_plot_ica_components

# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import info [as 别名]
def test_plot_ica_components():
    """Test plotting of ICA solutions."""
    import matplotlib.pyplot as plt
    res = 8
    fast_test = {"res": res, "contours": 0, "sensors": False}
    raw = _get_raw()
    ica = ICA(noise_cov=read_cov(cov_fname), n_components=2,
              max_pca_components=3, n_pca_components=3)
    ica_picks = _get_picks(raw)
    with warnings.catch_warnings(record=True):
        ica.fit(raw, picks=ica_picks)
    warnings.simplefilter('always', UserWarning)
    with warnings.catch_warnings(record=True):
        for components in [0, [0], [0, 1], [0, 1] * 2, None]:
            ica.plot_components(components, image_interp='bilinear',
                                colorbar=True, **fast_test)
        plt.close('all')

        # test interactive mode (passing 'inst' arg)
        ica.plot_components([0, 1], image_interp='bilinear', inst=raw, res=16)
        fig = plt.gcf()

        # test title click
        # ----------------
        lbl = fig.axes[1].get_label()
        ica_idx = int(lbl[-3:])
        titles = [ax.title for ax in fig.axes]
        title_pos_midpoint = (titles[1].get_window_extent().extents
                              .reshape((2, 2)).mean(axis=0))
        # first click adds to exclude
        _fake_click(fig, fig.axes[1], title_pos_midpoint, xform='pix')
        assert ica_idx in ica.exclude
        # clicking again removes from exclude
        _fake_click(fig, fig.axes[1], title_pos_midpoint, xform='pix')
        assert ica_idx not in ica.exclude

        # test topo click
        # ---------------
        _fake_click(fig, fig.axes[1], (0., 0.), xform='data')

        c_fig = plt.gcf()
        labels = [ax.get_label() for ax in c_fig.axes]

        for l in ['topomap', 'image', 'erp', 'spectrum', 'variance']:
            assert_true(l in labels)

        topomap_ax = c_fig.axes[labels.index('topomap')]
        title = topomap_ax.get_title()
        assert_true(lbl == title)

    ica.info = None
    assert_raises(ValueError, ica.plot_components, 1)
    assert_raises(RuntimeError, ica.plot_components, 1, ch_type='mag')
    plt.close('all')
开发者ID:claire-braboszcz,项目名称:mne-python,代码行数:56,代码来源:test_ica.py

示例3: test_plot_ica_topomap

# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import info [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')
开发者ID:dichaelen,项目名称:mne-python,代码行数:16,代码来源:test_viz.py

示例4: test_plot_ica_topomap

# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import info [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")
开发者ID:rgoj,项目名称:mne-python,代码行数:16,代码来源:test_viz.py

示例5: test_plot_ica_components

# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import info [as 别名]
def test_plot_ica_components():
    """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 = _get_picks(raw)
    ica.fit(raw, picks=ica_picks)
    warnings.simplefilter('always', UserWarning)
    with warnings.catch_warnings(record=True):
        for components in [0, [0], [0, 1], [0, 1] * 2, None]:
            ica.plot_components(components, image_interp='bilinear', res=16)
    ica.info = None
    assert_raises(RuntimeError, ica.plot_components, 1)
    plt.close('all')
开发者ID:BushraR,项目名称:mne-python,代码行数:17,代码来源:test_ica.py

示例6: test_plot_ica_components

# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import info [as 别名]
def test_plot_ica_components():
    """Test plotting of ICA solutions."""
    import matplotlib.pyplot as plt
    res = 8
    fast_test = {"res": res, "contours": 0, "sensors": False}
    raw = _get_raw()
    ica = ICA(noise_cov=read_cov(cov_fname), n_components=2,
              max_pca_components=3, n_pca_components=3)
    ica_picks = _get_picks(raw)
    with warnings.catch_warnings(record=True):
        ica.fit(raw, picks=ica_picks)
    warnings.simplefilter('always', UserWarning)
    with warnings.catch_warnings(record=True):
        for components in [0, [0], [0, 1], [0, 1] * 2, None]:
            ica.plot_components(components, image_interp='bilinear',
                                colorbar=True, **fast_test)

        # test interactive mode (passing 'inst' arg)
        plt.close('all')
        ica.plot_components([0, 1], image_interp='bilinear', inst=raw, res=16)

        fig = plt.gcf()
        ax = [a for a in fig.get_children() if isinstance(a, plt.Axes)]
        lbl = ax[1].get_label()
        _fake_click(fig, ax[1], (0., 0.), xform='data')

        c_fig = plt.gcf()
        ax = [a for a in c_fig.get_children() if isinstance(a, plt.Axes)]
        labels = [a.get_label() for a in ax]

        for l in ['topomap', 'image', 'erp', 'spectrum', 'variance']:
            assert_true(l in labels)

        topomap_ax = ax[labels.index('topomap')]
        title = topomap_ax.get_title()
        assert_true(lbl == title)

    ica.info = None
    assert_raises(ValueError, ica.plot_components, 1)
    assert_raises(RuntimeError, ica.plot_components, 1, ch_type='mag')
    plt.close('all')
开发者ID:HSMin,项目名称:mne-python,代码行数:43,代码来源:test_ica.py

示例7: test_plot_ica_components

# 需要导入模块: from mne.preprocessing import ICA [as 别名]
# 或者: from mne.preprocessing.ICA import info [as 别名]
def test_plot_ica_components():
    """Test plotting of ICA solutions."""
    import matplotlib.pyplot as plt

    raw = _get_raw()
    ica = ICA(noise_cov=read_cov(cov_fname), n_components=2, max_pca_components=3, n_pca_components=3)
    ica_picks = _get_picks(raw)
    with warnings.catch_warnings(record=True):
        ica.fit(raw, picks=ica_picks)
    warnings.simplefilter("always", UserWarning)
    with warnings.catch_warnings(record=True):
        for components in [0, [0], [0, 1], [0, 1] * 2, None]:
            ica.plot_components(components, image_interp="bilinear", res=16, colorbar=True)

        # test interactive mode (passing 'inst' arg)
        plt.close("all")
        ica.plot_components([0, 1], image_interp="bilinear", res=16, inst=raw)

        fig = plt.gcf()
        ax = [a for a in fig.get_children() if isinstance(a, plt.Axes)]
        lbl = ax[1].get_label()
        _fake_click(fig, ax[1], (0.0, 0.0), xform="data")

        c_fig = plt.gcf()
        ax = [a for a in c_fig.get_children() if isinstance(a, plt.Axes)]
        labels = [a.get_label() for a in ax]

        for l in ["topomap", "image", "erp", "spectrum", "variance"]:
            assert_true(l in labels)

        topomap_ax = ax[labels.index("topomap")]
        title = topomap_ax.get_title()
        assert_true(lbl == title)

    ica.info = None
    assert_raises(ValueError, ica.plot_components, 1)
    assert_raises(RuntimeError, ica.plot_components, 1, ch_type="mag")
    plt.close("all")
开发者ID:nwilming,项目名称:mne-python,代码行数:40,代码来源:test_ica.py


注:本文中的mne.preprocessing.ICA.info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。