make_watershed_bem - IOError: [Errno 13] Permission denied: 'brain'
See original GitHub issueSystem: Python 2.7.12 Ubuntu 16.04.1 LTS MNE version 0.14.git
I have been running into a few problems with this function. Initially I had the same problem as #3274 where freesurfer was not being found/setup correctly. I thought this was fixed in 0.14 but I ran into the same issue. I manually modified the utils.py to setup freesurfer before it ran the command. That fixed the problem but I get this new problem, Permission denied, ‘brain’ The following shows the error. I have editted a few things such as subject directory for privacy reasons.
Saving /SUBJECT_DIR/bem/watershed/ws
done
Triangle file: created by USER on Tue Oct 18 15:30:33 2016 nvert = 10242 ntri = 20480
Triangle neighbors and vertex normals...
Traceback (most recent call last):
File "pythonScripts/pipeline.py", line 208, in <module>
main()
File "pythonScripts/pipeline.py", line 169, in main
bem.make_watershed_bem(URSI, subjects_dir=MRISubjectDirectory, overwrite=True)
File "<string>", line 2, in make_watershed_bem
File "/usr/local/lib/python2.7/dist-packages/mne/utils.py", line 708, in verbose
return function(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mne/bem.py", line 1081, in make_watershed_bem
write_surface(s, surf['rr'], surf['tris'], volume_info=volume_info)
File "/usr/local/lib/python2.7/dist-packages/mne/surface.py", line 764, in write_surface
with open(fname, 'wb') as fid:
IOError: [Errno 13] Permission denied: 'brain'
I hope this gives enough information!
Extra information, I was getting these issues previously using an older system: CentOS release 6.7 Python 2.6.6 MNE version 0.12
Upgraded system to get newer version of MNE but the problems still exist
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (7 by maintainers)
So you’re saying that at
line 1081, in make_watershed_bem
, youros.getcwd
is something invalid / nonexistent? It should be trying to write to./brain
(where./
refers to the directory from which you issued the command) but you’re saying that instead it’s trying to write to some other (probably read-only) directory? That would be a bug at our end, probably related to our handling of paths. There are someos.chdir
calls in there. Probably we need to refactor those, or more easily add anos.abspath
somewehre.Does that summarize it?
We now run this in a
tempdir
so this should be fixed