[FieldTrip] An issure about constructing individual headmodel

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Wed Dec 27 11:30:21 CET 2023


Hi Hunyong,

For a nested BEM to work, the individual surfaces should not be intersecting each other. Depending on the quality of the MR-image, and thus the quality of the subsequent segmentation, and depending on the exact details in the anatomy, the default settings for segmentation and mesh generation might or might not work out-of-the-box. Some easy to fix cases are documented here: https://www.fieldtriptoolbox.org/faq/why_does_my_eegheadmodel_look_funny/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Fwhy_does_my_eegheadmodel_look_funny%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C43577efa94864a7f2eb408dc06c6d42e%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638392698223857392%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=RuTDF60%2BVJmV8cpp2V4%2BNxrJLf8hZBzFK1uvYvcHAog%3D&reserved=0> More intricate causes of intersecting meshes can only be solved by manually interfering with the segmented images (e.g. by locally ’thickening’ tissue compartments in order to avoid the downstream created edges to touch/intersect).

This manual adjustment cannot be done with fieldtrip, but should be done with other dedicated software, e.g. freesurfer.

Best wishes,
Jan-Mathijs




On 25 Dec 2023, at 06:25, wang yunhong via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear FT community,

I hope this email finds you all well.

I tried to do source reconstruction with individual sMRI. I met an issue that when using individual MRI image to construct headmodel, it looked weird that the mesh was irregular.

Error messages below:
Error using assert
vertex 69 of surface 2 is outside surface 3

Error in ft_headmodel_bemcp (line 127)
      assert(inside==true, 'vertex %d of surface %d is outside surface %d', j, i, i+1);

Error in ft_prepare_headmodel (line 310)
      headmodel = ft_headmodel_bemcp(geometry, 'conductivity', cfg.conductivity);



In addition, I put my processing code below:

mri = ft_read_mri('sub-001_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii');
mri.coordsys = 'acpc';

cfg = [];
cfg.output = {'brain','skull','scalp'};
cfg.scalpsmooth  = 8;
mri_segmented = ft_volumesegment(cfg,mri);

cfg = [];
cfg.tissue = {'brain','skull','scalp'};
cfg.method = 'projectmesh';
cfg.numvertices = [3000 2000 1000];
mri_mesh = ft_prepare_mesh(cfg,mri_segmented);

cfg = [];
cfg.method = 'bemcp';
headmodel = ft_prepare_headmodel(cfg,mri_mesh);

cfg = [];
cfg.mri = mri;
cfg.method = 'basedonmni';
cfg.templatemri = 'tpl-MNI152NLin2009cAsym_space-MNI_res-01_T1w.nii';
cfg.grid.template = 'standard_sourcemodel3d10mm.mat';
cfg.nonlinear = 'yes';
cfg.unit = 'mm';
sourcemodel = ft_prepare_sourcemodel(cfg);


Warm regards,
Yunhong


---------------------------------------
----------------------------
Wang Yun-Hong *
PhD student

Faculty of Psychology
Southwest University

Email: yunhong_wang at outlook.com<mailto:yunhong_wang at outlook.com>

2 Tiansheng Road, Beibei District,
Chongqing 400715, P. R. China

*The order of my name follows Chinese tradition,
i.e., family name is Wang, and given name is Yun-Hong.
---------------------------------------
----------------------------

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C43577efa94864a7f2eb408dc06c6d42e%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638392698223857392%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eEDxf2ahtU%2FNlgAehasCa%2Bgenl2P78GefoFA3ztswjU%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C43577efa94864a7f2eb408dc06c6d42e%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638392698223857392%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=nQeQVBwoLO%2FPPs3ol%2BZeeYFrUmZHJvIrd32P6D0c7eg%3D&reserved=0>

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


More information about the fieldtrip mailing list