[FieldTrip] Head model-segmentation

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Sat Mar 29 12:44:37 CET 2025


Hi Zhen,

Short answer:
As a proposed solution you could try one of the following:
- either compile the missing file yourself, or
- get a more up-to-date version of the spm and/or fieldtrip code.

Longer answer:
More information can also be found here: https://www.fieldtriptoolbox.org/faq/organization/emaillist_howtoask/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Ffaq%2Forganization%2Femaillist_howtoask%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cf08118f41ee2468e83a208dd6eb71544%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638788454781001466%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=JUnOBcUeq7g%2BSC%2FXk0wZojd9QIw%2B2pGnNV0bsaVZGQo%3D&reserved=0>
Typically, when encountering an error upon code execution, the output to the screen mentions in which line and function the error is generated, your message only included ‘….’ . For future reference it would be extremely helpful if you include this information right away.
The error message says: “Mat2file.c not compiled”. This means that a piece of c-code, called mat2file.c has not been compiled, i.e. matlab tries to run a piece of compiled code, aka a mex-file (which probably is called mat2file.mexa64/mat2file.mexw64/mat2file.mexmaci64/mat2file.mexmaca64 etc). The exact file extension depends on the platform on which the code is to be executed.
Typically, many errors might be platform dependent, so it would have been helpful to have included this information right away.
The uncompiled function is part of the spm toolbox. Thus, the error you get is that your distro of spm does not contain the compiled code required for your platform.
Since errors often are dependent on the version of the software (and downstream toolboxes) that you are using, it would have been helpful to have included this information.

Good luck,
Jan-Mathijs




On 27 Mar 2025, at 17:07, Ni, Zhen (NIH/NINDS) [C] via fieldtrip <fieldtrip at science.ru.nl> wrote:

Hello,
I’m creating a BEM volume conduction (head) model for source localization analysis.
The initial imaging is 241(0.73mm)*352*352 T1 volume.
I’m at the last step for segmentation after realign and reslice.
I use this command:
cfg           = [];
cfg.output    = {'brain', 'skull', 'scalp'};
segmentedmri  = ft_volumesegment(cfg, mri_resliced);

I got an error:
The coordinate system appears to be ‘mni152’
Error using mat2file
Mat2file.c not compiled-see Makefile
…….

I wonder if you have any idea to fix this.

Thanks
Zhen
_______________________________________________
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%7Cf08118f41ee2468e83a208dd6eb71544%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638788454781018732%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=tsUYkKaYWcrkSZSndl34qm%2BavXdUOb7feF2AlQhzlQg%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%7Cf08118f41ee2468e83a208dd6eb71544%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638788454781027236%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Xb%2B5izLp3E%2BIqcyYxYIXZFQogb484vR8BfudRXSuQXo%3D&reserved=0>

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


More information about the fieldtrip mailing list