@testing.requires_testing_data
def test_simulate_sparse_stc_single_hemi():
 fwd = read_forward_solution_meg(fname_fwd, force_fixed=True)
 n_times = 10
 tmin = 0
 tstep = 0.001
 times = ((np.arange(n_times, dtype=np.float) * tstep) + tmin)
 labels_single_hemi = [read_label(op.join(data_path, 'MEG', 'sample', 'labels', ('%s.label' % label))) for label in label_names_single_hemi]
 stc_1 = simulate_sparse_stc(fwd['src'], len(labels_single_hemi), times, labels=labels_single_hemi, random_state=0)
 assert_true((stc_1.data.shape[0] == len(labels_single_hemi)))
 assert_true((stc_1.data.shape[1] == n_times))
 stc_2 = simulate_sparse_stc(fwd['src'], len(labels_single_hemi), times, labels=labels_single_hemi, random_state=0)
 assert_array_equal(stc_1.lh_vertno, stc_2.lh_vertno)
 assert_array_equal(stc_1.rh_vertno, stc_2.rh_vertno)

@ testing . requires_testing_data def test_simulate_sparse_stc_single_hemi ( ) : fwd = read_forward_solution_meg ( fname_fwd , force_fixed = True ) n_times = 10 tmin = 0 tstep = 0.001 times = ( ( np . arange ( n_times , dtype = np . float ) * tstep ) + tmin ) labels_single_hemi = [ read_label ( op . join ( data_path , 'MEG' , 'sample' , 'labels' , ( '%s.label' % label ) ) ) for label in label_names_single_hemi ] stc_1 = simulate_sparse_stc ( fwd [ 'src' ] , len ( labels_single_hemi ) , times , labels = labels_single_hemi , random_state = 0 ) assert_true ( ( stc_1 . data . shape [ 0 ] == len ( labels_single_hemi ) ) ) assert_true ( ( stc_1 . data . shape [ 1 ] == n_times ) ) stc_2 = simulate_sparse_stc ( fwd [ 'src' ] , len ( labels_single_hemi ) , times , labels = labels_single_hemi , random_state = 0 ) assert_array_equal ( stc_1 . lh_vertno , stc_2 . lh_vertno ) assert_array_equal ( stc_1 . rh_vertno , stc_2 . rh_vertno )
test generation of sparse source estimate .