<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr"><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 style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I opened an MNE issue for the downsampling problem (<a href="https://github.com/mne-tools/mne-python/issues/6127" id="LPNoLP860548">https://github.com/mne-tools/mne-python/issues/6127</a>)<br>
</div>
<br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
</div>
<div><br>
</div>
<div><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
When I set the ico=None, I run into a new issue with mne.make_bem_solution after mne.make_bem_model.&nbsp; I don't get this issue with the MNE sample dataset but with my acquired T1's.&nbsp; Any ideas?&nbsp; Thanks for your help guys.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<blockquote style="margin-top:0px; margin-bottom:0px">bem = mne.make_bem_solution(surfaces, verbose='INFO')
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
Approximation method : Linear collocation</p>
<div style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
Three-layer model surfaces loaded.</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
Computing the linear collocation solution...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
Matrix coefficients...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
head (5002) -&gt; head (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/mne/bem.py:151: RuntimeWarning: divide by zero encountered in double_scalars</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
miss /= (4.0 * n_memb)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
head (5002) -&gt; outer_skull (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
head (5002) -&gt; inner_skull (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
outer_skull (5002) -&gt; head (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
outer_skull (5002) -&gt; outer_skull (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
outer_skull (5002) -&gt; inner_skull (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
inner_skull (5002) -&gt; head (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
inner_skull (5002) -&gt; outer_skull (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
inner_skull (5002) -&gt; inner_skull (5002) ...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
Inverting the coefficient matrix...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
Traceback <span style="color:#00ffff">(most recent call last)</span>:</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
File <span style="color:#006400">&quot;&lt;ipython-input-18-24943e2f3a65&gt;&quot;</span>, line <span style="color:#006400">
1</span>, in <span style="color:#9400d3">&lt;module&gt;</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
bem = mne.make_bem_solution(surfaces, verbose='INFO')</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
File <span style="color:#006400">&quot;&lt;/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/mne/externals/decorator.py:decorator-gen-39&gt;&quot;</span>, line
<span style="color:#006400">2</span>, in <span style="color:#9400d3">make_bem_solution</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
File <span style="color:#006400">&quot;/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/mne/utils/_logging.py&quot;</span>, line
<span style="color:#006400">88</span>, in <span style="color:#9400d3">wrapper</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
return function(*args, **kwargs)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
File <span style="color:#006400">&quot;/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/mne/bem.py&quot;</span>, line
<span style="color:#006400">326</span>, in <span style="color:#9400d3">make_bem_solution</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
_fwd_bem_linear_collocation_solution(bem)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
File <span style="color:#006400">&quot;/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/mne/bem.py&quot;</span>, line
<span style="color:#006400">267</span>, in <span style="color:#9400d3">_fwd_bem_linear_collocation_solution</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
m['solution'] = _fwd_bem_multi_solution(coeff, m['gamma'], nps)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
File <span style="color:#006400">&quot;/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/mne/bem.py&quot;</span>, line
<span style="color:#006400">225</span>, in <span style="color:#9400d3">_fwd_bem_multi_solution</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
return linalg.inv(solids, overwrite_a=True)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
File <span style="color:#006400">&quot;/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/scipy/linalg/basic.py&quot;</span>, line
<span style="color:#006400">945</span>, in <span style="color:#9400d3">inv</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
a1 = _asarray_validated(a, check_finite=check_finite)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
File <span style="color:#006400">&quot;/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/scipy/_lib/_util.py&quot;</span>, line
<span style="color:#006400">239</span>, in <span style="color:#9400d3">_asarray_validated</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
a = toarray(a)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<span style="color:#00ffff">File </span><span style="color:#00ff00">&quot;/dagher/dagher6/yyau/toolbox/anaconda3/envs/mne/lib/python3.6/site-packages/numpy/lib/function_base.py&quot;</span><span style="color:#00ffff">, line
</span><span style="color:#00ff00">498</span><span style="color:#00ffff">, in </span>
<span style="color:#ff00ff">asarray_chkfinite</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<span style="color:#ffff00">&quot;array must not contain infs or NaNs&quot;)</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<span style="color:#ff0000">ValueError:</span> array must not contain infs or NaNs</p>
</blockquote>
<br>
</div>
<div id="appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> mne_analysis-bounces@nmr.mgh.harvard.edu &lt;mne_analysis-bounces@nmr.mgh.harvard.edu&gt; on behalf of Eric Larson &lt;larson.eric.d@gmail.com&gt;<br>
<b>Sent:</b> April 5, 2019 9:54 AM<br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] issue with brainsuite and bem ico_downsample</font>
<div>&nbsp;</div>
</div>
<div>
<p style="margin-top: 0px; margin-bottom: 0px;"><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 style="margin-top: 0px; margin-bottom: 0px;"></p>
<div dir="ltr">
<div dir="ltr">The error is in the downsampling step (we should probably improve the message). Set `ico=None` and it won't try to downsample your surface:
<div><br>
</div>
<div><a href="https://martinos.org/mne/stable/generated/mne.make_bem_model.html">https://martinos.org/mne/stable/generated/mne.make_bem_model.html</a><br>
</div>
<div><br>
</div>
<div>It would be good indeed to see how this works with sample data and see if it affects source localization -- feel free to open an MNE issue about that.</div>
<div><br>
</div>
<div>Eric</div>
<div><br>
</div>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Fri, Apr 5, 2019 at 4:32 AM Alexandre Gramfort &lt;<a href="mailto:alexandre.gramfort@inria.fr">alexandre.gramfort@inria.fr</a>&gt; wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<p style="margin-top: 0px; margin-bottom: 0px;"><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 style="margin-top: 0px; margin-bottom: 0px;"></p>
<div dir="ltr">hi Yvonne,
<div><br>
</div>
<div>I've never tried this route to BEM model generation. Can you do this procedure with</div>
<div>MNE sample dataset and share with us the generate .surf files so we can replicate</div>
<div>and hopefully fix the pb?</div>
<div><br>
</div>
<div>ALex</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Fri, Apr 5, 2019 at 1:16 AM Yvonne Yau &lt;<a href="mailto:yvonne.yau@mail.mcgill.ca" target="_blank">yvonne.yau@mail.mcgill.ca</a>&gt; wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<p style="margin-top: 0px; margin-bottom: 0px;"><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 style="margin-top: 0px; margin-bottom: 0px;"></p>
<div><span style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; line-height:normal; color:rgb(0,0,0)">​</span>Hi guys,</div>
<div>I'm having some issues with the BEM meshes for my EEG data.&nbsp; I've tried two approaches:</div>
<div>(1) Using freesurfer watershed and trying different preflood levels, but it seems to do a bad job with the outer_skull.surf being misplaced (see attached image)</div>
<div>(2) I've had better success with using Brainsuite and have followed the guidelines; converting it from dfs to surf using mne_convert_surface, and then reducing the number of triangles to 10,000 using mne_reduce_surface.&nbsp; When I try to run mne.make_bem_mode,
 I get the error:</div>
<div>File &quot;/usr/anaconda3/envs/mne/lib/python3.6/site-packages/mne/bem.py&quot;, line 344, in _ico_downsample
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
raise RuntimeError(bad_msg)</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px">
RuntimeError: A surface with 10000 triangles cannot be isomorphic with a subdivided icosahedron.</p>
</div>
<div><br>
</div>
<div>Any ideas?</div>
<div><br>
</div>
<div>Best, Yvonne<br>
</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>
_______________________________________________<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>
</div>
</body>
</html>