[Mne_analysis] issue with mne watershed_bem

Eric Larson larson.eric.d at gmail.com
Tue Mar 3 10:03:37 EST 2020
Search archives:

        External Email - Use Caution        

This looks like a path problem. Is your subjects-dir actually called
"subjects-dir"? Does the file
"subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz" exist relative to the
path from which you executed the `mne watershed_bem` command?

Eric


On Tue, Mar 3, 2020 at 9:56 AM Fleur GAUDFERNAU <fleur.gaudfernau at pasteur.fr>
wrote:

>         External Email - Use Caution
>
> Hello,
>
> I am just getting started with MNE Python.
>
> I have EEG and MRI data from a participant and I want to reconstruct the
> sources activity.
>
> I do not have the surfaces necessary to make the bem model (ie inner
> skull, outer skin and outer skull). Hence I used mne_watershed_bem to
> create the bem surfaces. At this point, I get the following error :
>
>
> (when calling
>
> $ mne watershed_bem --overwrite --subject=sub-0865_ses-01_isotrope
> --subjects-dir=subjects-dir)
>
>
> Running mri_watershed for BEM segmentation with the following parameters:
>
> Results dir = subjects-dir/sub-0865_ses-01_isotrope/bem/watershed
>
> Command = mri_watershed -useSRAS -surf
> subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/sub-0865_ses-01_isotrope
> subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz
> subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/ws
>
> Running subprocess: mri_watershed -useSRAS -surf
> subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/sub-0865_ses-01_isotrope
> subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz
> subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/ws
>
>
>
> Mode:          use surfaceRAS to save surface vertex positions
>
> Mode:          Saving out BEM surfaces
>
>
>
> *********************************************************
>
>
>
> The input file is subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz
>
> The output file is subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/ws
>
>
>
> mri_watershed Error: read failed
>
>
>
> mghRead(subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz, -1): could not
> open file
>
> ('\nMode:          use surfaceRAS to save surface vertex positions\nMode:
> Saving out BEM
> surfaces\n\n*********************************************************\nThe
> input file is subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz\nThe output
> file is
> subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/ws\n\nmri_watershed
> Error: read failed\n\n',
> 'mghRead(subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz, -1): could not
> open file\n')
>
> Traceback (most recent call last):
>
>   File "/Users/XXX/anaconda3/bin/mne", line 11, in <module>
>
>     load_entry_point('mne==0.20.dev0', 'console_scripts', 'mne')()
>
>   File
> "/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/commands/utils.py",
> line 107, in main
>
>     cmd.run()
>
>   File
> "/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/commands/mne_watershed_bem.py",
> line 82, in run
>
>     T1=T1, brainmask=brainmask, verbose=verbose)
>
>   File
> "</Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/externals/decorator.py:decorator-gen-50>",
> line 2, in make_watershed_bem
>
>   File
> "/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/utils/_logging.py",
> line 90, in wrapper
>
>     return function(*args, **kwargs)
>
>   File
> "/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/bem.py",
> line 1150, in make_watershed_bem
>
>     run_subprocess_env(cmd)
>
>   File
> "</Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/externals/decorator.py:decorator-gen-1>",
> line 2, in run_subprocess
>
>   File
> "/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/utils/_logging.py",
> line 90, in wrapper
>
>     return function(*args, **kwargs)
>
>   File
> "/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/utils/misc.py",
> line 163, in run_subprocess
>
>     raise subprocess.CalledProcessError(p.returncode, command, output)
>
> subprocess.CalledProcessError: Command '['mri_watershed', '-useSRAS',
> '-surf',
> 'subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/sub-0865_ses-01_isotrope',
> 'subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz',
> 'subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/ws']' returned
> non-zero exit status 1.
>
>
> I do not understand why mne fails to read T1.mgz. The file should be
> correct.
>
>
> Thanks in advance !
>
> Fleur Gaudfernau
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200303/83850cd8/attachment-0001.html 


More information about the Mne_analysis mailing list