[Mne_analysis] BEM mesh error while downsampling vertices

Eric Larson larson.eric.d at gmail.com
Thu Oct 1 11:47:19 EDT 2020
Search archives:

        External Email - Use Caution        

>
> I got a runtime error while making a BEM model (using mne.make_bem_model)
> that :
> "Surface inner skull has topological defects: 12 / 20484 vertices have
> fewer than three neighboring triangles [733, 1014, 2068, 7732, 8435, 8489,
> 10181, 11120, 11121, 11122, 11304, 11788]"
>
> As mentioned in this link-
> https://github.com/mne-tools/mne-python/issues/6127 I tried to visualize
> the inner skull surface but didn't know how to find those vertices.
>

Here is some code to get you started:

import numpy as np
import pyvista
from pyvistaqt import BackgroundPlotter
import mne
fig = BackgroundPlotter()
rr, tris = mne.read_surface(mne.datasets.sample.data_path() +
'/subjects/sample/bem/inner_skull.surf')
tris = np.concatenate([np.full((len(tris), 1), 3), tris], axis=1)
pd = pyvista.PolyData(rr, tris)
fig.add_mesh(pd)
points = pyvista.PolyData(rr[[733, 1014, 2068]])
fig.add_mesh(points, style='points', color='r', point_size=10,
opacity=0.5, render_points_as_spheres=True)

Produces (the third point is out of the current view):

[image: Screenshot from 2020-10-01 11-44-46.png]


> I have attached an image of the inner skull surface. I could see some
> small triangles at places I wouldn't expect them. So I tried to smoothen
> out any irregularities in Freeview using the smoothing tool. That didn't
> help.
>

Interesting, that solution is not listed here:

https://mne.tools/dev/overview/faq.html#my-watershed-bem-meshes-look-incorrect


Would you be up for making a pull request on GitHub to add to the
documentation whatever you did as an option there?

Also feel free to try the other solutions listed there to fix things.

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20201001/67ffbf56/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2020-10-01 11-44-46.png
Type: image/png
Size: 82125 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20201001/67ffbf56/attachment-0001.png 


More information about the Mne_analysis mailing list