@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]])
 assert_raises(ValueError, stc.__add__, stc.in_label(labels_lh[0]))

@ 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 ] ] ) assert_raises ( ValueError , stc . __add__ , stc . in_label ( labels_lh [ 0 ] ) )
test stc expansion .