[FieldTrip] Error in ft_sourceinterpolate

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Fri Mar 25 09:58:27 CET 2016


Hi Fosco,

What happens if you do cfg.parameter = ‘nai’, rather than cfg.parameter = ‘avg.nai’;?
Best,
Jan-Mathijs

On 18 Mar 2016, at 16:49, fosco bernasconi <fosco.bernasconi at gmail.com<mailto:fosco.bernasconi at gmail.com>> wrote:

Dear all,

I'm trying to compute 'pcc' beamforming source analysis of eeg data, but I have an error when calling ft_sourceinterpolate:

 Reference to non-existent field 'avg'.
Error in getsubfield (line 45)
  s = s.(t{k});
Error in ft_sourceinterpolate (line 209)
  if ~iscell(getsubfield(functional, cfg.parameter{i}))


If I check my source structure I do have the avg field.

source =
freq: 10
cumtapcnt: [157x1 double]
dim: [18 21 18]
inside: [6804x1 logical]
pos: [6804x3 double]
method: 'average'
avg: [1x1 struct]
cfg: [1x1 struct]


Any suggestion?

Thank you for your help!
Best,
fosco


here the rest of my code:


load('standard_bem.mat');
load('standard_sourcemodel3d10mm.mat');

templatefile = '/home/sv/Matlabtoolboxes/fieldtrip-20160306/template/anatomy/single_subj_T1.nii';
template_mri = ft_read_mri(templatefile);
template_mri = ft_convert_units(template_mri,'mm');
template_mri.coordsys = 'spm';

cfg = [];
cfg.grid.warpmni = 'yes';
cfg.grid.template  = sourcemodel;
cfg.grid.nonlinear = 'yes'; % use non-linear normalization
cfg.mri      = template_mri;
sourcemodel  = ft_prepare_sourcemodel(cfg,freq);
sourcemodel  = ft_convert_units(sourcemodel,'mm');

cfg         = [];
cfg.elec    = sens;
cfg.channel = sens.label;
cfg.headmodel = vol;
cfg.grid      = sourcemodel;
cfg.grid.unit = 'mm';% same unit as above, i.e. in cm
lf = ft_prepare_leadfield(cfg,freq);

cfg            = [];
cfg.method     = 'mtmfft';
cfg.output     = 'fourier';
cfg.keeptrials = 'yes';
cfg.tapsmofrq  = 2;
cfg.foi        = 10;
freq           = ft_freqanalysis(cfg,dataft{1,1});

% compute source reconstruction
cfg   = [];
cfg.frequency = freq.freq;
cfg.method    = 'pcc';
cfg.grid         = lf;
cfg.headmodel         = vol;
cfg.keeptrials        = 'yes';
cfg.pcc.lambda        = '5%';
cfg.pcc.projectnoise  = 'yes';
source = ft_sourceanalysis(cfg,freq);

cfg = [];
cfg.projectmom = 'yes';
source_proj = ft_sourcedescriptives(cfg,source);

% and provide  mni template
source_proj.dim = sourcemodel.dim;
source_proj.pos = sourcemodel.pos;

cfg  = [];
cfg.voxelcoord   = 'no';
cfg.parameter    = 'avg.nai';
source_int  = ft_sourceinterpolate(cfg,source,template_mri);

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip


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


More information about the fieldtrip mailing list