<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Hi Zhen,
<div><br>
</div>
<div>Short answer:</div>
<div>As a proposed solution you could try one of the following:</div>
<div>- either compile the missing file yourself, or</div>
<div>- get a more up-to-date version of the spm and/or fieldtrip code. </div>
<div><br>
</div>
<div>Longer answer:</div>
<div>More information can also be found here: <a href="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" originalsrc="https://www.fieldtriptoolbox.org/faq/organization/emaillist_howtoask/">https://www.fieldtriptoolbox.org/faq/organization/emaillist_howtoask/</a></div>
<div>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.</div>
<div>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.</div>
<div>Typically, many errors might be platform dependent, so it would have been helpful to have included this information right away. </div>
<div>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. </div>
<div>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. </div>
<div><br>
</div>
<div>Good luck,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div>
<blockquote type="cite">
<div>On 27 Mar 2025, at 17:07, Ni, Zhen (NIH/NINDS) [C] via fieldtrip <fieldtrip@science.ru.nl> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">Hello,<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">I’m creating a BEM volume conduction (head) model for source localization analysis.<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">The initial imaging is 241(0.73mm)*352*352 T1 volume.<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">I’m at the last step for segmentation after realign and reslice.<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">I use this command:<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">cfg           = [];<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">cfg.output    = {'brain', 'skull', 'scalp'};<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">segmentedmri  = ft_volumesegment(cfg, mri_resliced);<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">I got an error:<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">The coordinate system appears to be ‘mni152’<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">Error using mat2file<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">Mat2file.c not compiled-see Makefile<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">…….<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">I wonder if you have any idea to fix this.<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><o:p> </o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">Thanks<o:p></o:p></div>
<div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;">Zhen<o:p></o:p></div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<a href="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" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<a href="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" originalsrc="https://doi.org/10.1371/journal.pcbi.1002202" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>