@testing.requires_testing_data
@requires_freesurfer
@requires_nibabel()
def test_read_volume_from_src():
 aseg_fname = op.join(subjects_dir, 'sample', 'mri', 'aseg.mgz')
 labels_vol = ['Left-Amygdala', 'Brain-Stem', 'Right-Amygdala']
 src = read_source_spaces(fname)
 vol_src = setup_volume_source_space('sample', mri=aseg_fname, pos=5.0, bem=fname_bem, volume_label=labels_vol, subjects_dir=subjects_dir)
 src += vol_src
 volume_src = get_volume_labels_from_src(src, 'sample', subjects_dir)
 volume_label = volume_src[0].name
 volume_label = ('Left-' + volume_label.replace('-lh', ''))
 assert_equal(volume_label, src[2]['seg_name'])
 assert_equal(src[2]['type'], 'vol')

@ testing . requires_testing_data @ requires_freesurfer @ requires_nibabel ( ) def test_read_volume_from_src ( ) : aseg_fname = op . join ( subjects_dir , 'sample' , 'mri' , 'aseg.mgz' ) labels_vol = [ 'Left-Amygdala' , 'Brain-Stem' , 'Right-Amygdala' ] src = read_source_spaces ( fname ) vol_src = setup_volume_source_space ( 'sample' , mri = aseg_fname , pos = 5.0 , bem = fname_bem , volume_label = labels_vol , subjects_dir = subjects_dir ) src += vol_src volume_src = get_volume_labels_from_src ( src , 'sample' , subjects_dir ) volume_label = volume_src [ 0 ] . name volume_label = ( 'Left-' + volume_label . replace ( '-lh' , '' ) ) assert_equal ( volume_label , src [ 2 ] [ 'seg_name' ] ) assert_equal ( src [ 2 ] [ 'type' ] , 'vol' )
test reading volumes from a mixed source space .