<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<font size="4" class="">Thanks Alexandra,</font>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">This sounds like something that might need to be looked into a bit more thoroughly.</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">I see several possible ways forward. </font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">1) The most straightforward way would be to have one of your local technical experts look along. I might be mistaken, but given your affiliation I have the impression that there might be quite some people around that 1)
 know the MEG system that you are using, and 2) use very similar analyses. Have you already consulted locally, to see whether people have experienced similar issues? Or have you asked people to look along with you, to diagnose the issue a bit further?</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">2) You could file an issue on <a href="https://github.com/fieldtrip/fieldtrip" class="">
https://github.com/fieldtrip/fieldtrip</a>, which at a minimum would include some code and data to reproduce the issue. In itself, this is a little bit less preferred, because in this case one of the developers needs to look into this (individually), (s)he
 might solve and fix it, and report back to you that it has been fixed. The problems I see with this approach is that 1) the person looking into the problem is doing some unrewarding problem solving, and 2) the person whose problem hopefully will be solved
 does not really gain a lot of insight into what was wrong in the first place. </font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">So, I would vote for option 3: why don’t we work on this together?</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">At the DCCN we have a weekly MEEG-‘hackaton’, usually on the Thursday afternoons (15.00-17.00), in which we team up to work on something together. One of these ’something’s could be to fix issues that people are experiencing
 in their analysis pipelines. As such there is no reason to constrain these meetings to local people, so I’d say why don’t you join the club for one of the upcoming meetings? Just drop me a line off-list.</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">Best wishes,</font></div>
<div class=""><font size="4" class=""><br class="">
</font></div>
<div class=""><font size="4" class="">Jan-Mathijs</font></div>
<div class=""><font size="4" class=""><br class="">
</font>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 5 Nov 2020, at 08:27, Alexandra Steina <<a href="mailto:Alexandra.Steina@uni-duesseldorf.de" class="">Alexandra.Steina@uni-duesseldorf.de</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hi  Jan-Mathijs,<br class="">
<br class="">
Thanks for the quick reply.<br class="">
I've checked it for the april and october version and the 'freq' structures are the same.<br class="">
<br class="">
Greetings,<br class="">
Alexandra<br class="">
<br class="">
Am 04.11.2020 um 14:09 schrieb Schoffelen, J.M. (Jan Mathijs):<br class="">
<blockquote type="cite" class="">Hi Alexandra,<br class="">
<br class="">
Hmmm, that’s not good. We have recently tried to clean up the codebase that is doing various inverse calculations, which was indeed around the time at which you identified a change in figure quality. I don’t think this has to do with the leadfield computation.<br class="">
<br class="">
Just as a first step, could you check whether the ‘freq’ structures are the same in the different FieldTrip versions? Just to be sure that indeed the cause of this lies in ft_sourceanalysis or ft_inverse_dics.<br class="">
<br class="">
Best wishes,<br class="">
Jan-Mathijs<br class="">
<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">On 4 Nov 2020, at 13:38, Alexandra Steina <<a href="mailto:Alexandra.Steina@uni-duesseldorf.de" class="">Alexandra.Steina@uni-duesseldorf.de</a>> wrote:<br class="">
<br class="">
Hello everyone,<br class="">
<br class="">
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.<br class="">
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.<br class="">
Does anyone know if there is still a bug in the newest fieldtrip releases or why these differences occur?<br class="">
<br class="">
   mri  = ft_read_mri(mri_path);<br class="">
   mri.anatomy=double(mri.anatomy);<br class="">
   fidu = importdata([fidu_path,'fiducial.txt']);<br class="">
   cfg=[];<br class="">
   cfg.coordsys='neuromag';<br class="">
   cfg.method = 'fiducial';<br class="">
   cfg.fiducial.nas    = fidu.data(2,:);<br class="">
   cfg.fiducial.lpa    = fidu.data(3,:);<br class="">
   cfg.fiducial.rpa    = fidu.data(1,:);<br class="">
   real_mri=ft_volumerealign(cfg,mri);<br class="">
