[Mne_analysis] issue with mne watershed_bem

Eric Larson larson.eric.d at gmail.com
Tue Mar 3 11:45:54 EST 2020
Search archives:

        External Email - Use Caution        

Are you able to read it using Freesurfer commands like:

mri_convert subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz ~/test.nii

This should at least verify that Freesurfer can read your file. But really
this is all that MNE should be trying to do. You could then try changing
over to the branch from this PR to see if it flags anything as being wrong:

https://github.com/mne-tools/mne-python/pull/7370

We can also iterate there until we figure it out.

Eric


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

>         External Email - Use Caution
>
> I checked, it is not a path issue. Nor a permission one, I ran the command
> with the highest permission rights. And the other files in the directory
> were accessible when running other commands...
>
>
>
> ------------------------------
> *De :* mne_analysis-bounces at nmr.mgh.harvard.edu <
> mne_analysis-bounces at nmr.mgh.harvard.edu> de la part de Eric Larson <
> larson.eric.d at gmail.com>
> *Envoyé :* mardi 3 mars 2020 15:05:35
> *À :* Discussion and support forum for the users of MNE Software
> *Objet :* Re: [Mne_analysis] issue with mne watershed_bem
>
>
>         External Email - Use Caution
>
> ... or actually perhaps it's a permissions issue. MNE already checks to
> make sure the file exists, but we don't for example check to see if it's
> readable by the user.
>
> Eric
>
>
> On Tue, Mar 3, 2020 at 10:03 AM Eric Larson <larson.eric.d at gmail.com>
> wrote:
>
>> 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
>>
>> _______________________________________________
> 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/f6883745/attachment-0001.html 


More information about the Mne_analysis mailing list