Closed larsoner closed 6 years ago
Relatedly, I am currently trying to see whether I can fix the tiny surface intersections problem by:
k
toward the center of the surfaceEDIT: in any case we'd need to wait for https://github.com/nipy/nibabel/pull/458 to be merged.
@kingjr you know we have code for detecting whether points are inside a surface already right?
@Eric89GXL Yes, I'm now trying to understand how it works :)
Follow the trail of the surface topology checks in _check_surfaces
Seriously though, is there a problem with getting an MEFLASH or with mri_make_bem_surfaces (it has never failed for me)?
@dgwakeman It's not always possible to acquire MRI, sometimes you have to retrieve from archive data.
[i.e. you don't always have the adequate MRI sequence, hence the unstable segmentation]
Ok, in that case the one cheap easy step to solve the intersection problem with the watershed BEM is to just binarize and smooth/expand the 3d volume of the aseg volume from FreeSurfer, and then just fit an icosahedral surface to it. That should avoid all intersections. This would be totally automatable, and easy. I had some hacks to do this back in the day (hacking calls to mri_watershed: the code is pretty entrenched in a particular naming directory structure). Note, the watershed is still not recommended for EEG.
I did that to generate the inner skull surface for the SPM BEM. Then I did way crazier hacks to get the outer skull, but that is a ton of work.
@dgwakeman that seems like a better fix than what I was suggesting. Would you be ok sharing your script and opening a PR?
I can try to dig it up, but it doesn't really belong in mne-python (unless we got icosahedral meshing and I missed it), because it uses FreeSurfer commands. I'm happy to help. I'm in the middle of moving (to Philadelphia if anyone knows of labs looking for someone, or wants to hire a consultant to work remotely), but I should be able to look into it late next week. I'm setting an alarm now to look at it on Friday afternoon. hth d
If I understand correctly, because I have only MEG data, I can only reconstruct a one layer bem model with
make_bem_model(subject, conductivity=[0.3], subjects_dir=subjects_dir)
which will give me only the inner_skull surface?
yes, for meg you don't need 3 layers
On 23 November 2016 at 09:32, romquentin notifications@github.com wrote:
If I understand correctly, because I have only MEG data, I can only reconstruct a one layer bem model with make_bem_model(subject, conductivity=[0.3], subjects_dir=subjects_dir) which will give me only the inner_skull surface?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mne-tools/mne-python/issues/3291#issuecomment-262527905, or mute the thread https://github.com/notifications/unsubscribe-auth/AEp7DLr8K4umOrbRCHCSkBhsPG2sEyyjks5rBE5_gaJpZM4Iw-2P .
Ok Thank you! On some case, the inner skull miss a part of the brain so I would still need a tool to expand the inner skull surface...
Specifically, this pattern is very common in my participants, with a surface error on the right frontal part...
Closing as I don't think there is much we can do in MNE to fix this, it's more of a Freesurfer / triangulated mesh problem (but feel free to comment further if people find other fixes)
Maybe this is useful for future reference.
I had a similar problem to @romquentin, one of my outer skin meshes had fairly large holes on either side. This was actually pretty easy to fix using meshlab (http://www.meshlab.net/). This is what I did:
This nicely filled the holes. Not sure how helpful meshlab is for other defects but is certainly worth a look.
@nwilming nice! It would be good to add this to the docs. We could either put it in the FAQ:
https://martinos.org/mne/stable/faq.html
Or here:
https://martinos.org/mne/stable/manual/source_localization/forward.html#topology-checks
The latter is a bit outdated / talks about MNE-C a lot. We should probably update it. But that wouldn't prevent us from adding this useful information there.
Hi, I've been trying different ways to edit the surfaces used for BEM. In my experience, converting to .stl format is not useful for further processing as it loses the vertex order information, which results in an error when creating the BEM model (mne.make_bem_model):
"RuntimeError: The source surface has a matching number of triangles but ordering is wrong". bem.py (line 361)
The way I found to edit the surfaces is:
I createad a small guide that shows how to do the edition in Blender and also some scripts to automatize the process of converting all the files created by mne.bem.make_watershed_bem.
I hope it will be useful!
@kingjr recently asked (but is probably too wary of opening issues to do it):
My suggestion would be to:
Does anyone know of a better way? If not, then we can make a recommendation for how people can fix minor BEM surface issues if necessary.