Пример #1
0
def test_plot_topomap_mne():
    "Test plot.Topomap with MNE data"
    ds = datasets.get_mne_sample(sub=[0, 1], sns=True)
    p = plot.Topomap(ds['meg'].summary(time=(.1, .12)), proj='left')
    p.close()
    # grad
    ds = datasets.get_mne_sample(sub=[0], sns='grad')
    with pytest.raises(NotImplementedError), pytest.warns(RuntimeWarning):
        plot.Topomap('meg.sub(time=.1)', ds=ds)
Пример #2
0
def test_plot_topomap():
    "Test plot.Topomap"
    plot.configure_backend(False, False)
    ds = datasets.get_rand(utsnd=True)
    topo = ds.eval('utsnd.summary(time=(0.075, 0.125))')

    p = plot.Topomap(topo, ds=ds)
    p.close()
    p = plot.Topomap(topo, ds=ds, vmax=0.2, w=2)
    p.close()
    p = plot.Topomap(topo, 'A%B', ds=ds, axw=2)
    p.close()
Пример #3
0
def test_plot_topomap():
    "Test plot.Topomap"
    ds = datasets.get_uts(utsnd=True)
    topo = ds.eval('utsnd.summary(time=(0.075, 0.125))')

    p = plot.Topomap(topo, ds=ds, show=False)
    p.close()
    p = plot.Topomap(topo, ds=ds, vmax=0.2, w=2, show=False)
    p.close()
    p = plot.Topomap(topo, 'A%B', ds=ds, axw=2, show=False)
    p.close()
    p = plot.Topomap(topo, ds=ds, sensorlabels=None, show=False)
    p.close()
Пример #4
0
def sensor_results(
        ress: ResultCollection,
        heading: FMTextArg = None,
        axw: float = None,
        vmax: float = None,
        cmap: str = None,
):
    "Only used for TRFExperiment model-test"
    if heading is not None:
        doc = fmtxt.Section(heading)
    else:
        doc = fmtxt.FMText()
    # table
    doc.append(fmtxt.Figure(ress.table(title='Model test')))

    # plots tests
    topographies = [res.masked_difference() for res in ress.values()]
    if vmax is None:
        vlims = plot._base.find_fig_vlims([topographies], vmax)
        _, vmax = vlims.pop(None)

    panels = []
    for (x, res), y in zip(ress.items(), topographies):
        title = [x, fmtxt.Stars.from_p(res.p.min())]
        p = plot.Topomap(y, cmap=cmap, vmax=vmax, title=title, axw=axw, show=False, clip='circle')
        panels.append(p.image())
        p.close()
    doc.append(fmtxt.Figure(fmtxt.FloatingLayout(panels)))
    return doc
Пример #5
0
def test_plot_topomap_mne():
    "Test plot.Topomap with MNE data"
    ds = datasets.get_mne_sample(sub=[0, 1], sns=True)
    p = plot.Topomap(ds['meg'].summary(time=(.1, .12)),
                     proj='left',
                     show=False)
    p.close()
Пример #6
0
def test_plot_topomap():
    "Test plot.Topomap"
    ds = datasets.get_uts(utsnd=True)
    topo = ds.eval('utsnd.summary(time=(0.075, 0.125))')

    p = plot.Topomap(topo, ds=ds)
    p.add_contour('V', 1, '#00FF00')
    p.close()
    p = plot.Topomap(topo, ds=ds, vmax=0.2, w=2)
    p.close()
    p = plot.Topomap(topo, 'A%B', ds=ds, axw=2)
    p.close()
    p = plot.Topomap(topo, ds=ds, sensorlabels=None)
    p.close()
    index = np.array([1, 3, 2])
    p = plot.Topomap(topo[index], '.case', nrow=1, axh=2, h=2.4, axtitle=index)
    p.close()
Пример #7
0
def test_plot_topomap_mne():
    "Test plot.Topomap with MNE data"
    ds = datasets.get_mne_sample(sub=[0, 1], sns=True)
    p = plot.Topomap(ds['meg'].summary(time=(.1, .12)), proj='left', show=False)
    p.close()
    # grad
    ds = datasets.get_mne_sample(sub=[0], sns='grad')
    assert_raises(NotImplementedError, plot.Topomap, 'meg.sub(time=.1)', ds=ds, show=False)