mne.bem.make_watershed_bem compatablity with freesurfer 7.3.2

MNE version 1.1.1

i tried to create bems via:

import mne
mne.set_config("FREESURFER_HOME", '/usr/local/freesurfer/7.3.2')
mne.set_config("subjects_dir", '/usr/local/freesurfer/7.3.2/subjects')

#subjects_dir = '/home/theuser/mne_data/MNE-fsaverage-data/fsaverage'
subject = 'fsaverage'
mne.bem.make_watershed_bem(subject, subjects_dir=None, overwrite=False, volume='T1',
                           atlas=False, gcaatlas=False, preflood=None, show=False,
                           copy=True, T1=None, brainmask='ws.mgz', verbose=None)

but i get this error:

FileNotFoundError: [Errno 2] No such file or directory: 'mri_watershed'

while searching for “mri_watershed” i found it in $FREESURFER_HOME/bin/mri_watershed
any help would be much appreciated.

i wanted to work with MRI template fsaverage
so i tried mne.datasets.fetch_fsaverage() but i got this error Downloading data from '' to file '/tmp/tmpc6phsyf2/'.
then i tried to open the website in my browser and it wouldn’t open. is there another link to the template?

thanks so much in advance

i tried this command in terminal:

mri_watershed -useSRAS -surf /home/theuser/mne_data/MNE-fsaverage-data/fsaverage/bem/watershed/fsaverage /home/theuser/mne_data/MNE-fsaverage-data/fsaverage/mri/T1.mgz /home/theuser/mne_data/MNE-fsaverage-data/fsaverage/bem/watershed/ws.mgz

and it worked!

i guess maybe there are some problem with default path in MNE library for mri_watershed and current path in Freesurfer 7.3.2

thanks for your attention

mne.datasets.fetch_fsaverage() should download and expand automatically the files.

you should not have to do anything manually

regarding freesurfer is you have it setup when starting mne then mne should be able
work while you stay in python


1 Like