MCPcopy
hub / github.com/mne-tools/mne-python / test_mixed_sources_plot_surface

Function test_mixed_sources_plot_surface

mne/viz/tests/test_3d.py:1360–1383  ·  view source on GitHub ↗

Test plot_surface() for mixed source space.

(renderer_interactive)

Source from the content-addressed store, hash-verified

1358@pytest.mark.slowtest # slow-ish on Travis OSX
1359@testing.requires_testing_data
1360def test_mixed_sources_plot_surface(renderer_interactive):
1361 """Test plot_surface() for mixed source space."""
1362 pytest.importorskip("nibabel")
1363 src = read_source_spaces(fwd_fname2)
1364 N = np.sum([s["nuse"] for s in src]) # number of sources
1365
1366 T = 2 # number of time points
1367 S = 3 # number of source spaces
1368
1369 rng = np.random.RandomState(0)
1370 data = rng.randn(N, T)
1371 vertno = S * [np.arange(N // S)]
1372
1373 stc = MixedSourceEstimate(data, vertno, 0, 1)
1374
1375 brain = stc.surface().plot(
1376 views="lat",
1377 hemi="split",
1378 subject="fsaverage",
1379 subjects_dir=subjects_dir,
1380 colorbar=False,
1381 )
1382 brain.close()
1383 del brain
1384
1385
1386@testing.requires_testing_data

Callers

nothing calls this directly

Calls 6

read_source_spacesFunction · 0.90
MixedSourceEstimateClass · 0.90
sumMethod · 0.45
plotMethod · 0.45
surfaceMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected