[FieldTrip] compiling ft_volumenormalise

Robert Oostenveld r.oostenveld at donders.ru.nl
Fri Apr 7 09:21:07 CEST 2017


Hi Anne

I opened this feature request http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2787 <http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2787> some time back. I made an initial implementation in a separate branch at
 https://github.com/robertoostenveld/fieldtrip/tree/bug2787-standalone <https://github.com/robertoostenveld/fieldtrip/tree/bug2787-standalone> 

If you look at https://github.com/fieldtrip/fieldtrip/compare/master...robertoostenveld:bug2787-standalone <https://github.com/fieldtrip/fieldtrip/compare/master...robertoostenveld:bug2787-standalone> you can see the changes. It follows the strategy that we used for the compiled megconnectome application for the human connectome project (see https://www.humanconnectome.org/documentation/HCP-pipelines/meg-pipeline.html <https://www.humanconnectome.org/documentation/HCP-pipelines/meg-pipeline.html>), 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.

best
Robert

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 http://www.fieldtriptoolbox.org/faq#distributed_computing <http://www.fieldtriptoolbox.org/faq#distributed_computing>






> On 15 Mar 2017, at 13:29, Anne Urai <anne.urai at gmail.com> wrote:
> 
> 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).
> 
> Specifically, including
> 
>   '-a', '~/Documents/fieldtrip/external/spm8/spm.m', ...
>         '-a', '~/Documents/fieldtrip/external/spm8/templates/T1.nii', ...
>         '-a', '~/Documents/fieldtrip/external/freesurfer/MRIread', ...
>         '-a', '~/code/Tools/spmbug/dim.m', ...
>         '-a', '~/code/Tools/spmbug/dtype.m', ...
>         '-a', '~/code/Tools/spmbug/fname.m', ...
>         '-a', '~/code/Tools/spmbug/offset.m', ...
>         '-a', '~/code/Tools/spmbug/scl_slope.m', ...
>         '-a', '~/code/Tools/spmbug/scl_inter.m', ...
>         '-a', '~/code/Tools/spmbug/permission.m', ...
>         '-a', '~/code/Tools/spmbug/niftistruc.m', ...
>         '-a', '~/code/Tools/spmbug/read_hdr.m', ...
>         '-a', '~/code/Tools/spmbug/getdict.m', ...
>         '-a', '~/code/Tools/spmbug/read_extras.m', ...
>         '-a', '~/code/Tools/spmbug/read_hdr_raw.m', ...
> 
> does the trick.
> 
> Happy compiling,
> Anne
> 
> On 1 March 2017 at 19:38, Anne Urai <anne.urai at gmail.com <mailto:anne.urai at gmail.com>> wrote:
> Hi FieldTrippers,
> 
> I compile my code to run on the supercomputer cluster (without many matlab licenses), which usually works fine when I do something like:
> 
> addpath('~/Documents/fieldtrip');
> ft_defaults; 
> addpath('~/Documents/fieldtrip/external/spm8');
> mcc('-mv', '-N', '-p', 'stats', '-p', 'images', '-p', 'signal', ...
>      '-R', '-nodisplay', '-R', '-singleCompThread', fname);
> 
> However, compiling the ft_volumenormalise function gives me some problems. Specifically, if source is the result of my beamformer analysis, this code
> 
>   cfg                       		= [];
>   cfg.parameter             	= 'pow';
>   cfg.nonlinear             	= 'no'; % can warp back to individual
>   cfg.template              	= '/home/aeurai/Documents/fieldtrip/external/spm8/templates/T1.nii';
>   cfg.write                 	= 'no';
>   cfg.keepinside            	= 'no'; % otherwise, ft_sourcegrandaverage will bug
>   source                    	= ft_volumenormalise(cfg, source);
> 
> 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:
> 
> the input is source data with 16777216 brainordinates on a [256 256 256] grid
> Warning: could not reshape "freq" to the expected dimensions
> > In ft_datatype_volume (line 136)
> In ft_checkdata (line 350)
> In ft_volumenormalise (line 98)
> In B6b_sourceContrast_volNormalise (line 57)
> Converting the coordinate system from ctf to spm
> Undefined function 'fname' for input arguments of type 'struct'
> Error in file_array (line 32)
> Error in spm_create_vol>create_vol (line 77)
> Error in spm_create_vol (line 16)
> Error in volumewrite_spm (line 71)
> Error in ft_write_mri (line 65)
> Error in align_ctf2spm (line 168)
> Error in ft_convert_coordsys (line 95)
> Error in ft_volumenormalise (line 124)
> Error in B6b_sourceContrast_volNormalise (line 57)
> MATLAB:UndefinedFunction
> 
> 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.
> Thanks,
> 
>> Anne E. Urai, MSc
> PhD student | Institut für Neurophysiologie und Pathophysiologie 
> Universitätsklinikum Hamburg-Eppendorf | Martinistrasse 52, 20246 | Hamburg, Germany 
> www.anneurai.net <http://www.anneurai.net/> / @AnneEUrai <https://twitter.com/AnneEUrai>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170407/93120705/attachment.html>


More information about the fieldtrip mailing list