[FieldTrip] Error in ft_sourceinterpolate

fosco bernasconi fosco.bernasconi at gmail.com
Mon Mar 28 16:37:57 CEST 2016


Hi Jan-Mathijs,

this is exactly what I end up using. Alternatively, I also created
source.nai = avg.nai, which is working as well.

I do have another short question, when using the ft_source2full I have some
matab errors (which I guess it may be due to the changes in the source
structure occurred in 2015, could it be?), I decided to skip ft_source2sparse
and therefore ft_source2full (because I have the computational power to do
so), this should not affect my connectivity results, right?

Thanks a lot!
fosco




2016-03-25 9:58 GMT+01:00 Schoffelen, J.M. (Jan Mathijs) <
jan.schoffelen at donders.ru.nl>:

> 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>
> 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
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
>
> _______________________________________________
> fieldtrip mailing list
> 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/20160328/9b51ed49/attachment-0002.html>


More information about the fieldtrip mailing list