<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hi Zhen,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
I've encountered a similar error before. Does it help if you add this line to your cfg?<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<i>cfg.spmversion = 'spm12';</i></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Tom<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Zhen Ni <nzhen340@gmail.com><br>
<b>Sent:</b> 08 June 2020 21:30<br>
<b>To:</b> fieldtrip@science.ru.nl <fieldtrip@science.ru.nl><br>
<b>Subject:</b> [FieldTrip] Permutation test</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">Hello,
<div>My name is Zhen Ni. I'm a senior research fellow working at the National Institutes of Health.</div>
<div>I'm using FieldTrip (version 20200423) to perform a cluster-based permutation test. My script is largely based on the example you showed on the FieldTrip webpage. The script stopped after a while with a technical problem. I copied the error message below.</div>
<div>I also tried following your instruction and used the dataset you uploaded on the webpage. The same error message comes out. I wonder if you may take a look at my codes and help me out.</div>
<div><br>
</div>
<div>Many thanks.</div>
<div>Zhen</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div><br>
</div>
<div>Invalid MEX-file '/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64':</div>
<div>dlopen(/Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64, 6): Library</div>
<div>not loaded: @loader_path/libmex.dylib</div>
<div>  Referenced from: /Users/nz/Documents/MATLAB/external/spm8/spm_bwlabel.mexmaci64</div>
<div>  Reason: image not found</div>
<div><br>
</div>
<div>Error in findcluster (line 87)</div>
<div>    [labelmat(spatdimlev, :, :), num] = spm_bwlabel(double(reshape(onoff(spatdimlev,</div>
<div>    :, :), nfreq, ntime)), 6); % the previous code contained a '4' for input</div>
<div><br>
</div>
<div>Error in clusterstat (line 202)</div>
<div>      posclusobs = findcluster(reshape(postailobs,</div>
<div>      [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);</div>
<div><br>
</div>
<div>Error in ft_statistics_montecarlo (line 353)</div>
<div>  [stat, cfg] = clusterstat(cfg, statrand, statobs);</div>
<div><br>
</div>
<div>Error in ft_timelockstatistics (line 184)</div>
<div>  [stat, cfg] = statmethod(cfg, dat, design);</div>
</div>
</div>
</div>
</div>
</body>
</html>