mne-python: BUG: set_config() doesn't change value accessed via get_config()
It’s probably a bad setup on my part, but I can’t seem to make mne.bem.make_watershed_bem to work.
I try to explicitly export and source Freesurfer and MNE © in the bash and/or via subprocess or os.sys(), but I keep having the following error with the command
mne.bem.make_watershed_bem(subject, subjects_dir, overwrite=True)
Running mri_watershed for BEM segmentation with the following parameters:
SUBJECTS_DIR = /data/subjects
SUBJECT = hn120493
Results dir = /data/subjects/hn120493/bem/watershed
Running subprocess: mri_watershed -useSRAS -surf /data/subjects/hn120493/bem/watershed/hn120493 /data/subjects/hn120493/mri/T1.mgz /data/subjects/hn120493/bem/watershed/ws
Command not found: mri_watershed
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-5-f8d51723d992> in <module>()
----> 1 mne.bem.make_watershed_bem(subject, subjects_dir, overwrite=True)
/home/jrking/mne-python/mne/bem.pyc in make_watershed_bem(subject, subjects_dir, overwrite, volume, atlas, gcaatlas, preflood, show, verbose)
/home/jrking/mne-python/mne/utils.pyc in verbose(function, *args, **kwargs)
627 with use_log_level(verbose_level):
628 return function(*args, **kwargs)
--> 629 return function(*args, **kwargs)
630
631
/home/jrking/mne-python/mne/bem.pyc in make_watershed_bem(subject, subjects_dir, overwrite, volume, atlas, gcaatlas, preflood, show, verbose)
1061 'Results dir = %s\n' % (subjects_dir, subject, ws_dir))
1062 os.makedirs(op.join(ws_dir, 'ws'))
-> 1063 run_subprocess(cmd, env=env, stdout=sys.stdout, stderr=sys.stderr)
1064
1065 if op.isfile(T1_mgz):
/home/jrking/mne-python/mne/utils.pyc in run_subprocess(command, verbose, *args, **kwargs)
/home/jrking/mne-python/mne/utils.pyc in verbose(function, *args, **kwargs)
627 with use_log_level(verbose_level):
628 return function(*args, **kwargs)
--> 629 return function(*args, **kwargs)
630
631
/home/jrking/mne-python/mne/utils.pyc in run_subprocess(command, verbose, *args, **kwargs)
930 logger.info("Running subprocess: %s" % ' '.join(command))
931 try:
--> 932 p = subprocess.Popen(command, *args, **kwargs)
933 except Exception:
934 logger.error('Command not found: %s' % (command[0],))
/home/jrking/anaconda/lib/python2.7/subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
708 p2cread, p2cwrite,
709 c2pread, c2pwrite,
--> 710 errread, errwrite)
711 except Exception:
712 # Preserve original exception in case os.close raises.
/home/jrking/anaconda/lib/python2.7/subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
1333 raise
1334 child_exception = pickle.loads(data)
-> 1335 raise child_exception
1336
1337
OSError: [Errno 2] No such file or directory
However, when running the command directly in the terminal it works fine
mri_watershed -useSRAS -surf /data/subjects/hn120493/bem/watershed/hn120493 /data/subjects/hn120493/mri/T1.mgz /data/subjects/hn120493/bem/watershed/ws Command not found: mri_watershed.
I can’t get the pipeline to work though, because I am still missing the subject_surface file.
Any idea what I can do?.. Sorry for the noise.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (15 by maintainers)
Try it with
mri_watershed --version