Skip to content

Commit bc2ce19

Browse files
committed
fix path os parsing
1 parent ef1e457 commit bc2ce19

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mne/preprocessing/fit_spheres_to_mri.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def fit_spheres_to_mri(subjects_dir, subject, bem_surf, trans, n_spheres,show_sp
3434
## --- required imports
3535

3636
import nibabel as nib
37+
import os
3738
import numpy as np
3839
import vedo
3940
from scipy.spatial import KDTree
@@ -61,7 +62,7 @@ def fit_spheres_to_mri(subjects_dir, subject, bem_surf, trans, n_spheres,show_sp
6162
s_tree = KDTree(scalp['rr'])
6263
brain_volume = b.volume()
6364
print(f'Brain vedo: {brain_volume * m3_to_cc:8.2f} cc')
64-
brain_vol = nib.load(subjects_dir / subject / 'mri' / 'brainmask.mgz')
65+
brain_vol = nib.load(os.path.join(subjects_dir,subject,'mri','brainmask.mgz'))
6566
brain_rr = np.array(np.where(brain_vol.get_fdata())).T
6667
brain_rr = apply_trans(brain_vol.header.get_vox2ras_tkr(), brain_rr) / 1000. #apply a transformation matrix
6768
del brain_vol #delete brain volume

0 commit comments

Comments
 (0)