[FieldTrip] compiling ft_volumenormalise

Guillaume Flandin g.flandin at ucl.ac.uk
Mon Apr 3 18:36:42 CEST 2017


Dear Anne,

The way we compile SPM is to use the '-a' flag as you did but with a
directory instead of individual files (e.g. '-a',
'~/Documents/fieldtrip/'); by doing so, all the files from the specified
directory as well as all the files from subdirectories will be included
so that you don't have to rely on the automatic file dependency analysis
mcc performs.

Best regards,
Guillaume.


On 15/03/17 12:29, Anne Urai 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
> 

-- 
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG



More information about the fieldtrip mailing list