[FieldTrip] Results from source analysis with different fieldtrip versions differ!?

Alexandra Steina Alexandra.Steina at uni-duesseldorf.de
Wed Nov 4 13:38:19 CET 2020


Hello everyone,

I used the following pipeline to perform a source analysis on MEG-LFP 
data. I noticed different results when using different Fieldtrip 
Versions for the exact same data and analysis pipeline.
I read that there was a bug in the 'ft_prepare_leadfield' function in 
the release of June and it says that the bug was fixed, but I got some 
weird results when doing dics source reconstruction on the MEG data with 
the Fieldtrip releases from August on (I also just tried the release 
from yesterday). I attached some sourceplots (all from the exact same 
data) that are all done with a different Fieldtrip Version.
Does anyone know if there is still a bug in the newest fieldtrip 
releases or why these differences occur?

     mri  = ft_read_mri(mri_path);
     mri.anatomy=double(mri.anatomy);
     fidu = importdata([fidu_path,'fiducial.txt']);
     cfg=[];
     cfg.coordsys='neuromag';
     cfg.method = 'fiducial';
     cfg.fiducial.nas    = fidu.data(2,:);
     cfg.fiducial.lpa    = fidu.data(3,:);
     cfg.fiducial.rpa    = fidu.data(1,:);
     real_mri=ft_volumerealign(cfg,mri);

     cfg                = [];
     cfg.keepintermediate = 'no';
     cfg.write          = 'no';
     cfg.name          = [folder_intermediate,'spmtmp'];
     segmentedmri   = ft_volumesegment(cfg, real_mri);

     cfg                = [];
     cfg.method = 'singleshell';
     hdm                = ft_prepare_headmodel(cfg,segmentedmri);
     hdm = ft_convert_units(hdm,'cm');

     template = 
load(fullfile('fieldtrip/template/sourcemodel/standard_sourcemodel3d10mm'));

     cfg                = [];
     cfg.grid.warpmni   = 'yes';
     cfg.grid.template  = template.sourcemodel;  % template_grid
     cfg.grid.nonlinear = 'yes';
     cfg.mri            = real_mri;
     cfg.grid.unit      ='cm';
     grid               = ft_prepare_sourcemodel(cfg);

     cfg = [];
     cfg.dataset = dataset;
     cfg.dftfilter = 'yes';
     cfg.trl = trl;
     cfg.channel = 
['MEG***2','MEG***3',Info_et.(subj).(cond).(file).bad_meg];
     meg = ft_preprocessing(cfg);


     cfg = [];
     cfg.dataset = dataset;
     cfg.dftfilter = 'yes';
     cfg.trl = trl;
     cfg.channel = Info_et.(subj).(cond).(file).old_lfp_labels;
     cfg.montage = Info_et.(subj).(cond).(file).montage;
     lfp = ft_preprocessing(cfg);

    data = ft_appenddata([],meg,lfp);

     cfg = [];
     cfg.length = 1;
     cfg.overlap = 0.5;
     data_seg = ft_redefinetrial(cfg,data);


     centerfreq = 12;
     chan = ‘LFP-right-1-2A’;
     bandwidth = 2;

     cfg = [];
     cfg.method = 'mtmfft';
     cfg.output = 'powandcsd';
     cfg.foi = centerfreq;
     cfg.tapsmofrq = bandwidth;
     cfg.keeptrials = 'yes';
     freq = ft_freqanalysis(cfg,data_seg);

     cfg=[];
     cfg.method='dics';
     cfg.dics.lambda='5%';
     cfg.headmodel=hdm;
     cfg.sourcemodel=grid;
     cfg.frequency = centerfreq;
     cfg.reducerank=2;
     cfg.refchan = chan;
     source=ft_sourceanalysis(cfg,freq);
     source.pos = template.sourcemodel.pos;
     source.dim = template.sourcemodel.dim;

     [maxval, maxcohindx] = max(source.avg.coh);
     max_pos = source.pos(maxcohindx, :);

      cfg = [];
      cfg.parameter = 'coh';
      cfg.interpmethod        = 'nearest';
      it = ft_sourceinterpolate(cfg,source,p); % p

      cfg =  [];
      cfg.method = ‘ortho’;
      cfg.funparameter = 'coh';
      cfg.maskparameter = 'coh';
      ft_sourceplot(cfg,it);

Thanks and greetings,
Alexandra Steina
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_2019.png
Type: image/png
Size: 85514 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201104/89e1233c/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_april2020.png
Type: image/png
Size: 85514 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201104/89e1233c/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_june2020.png
Type: image/png
Size: 85178 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201104/89e1233c/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_november2020.png
Type: image/png
Size: 83671 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201104/89e1233c/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_october2020.png
Type: image/png
Size: 83503 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201104/89e1233c/attachment-0009.png>


More information about the fieldtrip mailing list