<br class="">
   cfg                = [];<br class="">
   cfg.keepintermediate = 'no';<br class="">
   cfg.write          = 'no';<br class="">
   cfg.name          = [folder_intermediate,'spmtmp'];<br class="">
   segmentedmri   = ft_volumesegment(cfg, real_mri);<br class="">
<br class="">
   cfg                = [];<br class="">
   cfg.method = 'singleshell';<br class="">
   hdm                = ft_prepare_headmodel(cfg,segmentedmri);<br class="">
   hdm = ft_convert_units(hdm,'cm');<br class="">
<br class="">
   template = load(fullfile('fieldtrip/template/sourcemodel/standard_sourcemodel3d10mm'));<br class="">
<br class="">
   cfg                = [];<br class="">
   cfg.grid.warpmni   = 'yes';<br class="">
   cfg.grid.template  = template.sourcemodel;  % template_grid<br class="">
   cfg.grid.nonlinear = 'yes';<br class="">
   cfg.mri            = real_mri;<br class="">
   cfg.grid.unit      ='cm';<br class="">
   grid               = ft_prepare_sourcemodel(cfg);<br class="">
<br class="">
   cfg = [];<br class="">
   cfg.dataset = dataset;<br class="">
   cfg.dftfilter = 'yes';<br class="">
   cfg.trl = trl;<br class="">
   cfg.channel = ['MEG***2','MEG***3',Info_et.(subj).(cond).(file).bad_meg];<br class="">
   meg = ft_preprocessing(cfg);<br class="">
<br class="">
<br class="">
   cfg = [];<br class="">
   cfg.dataset = dataset;<br class="">
   cfg.dftfilter = 'yes';<br class="">
   cfg.trl = trl;<br class="">
   cfg.channel = Info_et.(subj).(cond).(file).old_lfp_labels;<br class="">
   cfg.montage = Info_et.(subj).(cond).(file).montage;<br class="">
   lfp = ft_preprocessing(cfg);<br class="">
<br class="">
  data = ft_appenddata([],meg,lfp);<br class="">
<br class="">
   cfg = [];<br class="">
   cfg.length = 1;<br class="">
   cfg.overlap = 0.5;<br class="">
   data_seg = ft_redefinetrial(cfg,data);<br class="">
<br class="">
<br class="">
   centerfreq = 12;<br class="">
   chan = ‘LFP-right-1-2A’;<br class="">
   bandwidth = 2;<br class="">
<br class="">
   cfg = [];<br class="">
   cfg.method = 'mtmfft';<br class="">
   cfg.output = 'powandcsd';<br class="">
   cfg.foi = centerfreq;<br class="">
   cfg.tapsmofrq = bandwidth;<br class="">
   cfg.keeptrials = 'yes';<br class="">
   freq = ft_freqanalysis(cfg,data_seg);<br class="">
<br class="">
   cfg=[];<br class="">
   cfg.method='dics';<br class="">
   cfg.dics.lambda='5%';<br class="">
   cfg.headmodel=hdm;<br class="">
   cfg.sourcemodel=grid;<br class="">
   cfg.frequency = centerfreq;<br class="">
   cfg.reducerank=2;<br class="">
   cfg.refchan = chan;<br class="">
   source=ft_sourceanalysis(cfg,freq);<br class="">
   source.pos = template.sourcemodel.pos;<br class="">
   source.dim = template.sourcemodel.dim;<br class="">
<br class="">
   [maxval, maxcohindx] = max(source.avg.coh);<br class="">
   max_pos = source.pos(maxcohindx, :);<br class="">
<br class="">
    cfg = [];<br class="">
    cfg.parameter = 'coh';<br class="">
    cfg.interpmethod        = 'nearest';<br class="">
    it = ft_sourceinterpolate(cfg,source,p); % p<br class="">
<br class="">
    cfg =  [];<br class="">
    cfg.method = ‘ortho’;<br class="">
    cfg.funparameter = 'coh';<br class="">
    cfg.maskparameter = 'coh';<br class="">
    ft_sourceplot(cfg,it);<br class="">
<br class="">
Thanks and greetings,<br class="">
Alexandra Steina<ft_2019.png><ft_april2020.png><ft_june2020.png><ft_november2020.png><ft_october2020.png>_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</blockquote>
<br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</blockquote>
<br class="">
<br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>