[FieldTrip] ft_prepare_mesh ERROR

Arjen Stolk a.stolk8 at gmail.com
Sat Sep 29 07:50:54 CEST 2018

Dear Toshiki,

>From that error, it seems your version of Freesurfer is referencing
libraries that do not exist while executing the *mris_fill *command. To
rule out that the issue is due to the call to *mris_fill* being made from
within the matlab environment as *prepare_mesh_cortexhull* does, you could
try to call *mris_fill* directly from within a terminal and see if it
replicates, as follows:

export FREESURFER_HOME=/Applications/freesurfer

source $FREESURFER_HOME/SetUpFreeSurfer.sh

mris_fill -c -r 1 path_to_freesurfer/surf/lh.pial tmp.filled.mgz

If that reproduces the error, it might be worth consulting the
Freesurfer development team concerning this. A similar issue was reported
but it doesn't look like a fix has been suggested. Alternatively, you could
try a different version of Freesurfer for creating the cortical hull (
freesurfer-Darwin-lion-stable-pub-v5.3.0 runs fine on my mac). Hope this

On Sep 25, 2018, at 12:13 AM, 岡留敏樹 <tokadome at neuro.med.kyushu-u.ac.jp>

Hello fieldtrip experts,

when trying to run ‘ft_prepare_mesh’ command from fieldtrip with
MATLAB R2018a, I run into the error below.

I was preprocessing MRI date according with the paper ’Nature Protocol
2018; 13: 1699-1723. http://doi.org/10.1038/s41596-018-0009-6 ‘.

I’m running this on a iMac, macOS High Sierra 10.13.6, with
fieldtrip-20180909, freesurfer-Darwin-OSX-stable-pub-v6.0.0-2beb96c.

>From past archives, I think this is because of SIP. So I disabled SIP
of OSX, but I run into same errors.
I tried different subjects, which caused similar errors.

Any ideas would be greatly appreciated, thank you!


cfg = [];

cfg.method = ‘cortexhull’;

cfg.headshape = <path to freesurfer/surf/lh.pial>;

cfg.fshome = <path to freesurfer home directory>;

hull_lh = ft_prepare_mesh (cfg);


dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address

  Referenced from: /Applications/freesurfer/bin/../lib/gcc/lib/libgomp.1.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
  Referenced from: /Applications/freesurfer/bin/../lib/gcc/lib/libgomp.1.dylib
  Expected in: /usr/lib/libSystem.B.dylib

mris_fill -c -r 1
reading filled volume...
gunzip: can't stat:
No such file or directory
ERROR: problem reading fname


Toshiki Okadome

fieldtrip mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180928/046f3c63/attachment-0002.html>

More information about the fieldtrip mailing list