@slow_test
@testing.requires_testing_data
def test_volume_source_space():
 tempdir = _TempDir()
 src = read_source_spaces(fname_vol)
 temp_name = op.join(tempdir, 'temp-src.fif')
 surf = read_bem_surfaces(fname_bem, s_id=FIFF.FIFFV_BEM_SURF_ID_BRAIN)
 surf['rr'] *= 1000.0
 for (bem, surf) in zip((fname_bem, None), (None, surf)):
  src_new = setup_volume_source_space('sample', temp_name, pos=7.0, bem=bem, surface=surf, mri='T1.mgz', subjects_dir=subjects_dir)
  src[0]['subject_his_id'] = 'sample'
  _compare_source_spaces(src, src_new, mode='approx')
  del src_new
  src_new = read_source_spaces(temp_name)
  _compare_source_spaces(src, src_new, mode='approx')
 assert_raises(IOError, setup_volume_source_space, 'sample', temp_name, pos=7.0, bem=None, surface='foo', mri=fname_mri, subjects_dir=subjects_dir)
 assert_equal(repr(src), repr(src_new))
 assert_equal(src.kind, 'volume')

@ slow_test @ testing . requires_testing_data def test_volume_source_space ( ) : tempdir = _TempDir ( ) src = read_source_spaces ( fname_vol ) temp_name = op . join ( tempdir , 'temp-src.fif' ) surf = read_bem_surfaces ( fname_bem , s_id = FIFF . FIFFV_BEM_SURF_ID_BRAIN ) surf [ 'rr' ] *= 1000.0 for ( bem , surf ) in zip ( ( fname_bem , None ) , ( None , surf ) ) : src_new = setup_volume_source_space ( 'sample' , temp_name , pos = 7.0 , bem = bem , surface = surf , mri = 'T1.mgz' , subjects_dir = subjects_dir ) src [ 0 ] [ 'subject_his_id' ] = 'sample' _compare_source_spaces ( src , src_new , mode = 'approx' ) del src_new src_new = read_source_spaces ( temp_name ) _compare_source_spaces ( src , src_new , mode = 'approx' ) assert_raises ( IOError , setup_volume_source_space , 'sample' , temp_name , pos = 7.0 , bem = None , surface = 'foo' , mri = fname_mri , subjects_dir = subjects_dir ) assert_equal ( repr ( src ) , repr ( src_new ) ) assert_equal ( src . kind , 'volume' )
test setting up volume source spaces .