예제 #1
0
def test_plot_vector_source_estimates(renderer_interactive):
    """Test plotting of vector source estimates."""
    sample_src = read_source_spaces(src_fname)

    vertices = [s['vertno'] for s in sample_src]
    n_verts = sum(len(v) for v in vertices)
    n_time = 5
    data = np.random.RandomState(0).rand(n_verts, 3, n_time)
    stc = VectorSourceEstimate(data, vertices, 1, 1)

    brain = stc.plot('sample',
                     subjects_dir=subjects_dir,
                     hemi='both',
                     smoothing_steps=1,
                     verbose='error')
    brain.close()
    del brain

    with pytest.raises(ValueError, match='use "pos_lims"'):
        stc.plot('sample',
                 subjects_dir=subjects_dir,
                 clim=dict(pos_lims=[1, 2, 3]))

    with pytest.raises(ValueError, match='cannot be used'):
        stc.plot('sample',
                 subjects_dir=subjects_dir,
                 show_traces=True,
                 time_viewer=False)
예제 #2
0
def test_plot_vector_source_estimates():
    """Test plotting of vector source estimates."""
    sample_src = read_source_spaces(src_fname)

    vertices = [s['vertno'] for s in sample_src]
    n_verts = sum(len(v) for v in vertices)
    n_time = 5
    data = np.random.RandomState(0).rand(n_verts, 3, n_time)
    stc = VectorSourceEstimate(data, vertices, 1, 1)

    brain = stc.plot('sample', subjects_dir=subjects_dir)
    brain.close()
    del brain
    gc.collect()

    with pytest.raises(ValueError, match='use "pos_lims"'):
        stc.plot('sample',
                 subjects_dir=subjects_dir,
                 clim=dict(pos_lims=[1, 2, 3]))
    gc.collect()

    brain = stc.plot('sample', subjects_dir=subjects_dir, hemi='both')
    brain.close()
    del brain
    gc.collect()
예제 #3
0
def test_plot_vec_source_estimates():
    """Test plotting of vector source estimates."""
    sample_src = read_source_spaces(src_fname)

    vertices = [s['vertno'] for s in sample_src]
    n_verts = sum(len(v) for v in vertices)
    n_time = 5
    data = np.random.RandomState(0).rand(n_verts, 3, n_time)
    stc = VectorSourceEstimate(data, vertices, 1, 1)

    with warnings.catch_warnings(record=True):
        warnings.simplefilter('always')
        stc.plot('sample', subjects_dir=subjects_dir)
예제 #4
0
def test_plot_vec_source_estimates():
    """Test plotting of vector source estimates."""
    sample_src = read_source_spaces(src_fname)

    vertices = [s['vertno'] for s in sample_src]
    n_verts = sum(len(v) for v in vertices)
    n_time = 5
    data = np.random.RandomState(0).rand(n_verts, 3, n_time)
    stc = VectorSourceEstimate(data, vertices, 1, 1)

    with warnings.catch_warnings(record=True):
        warnings.simplefilter('always')
        stc.plot('sample', subjects_dir=subjects_dir)
예제 #5
0
def test_plot_vec_source_estimates():
    """Test plotting of vector source estimates."""
    sample_src = read_source_spaces(src_fname)

    vertices = [s['vertno'] for s in sample_src]
    n_verts = sum(len(v) for v in vertices)
    n_time = 5
    data = np.random.RandomState(0).rand(n_verts, 3, n_time)
    stc = VectorSourceEstimate(data, vertices, 1, 1)

    stc.plot('sample', subjects_dir=subjects_dir)

    with pytest.raises(ValueError, match='use "pos_lims"'):
        stc.plot('sample', subjects_dir=subjects_dir,
                 clim=dict(pos_lims=[1, 2, 3]))
예제 #6
0
def test_plot_vec_source_estimates():
    """Test plotting of vector source estimates."""
    sample_src = read_source_spaces(src_fname)

    vertices = [s['vertno'] for s in sample_src]
    n_verts = sum(len(v) for v in vertices)
    n_time = 5
    data = np.random.RandomState(0).rand(n_verts, 3, n_time)
    stc = VectorSourceEstimate(data, vertices, 1, 1)

    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter('always')
        stc.plot('sample', subjects_dir=subjects_dir)
        assert len(w) == 0  # not using deprecated params

        with pytest.raises(ValueError, match='use "pos_lims"'):
            stc.plot('sample', subjects_dir=subjects_dir,
                     clim=dict(pos_lims=[1, 2, 3]))
        assert len(w) == 0