<div dir="ltr">If anyone encounters the same problem, compilation works if I manually add a bunch of spm functions (which are not recognised by mcc, probably because they are in a class definition folder).<div><br></div><div>Specifically, including</div><div><br></div><div><div>  '-a', '~/Documents/fieldtrip/external/spm8/spm.m', ...</div><div>        '-a', '~/Documents/fieldtrip/external/spm8/templates/T1.nii', ...</div><div>        '-a', '~/Documents/fieldtrip/external/freesurfer/MRIread', ...</div><div>        '-a', '~/code/Tools/spmbug/dim.m', ...</div><div>        '-a', '~/code/Tools/spmbug/dtype.m', ...</div><div>        '-a', '~/code/Tools/spmbug/fname.m', ...</div><div>        '-a', '~/code/Tools/spmbug/offset.m', ...</div><div>        '-a', '~/code/Tools/spmbug/scl_slope.m', ...</div><div>        '-a', '~/code/Tools/spmbug/scl_inter.m', ...</div><div>        '-a', '~/code/Tools/spmbug/permission.m', ...</div><div>        '-a', '~/code/Tools/spmbug/niftistruc.m', ...</div><div>        '-a', '~/code/Tools/spmbug/read_hdr.m', ...</div><div>        '-a', '~/code/Tools/spmbug/getdict.m', ...</div><div>        '-a', '~/code/Tools/spmbug/read_extras.m', ...</div><div>        '-a', '~/code/Tools/spmbug/read_hdr_raw.m', ...</div></div><div><br></div><div>does the trick.</div><div><br></div><div>Happy compiling,</div><div>Anne</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 March 2017 at 19:38, Anne Urai <span dir="ltr"><<a href="mailto:anne.urai@gmail.com" target="_blank">anne.urai@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hi FieldTrippers,</div><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I compile my code to run on the supercomputer cluster (without many matlab licenses), which usually works fine when I do something like:</div><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>addpath('~/Documents/<wbr>fieldtrip');</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>ft_defaults; </i></div><div><div><i>addpath('~/Documents/<wbr>fieldtrip/external/spm8');</i></div></div><div><div><i>mcc('-mv', '-N', '-p', 'stats', '-p', 'images', '-p', 'signal', ...</i></div><div><i>     '-R', '-nodisplay', '-R', '-singleCompThread', fname);</i></div></div><div><br></div><div>However, compiling the ft_volumenormalise function gives me some problems. Specifically, if source is the result of my beamformer analysis, this code</div><div><br></div><div><div><i>  cfg                       <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap">               </span>= [];</i></div><div><i>  cfg.parameter             <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap">       </span>= 'pow';</i></div><div><i>  cfg.nonlinear             <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap">    </span>= 'no'; % can warp back to individual</i></div><div><i>  cfg.template              <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap">      </span>= '/home/aeurai/Documents/<wbr>fieldtrip/external/spm8/<wbr>templates/T1.nii';</i></div><div><i>  cfg.write                 <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap">        </span>= 'no';</i></div><div><i>  cfg.keepinside            <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap">     </span>= 'no'; % otherwise, ft_sourcegrandaverage will bug</i></div><div><i>  source                    <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap">     </span>= ft_volumenormalise(cfg, source);</i></div></div></div><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">works fine when running it within Matlab. However, when I run the executable after compiling (which completes without error), a low-level spm function throws the following error:</div><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="m_-8320523568435017042bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>the input is source data with 16777216 brainordinates on a [256 256 256] grid</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Warning: could not reshape "freq" to the expected dimensions</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>> In ft_datatype_volume (line 136)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>In ft_checkdata (line 350)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>In ft_volumenormalise (line 98)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>In B6b_sourceContrast_<wbr>volNormalise (line 57)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Converting the coordinate system from ctf to spm</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Undefined function 'fname' for input arguments of type 'struct'</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in file_array (line 32)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in spm_create_vol>create_vol (line 77)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in spm_create_vol (line 16)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in volumewrite_spm (line 71)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in ft_write_mri (line 65)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in align_ctf2spm (line 168)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in ft_convert_coordsys (line 95)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in ft_volumenormalise (line 124)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>Error in B6b_sourceContrast_<wbr>volNormalise (line 57)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px"><i>MATLAB:UndefinedFunction</i></div></div><div><br></div><div>I'd be very grateful for hints from anyone who's successfully compiled the ft_normalise function! Adding the template T1.nii file, spm8 or freesurfer at compilation does not solve the problem.</div><div>Thanks,</div><br><div id="m_-8320523568435017042bloop_sign_1488393070856733952" class="m_-8320523568435017042bloop_sign"><div style="font-family:helvetica,arial;font-size:13px"><div>— </div><div><span style="font-family:'helvetica Neue',helvetica">Anne E. Urai, MSc</span></div><div><span style="font-family:'helvetica Neue',helvetica">PhD student | Institut für Neurophysiologie und Pathophysiologie </span></div><div><span style="font-family:'helvetica Neue',helvetica">Universitätsklinikum Hamburg-Eppendorf | </span><span style="font-family:'helvetica Neue',helvetica">Martinistrasse 52, 20246 | Hamburg, Germany </span></div><div><span style="font-family:'helvetica Neue',helvetica"><a href="http://www.anneurai.net" target="_blank">www.anneurai.net</a> / </span><a href="https://twitter.com/AnneEUrai" target="_blank"><span style="font-family:'helvetica Neue',helvetica">@AnneEUrai</span></a></div></div></div></div></blockquote></div><br></div>