<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 Fosco,<br class="">
<div>
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class=""><br class="">
</div>
<div class="">What happens if you do cfg.parameter = ‘nai’, rather than cfg.parameter = ‘avg.nai’;?</div>
<div class="">Best,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div style="direction: ltr;" class="">
<blockquote type="cite" class="">
<div class="">On 18 Mar 2016, at 16:49, fosco bernasconi <<a href="mailto:fosco.bernasconi@gmail.com" class="">fosco.bernasconi@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">Dear all, <br class="">
<br class="">
</div>
I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I have an error when calling ft_sourceinterpolate:<br class="">
<br class="">
<i class=""> Reference to non-existent field 'avg'.<br class="">
Error in getsubfield (line 45)<br class="">
s = s.(t{k});<br class="">
Error in ft_sourceinterpolate (line 209)<br class="">
if ~iscell(getsubfield(functional, cfg.parameter{i}))</i><br class="">
<br class="">
<br class="">
</div>
If I check my source structure I do have the avg field. <br class="">
<br class="">
source = <br class="">
freq: 10<br class="">
cumtapcnt: [157x1 double]<br class="">
dim: [18 21 18]<br class="">
inside: [6804x1 logical]<br class="">
pos: [6804x3 double]<br class="">
method: 'average'<br class="">
avg: [1x1 struct]<br class="">
cfg: [1x1 struct]<br class="">
<br class="">
<br class="">
</div>
Any suggestion? <br class="">
<br class="">
</div>
Thank you for your help!<br class="">
</div>
Best,<br class="">
</div>
fosco<br class="">
<br class="">
<br class="">
</div>
here the rest of my code:<br class="">
<br class="">
<br class="">
load('standard_bem.mat');<br class="">
load('standard_sourcemodel3d10mm.mat');<br class="">
<br class="">
templatefile = '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii';<br class="">
template_mri = ft_read_mri(templatefile);<br class="">
template_mri = ft_convert_units(template_mri,'mm');<br class="">
template_mri.coordsys = 'spm';<br class="">
<br class="">
cfg = [];<br class="">
cfg.grid.warpmni = 'yes';<br class="">
cfg.grid.template = sourcemodel;<br class="">
cfg.grid.nonlinear = 'yes'; % use non-linear normalization<br class="">
cfg.mri = template_mri;<br class="">
sourcemodel = ft_prepare_sourcemodel(cfg,freq);<br class="">
sourcemodel = ft_convert_units(sourcemodel,'mm');<br class="">
<br class="">
cfg = [];<br class="">
cfg.elec = sens;<br class="">
cfg.channel = sens.label;<br class="">
cfg.headmodel = vol;<br class="">
cfg.grid = sourcemodel;<br class="">
cfg.grid.unit = 'mm';% same unit as above, i.e. in cm<br class="">
lf = ft_prepare_leadfield(cfg,freq);<br class="">
<br class="">
cfg = [];<br class="">
cfg.method = 'mtmfft';<br class="">
cfg.output = 'fourier';<br class="">
cfg.keeptrials = 'yes';<br class="">
cfg.tapsmofrq = 2;<br class="">
cfg.foi = 10;<br class="">
freq = ft_freqanalysis(cfg,dataft{1,1});<br class="">
<br class="">
% compute source reconstruction<br class="">
cfg = [];<br class="">
cfg.frequency = freq.freq;<br class="">
cfg.method = 'pcc';<br class="">
cfg.grid = lf;<br class="">
cfg.headmodel = vol;<br class="">
cfg.keeptrials = 'yes';<br class="">
cfg.pcc.lambda = '5%';<br class="">
cfg.pcc.projectnoise = 'yes';<br class="">
source = ft_sourceanalysis(cfg,freq);<br class="">
<br class="">
cfg = [];<br class="">
cfg.projectmom = 'yes';<br class="">
source_proj = ft_sourcedescriptives(cfg,source);<br class="">
<br class="">
% and provide mni template <br class="">
source_proj.dim = sourcemodel.dim;<br class="">
source_proj.pos = sourcemodel.pos;<br class="">
<br class="">
cfg = [];<br class="">
cfg.voxelcoord = 'no';<br class="">
cfg.parameter = 'avg.nai';<br class="">
source_int = ft_sourceinterpolate(cfg,source,template_mri);<br class="">
<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="">
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
<br class="">
</body>
</html>