<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Anne<div class=""><br class=""></div><div class="">I opened this feature request <a href="http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2787" class="">http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2787</a> some time back. I made an initial implementation in a separate branch at</div><div class=""> <a href="https://github.com/robertoostenveld/fieldtrip/tree/bug2787-standalone" class="">https://github.com/robertoostenveld/fieldtrip/tree/bug2787-standalone</a> </div><div class=""><br class=""></div><div class="">If you look at <a href="https://github.com/fieldtrip/fieldtrip/compare/master...robertoostenveld:bug2787-standalone" class="">https://github.com/fieldtrip/fieldtrip/compare/master...robertoostenveld:bug2787-standalone</a> you can see the changes. It follows the strategy that we used for the compiled megconnectome application for the human connectome project (see <a href="https://www.humanconnectome.org/documentation/HCP-pipelines/meg-pipeline.html" class="">https://www.humanconnectome.org/documentation/HCP-pipelines/meg-pipeline.html</a>), i.e. it compiles into an application which can take a script as argument and which “evals” that script. This allows for the flexibility of making changes to the pipeline and cfg settings without having to recompile.</div><div class=""><br class=""></div><div class="">best</div><div class="">Robert</div><div class=""><br class=""></div><div class="">PS If you can use a single interactive MATLAB session on a head node or compute node from the cluster, you can also look into using the ‘compile’ option in qsubcellfun. See <a href="http://www.fieldtriptoolbox.org/faq#distributed_computing" class="">http://www.fieldtriptoolbox.org/faq#distributed_computing</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 15 Mar 2017, at 13:29, Anne Urai <<a href="mailto:anne.urai@gmail.com" class="">anne.urai@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div dir="ltr" class="">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 class=""><br class=""></div><div class="">Specifically, including</div><div class=""><br class=""></div><div class=""><div class=""> '-a', '~/Documents/fieldtrip/external/spm8/spm.m', ...</div><div class=""> '-a', '~/Documents/fieldtrip/external/spm8/templates/T1.nii', ...</div><div class=""> '-a', '~/Documents/fieldtrip/external/freesurfer/MRIread', ...</div><div class=""> '-a', '~/code/Tools/spmbug/dim.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/dtype.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/fname.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/offset.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/scl_slope.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/scl_inter.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/permission.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/niftistruc.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/read_hdr.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/getdict.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/read_extras.m', ...</div><div class=""> '-a', '~/code/Tools/spmbug/read_hdr_raw.m', ...</div></div><div class=""><br class=""></div><div class="">does the trick.</div><div class=""><br class=""></div><div class="">Happy compiling,</div><div class="">Anne</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On 1 March 2017 at 19:38, Anne Urai <span dir="ltr" class=""><<a href="mailto:anne.urai@gmail.com" target="_blank" class="">anne.urai@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div id="m_-8320523568435017042bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">Hi FieldTrippers,</div><div id="m_-8320523568435017042bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><div id="m_-8320523568435017042bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">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; margin: 0px;" class=""><br class=""></div><div id="m_-8320523568435017042bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">addpath('~/Documents/<wbr class="">fieldtrip');</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">ft_defaults; </i></div><div class=""><div class=""><i class="">addpath('~/Documents/<wbr class="">fieldtrip/external/spm8');</i></div></div><div class=""><div class=""><i class="">mcc('-mv', '-N', '-p', 'stats', '-p', 'images', '-p', 'signal', ...</i></div><div class=""><i class=""> '-R', '-nodisplay', '-R', '-singleCompThread', fname);</i></div></div><div class=""><br class=""></div><div class="">However, compiling the ft_volumenormalise function gives me some problems. Specifically, if source is the result of my beamformer analysis, this code</div><div class=""><br class=""></div><div class=""><div class=""><i class=""> cfg <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap"> </span>= [];</i></div><div class=""><i class=""> cfg.parameter <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap"> </span>= 'pow';</i></div><div class=""><i class=""> cfg.nonlinear <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap"> </span>= 'no'; % can warp back to individual</i></div><div class=""><i class=""> cfg.template <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap"> </span>= '/home/aeurai/Documents/<wbr class="">fieldtrip/external/spm8/<wbr class="">templates/T1.nii';</i></div><div class=""><i class=""> cfg.write <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap"> </span>= 'no';</i></div><div class=""><i class=""> cfg.keepinside <span class="m_-8320523568435017042Apple-tab-span" style="white-space:pre-wrap"> </span>= 'no'; % otherwise, ft_sourcegrandaverage will bug</i></div><div class=""><i class=""> 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; margin: 0px;" class=""><br class=""></div><div id="m_-8320523568435017042bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">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; margin: 0px;" class=""><br class=""></div><div id="m_-8320523568435017042bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">the input is source data with 16777216 brainordinates on a [256 256 256] grid</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Warning: could not reshape "freq" to the expected dimensions</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">> In ft_datatype_volume (line 136)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">In ft_checkdata (line 350)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">In ft_volumenormalise (line 98)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">In B6b_sourceContrast_<wbr class="">volNormalise (line 57)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Converting the coordinate system from ctf to spm</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Undefined function 'fname' for input arguments of type 'struct'</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in file_array (line 32)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in spm_create_vol>create_vol (line 77)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in spm_create_vol (line 16)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in volumewrite_spm (line 71)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in ft_write_mri (line 65)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in align_ctf2spm (line 168)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in ft_convert_coordsys (line 95)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in ft_volumenormalise (line 124)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">Error in B6b_sourceContrast_<wbr class="">volNormalise (line 57)</i></div><div id="m_-8320523568435017042bloop_customfont" style="margin:0px" class=""><i class="">MATLAB:UndefinedFunction</i></div></div><div class=""><br class=""></div><div class="">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 class="">Thanks,</div><br class=""><div id="m_-8320523568435017042bloop_sign_1488393070856733952" class="m_-8320523568435017042bloop_sign"><div style="font-family:helvetica,arial;font-size:13px" class=""><div class="">— </div><div class=""><span style="font-family:'helvetica Neue',helvetica" class="">Anne E. Urai, MSc</span></div><div class=""><span style="font-family:'helvetica Neue',helvetica" class="">PhD student | Institut für Neurophysiologie und Pathophysiologie </span></div><div class=""><span style="font-family:'helvetica Neue',helvetica" class="">Universitätsklinikum Hamburg-Eppendorf | </span><span style="font-family:'helvetica Neue',helvetica" class="">Martinistrasse 52, 20246 | Hamburg, Germany </span></div><div class=""><span style="font-family:'helvetica Neue',helvetica" class=""><a href="http://www.anneurai.net/" target="_blank" class="">www.anneurai.net</a> / </span><a href="https://twitter.com/AnneEUrai" target="_blank" class=""><span style="font-family:'helvetica Neue',helvetica" class="">@AnneEUrai</span></a></div></div></div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">fieldtrip mailing list<br class=""><a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div></blockquote></div><br class=""></div></body></html>