[FieldTrip] Fixing bad segmentation for EEG forward modelling

Sarang S. Dalal sarang at cfin.au.dk
Tue Dec 22 14:58:36 CET 2020


Dear Jason,

You can take a look at the MRI segmentation/meshing pipeline we use in our group:
https://github.com/meeg-cfin/nemolab/blob/master/basics/nemo_mriproc.m

There's a lot of stuff you don't need in there, but some key differences from our pipeline that I can spot:
1) we segment all the desired tissues in one step, instead of sequentially for brain, skull, scalp -- not sure if that makes a difference, but worth a try:
cfg.output = {'gray','white','csf','skull','scalp'};
seg = ft_volumesegment(cfg,mri);

Note that we have gray, white, and CSF segmented for flexibility, but we typically mesh into just 'brain' along with skull and scalp (that happens later in the script) -- so I suppose you can also use 'brain' in this step with similar results.

2) we decimate the meshes to only 1000 triangles, which already may help smooth out any 'sharp' bits poking into other tissue. But you don't have much more for brain and skull, so that probably won't change your situation much.
3) We use some mesh repair functions from iso2mesh on lines 105-114 that help fix typical mesh problems. The last function, nemo_decouplesurf, should actually try to prevent surfaces from coming too close to each other. You can find that function here:
https://github.com/meeg-cfin/nemolab/blob/master/basics/nemo_decouplesurf.m

Hope these tips can help you out!

Best wishes,
Sarang

On Thu, 2020-12-17 at 19:34 -0500, Jason Leung wrote:
Hello Fieldtrip community,

I'm following the steps from the "Forward modeling for EEG source reconstruction" tutorial, and am having trouble creating the headmodel from the meshes of the segmented MRI. Note that I am using my own MRI image and I am using the OpenMEEG method for preparing the head model.

When I call ft_prepare_headmodel, I get an error message saying that my meshes are intersecting. I tried plotting the meshes and noticed that there were spikes in one of the meshes, so I changed the number of vertices around to get rid of them. However, even after doing that, I still get the same error messages. This leads me to think the issue is with the segmentation. Following the "Bonus: troubleshooting the meshes" section in the tutorial, I tried plotting the segmented mri, and it does look like some areas of the skin are too thin. However, I am not sure how to proceed at this point. What parameters can I adjust in the ft_volumesegment to fix it? Is it possible to manually fix the segmentation? Any input will be greatly appreciated!

Please find the output of the ft_volumesegment and ft_prepare_headmodel functions, the plots, and the code here (https://jpst.it/2mOcE).

Thank you very much in advance for your help!

Jason
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201222/2f00a0f4/attachment.htm>


More information about the fieldtrip mailing list