<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body><p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>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...</p>
<p><br>
</p>
<p><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> mne_analysis-bounces@nmr.mgh.harvard.edu &lt;mne_analysis-bounces@nmr.mgh.harvard.edu&gt; de la part de Eric Larson &lt;larson.eric.d@gmail.com&gt;<br>
<b>Envoyé :</b> mardi 3 mars 2020 15:05:35<br>
<b>À :</b> Discussion and support forum for the users of MNE Software<br>
<b>Objet :</b> Re: [Mne_analysis] issue with mne watershed_bem</font>
<div>&nbsp;</div>
</div>
<div>
<p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p></p>
<div dir="ltr">... 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.
<div><br>
</div>
<div>Eric</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Mar 3, 2020 at 10:03 AM Eric Larson &lt;<a href="mailto:larson.eric.d@gmail.com">larson.eric.d@gmail.com</a>&gt; wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">This looks like a path problem. Is your subjects-dir actually called &quot;subjects-dir&quot;? Does the file &quot;subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz&quot; exist relative to the path from which you executed the `mne watershed_bem` command?
<div><br>
</div>
<div>Eric</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Mar 3, 2020 at 9:56 AM Fleur GAUDFERNAU &lt;<a href="mailto:fleur.gaudfernau@pasteur.fr" target="_blank">fleur.gaudfernau@pasteur.fr</a>&gt; wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p></p>
<div id="gmail-m_-1163530357331873403gmail-m_4965153805067027958divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hello,</p>
<p>I am just getting started with MNE Python.</p>
<p>I have EEG and MRI data from a participant and I want to reconstruct the sources activity.</p>
<p>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 :</p>
<p><br>
</p>
<p>(when calling </p>
<div>
<p class="MsoNormal"><span lang="EN-US">$ mne watershed_bem --overwrite --subject=sub-0865_ses-01_isotrope --subjects-dir=subjects-dir)
<br>
</span></p>
<p class="MsoNormal"><span lang="EN-US"><br>
</span></p>
</div>
<p></p>
<p></p>
<div>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">Running mri_watershed for BEM segmentation with the following parameters:</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">Results dir = subjects-dir/sub-0865_ses-01_isotrope/bem/watershed</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">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</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">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</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">Mode:<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use surfaceRAS to save surface vertex positions</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">Mode:<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Saving out BEM surfaces</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">*********************************************************</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">The input file is subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">The output file is subjects-dir/sub-0865_ses-01_isotrope/bem/watershed/ws</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">mri_watershed Error: read failed</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">mghRead(subjects-dir/sub-0865_ses-01_isotrope/mri/T1.mgz, -1): could not open file</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">('\nMode:<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>use surfaceRAS to save surface vertex positions\nMode:<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>
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')</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">Traceback (most recent call last):</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;
</span>File &quot;/Users/XXX/anaconda3/bin/mne&quot;, line 11, in &lt;module&gt;</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;
</span>load_entry_point('mne==0.20.dev0', 'console_scripts', 'mne')()</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;
</span>File &quot;/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/commands/utils.py&quot;, line 107, in main</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;
</span>cmd.run()</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;
</span>File &quot;/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/commands/mne_watershed_bem.py&quot;, line 82, in run</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;
</span></span><span style="font-size:8pt;font-family:Courier">T1=T1, brainmask=brainmask, verbose=verbose)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier"><span>&nbsp;
</span></span><span style="font-size:8pt;font-family:Courier" lang="EN-US">File &quot;&lt;/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/externals/decorator.py:decorator-gen-50&gt;&quot;, line 2, in make_watershed_bem</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;
</span>File &quot;/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/utils/_logging.py&quot;, line 90, in wrapper</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;
</span>return function(*args, **kwargs)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;
</span>File &quot;/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/bem.py&quot;, line 1150, in make_watershed_bem</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;
</span>run_subprocess_env(cmd)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;
</span>File &quot;&lt;/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/externals/decorator.py:decorator-gen-1&gt;&quot;, line 2, in run_subprocess</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;
</span>File &quot;/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/utils/_logging.py&quot;, line 90, in wrapper</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;
</span>return function(*args, **kwargs)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;
</span>File &quot;/Users/XXX/anaconda3/lib/python3.7/site-packages/mne-0.20.dev0-py3.7.egg/mne/utils/misc.py&quot;, line 163, in run_subprocess</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US"><span>&nbsp;&nbsp;&nbsp;
</span>raise subprocess.CalledProcessError(p.returncode, command, output)</span></p>
<p class="MsoNormal" style="margin-bottom:0.0001pt;line-height:normal"><span style="font-size:8pt;font-family:Courier" lang="EN-US">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.</span></p>
</div>
<p></p>
<p><br>
</p>
<p>I do not understand why mne fails to read T1.mgz. The file should be correct.</p>
<p><br>
</p>
<p>Thanks in advance !</p>
<p>Fleur Gaudfernau<br>
</p>
</div>
</div>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote>
</div>
</blockquote>
</div>
</div>
</body>
</html>