@testing.requires_testing_data
def test_expand():
    stc = read_source_estimate(fname_stc, 'sample')
    assert_true('sample' in repr(stc))
    labels_lh = read_labels_from_annot('sample', 'aparc', 'lh',
                                       subjects_dir=subjects_dir)
    new_label = labels_lh[0] + labels_lh[1]
    stc_limited = stc.in_label(new_label)
    stc_new = stc_limited.copy()
    stc_new.data.fill(0)
    for label in labels_lh[:2]:
        stc_new += stc.in_label(label).expand(stc_limited.vertices)
    assert_raises(TypeError, stc_new.expand, stc_limited.vertices[0])
    assert_raises(ValueError, stc_new.expand, [stc_limited.vertices[0]])
    # make sure we can't add unless vertno agree
    assert_raises(ValueError, stc.__add__, stc.in_label(labels_lh[0]))
Test stc expansion
dataset/ETHPy150Open mne-tools/mne-python/mne/tests/test_source_estimate.py/test_expand