[FieldTrip] Help with beamformer localizing tremor-coherence peaks

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Tue Dec 19 17:58:19 CET 2023


Dear Alex,

Uhm, it’s difficult to comment why your script would work on the beta band data, and not on the theta band data (where the value of coherence seem to be much higher).

Actually,m I am a bit surprised that the script you copied into the e-mail works more or less well for the beta band coherence. (Oh and before I forget, there’s a small typo cfg.dics.reafilter should read cfg.dics.realfilter, but that’s probably not going to solve it).

The reason of my surprise, is that beamforming on Elekta data typically does not work really well if you just use some mild ‘lambda’ regularisation, specifically if you use maxfiltered data and/or combine magnetometers and gradiometers. Maxfiltered data is highly rank deficient, which typically requires a slightly different heurstic for regularisation, and combined mag/grad data should be handled with a little bit of care, given that the respective signals are on a very different scale. How to best deal with these issues is for instance described here: https://pubmed.ncbi.nlm.nih.gov/34890794/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpubmed.ncbi.nlm.nih.gov%2F34890794%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C1608eefc088d488eb35008dc00b3b404%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638386019011248683%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uQmumk0sm5aVFd8jtzyHoxZg0joerp0r5O%2Bugolmb78%3D&reserved=0>. Some hands-on info is given here: https://www.fieldtriptoolbox.org/workshop/paris2019/handson_sourceanalysis/<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.fieldtriptoolbox.org%2Fworkshop%2Fparis2019%2Fhandson_sourceanalysis%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C1608eefc088d488eb35008dc00b3b404%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638386019011248683%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MXgE7UX002EaSOnBU8ytD%2Fx6H9YPy3ZWGEUPdosisPg%3D&reserved=0> (just forget about the fact that in the tutorial example we used ‘lcmv’, and a cortical sheet constrained sourcemodel, that shouldn’t matter overall).

Best wishes,
Jan-Mathijs



On 18 Dec 2023, at 20:22, Alexandra Kathrin Steina via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear Fieldtrip community,

I am working with MEG and LFP data from patients with Parkinson’s disease/essential tremor.
I want to compare how coherence between DBS-targets and cortex changes between tremor and tremor-free epochs at tremor frequency.
For this, I’ve calculated coherence between LFPs and MEG and used a dics-beamformer to localize coherent sources.
I have encountered something that I find weird/confusing when localizing the tremor-coherence peaks (LFP-MEG coherence at tremor frequency) of most of the subjects.
I've uploaded images of one example on WeTransfer under the following link: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwe.tl%2Ft-B6dw2hF4aT&data=05%7C02%7Cjanmathijs.schoffelen%40donders.ru.nl%7C6118e6fdd6f34d13d4f408dc000261fe%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638385257435950519%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=tSnUMDidX42D04I5Lez55pbkGJZei1CeS1R6kYcMXhs%3D&reserved=0<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwe.tl%2Ft-B6dw2hF4aT&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C1608eefc088d488eb35008dc00b3b404%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638386019011248683%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Lsd1xPOJ2Eb7bgK%2BhxA3rJXO%2BfwR1WKSK5VVv4fQp5I%3D&reserved=0> On sensor-level there is a clear peak visible at tremor frequency which is absent during no-tremor (figure 1). From what I see on sensor-level I would expect to also see much higher activity on source-level and a clear localization. However, when I apply dics-beamformer the maximal coherence value for the tremor-epochs is much lower, than for the tremor-free epochs (figure 2).
In addition, the localization seems a bit strange to me, especially when compared with the sensor image.
I’ve also applied a common filter, because I thought that it might solve the problem, but it did not.
I’ve used the exact same pipeline and exact same script to localize coherence between LFP and MEG at eg. high-beta or alpha frequencies and it gives me “good” results (see image 3, data from a different subject which did not have tremor).
I have used ‘fieldtrip-20201214‘ to generate the images, but have also tried fieldtrip versions from 2018 to the most recent one, all yielding similar results.

I would be grateful for advice on why this is happening!

Best,
Alex

Code-snippet I've used:

   refchannel = 'LFP-right-2B-3B';
   freqs = 1:35;

   cfg=[];
   cfg.method='mtmfft';
   cfg.output='powandcsd';
   cfg.taper= 'hanning';
   cfg.foi = freqs;
   cfg.keeptrials = 'no';
   pow_csd_tremor =ft_freqanalysis(cfg,data_seg_tremor);
   pow_csd_notremor =ft_freqanalysis(cfg,data_seg_notremor);

   cfg = [];
   cfg.method = 'coh';
   coh_tremor = ft_connectivityanalysis(cfg,pow_csd_tremor);
   coh_notremor = ft_connectivityanalysis(cfg,pow_csd_notremor);

   cfg = [];
   cfg.interactive = 'yes';
   cfg.parameter = 'cohspctrm';
   cfg.refchannel = refchannel;
   cfg.layout = 'neuromag306planar.lay';
   ft_multiplotER(cfg,coh_tremor,coh_notremor);

   %% dics beamformer

   common_filter_dics = 1;

   for f = 1:length(freqs)

       dat_appended = ft_appenddata([],data_seg_tremor,data_seg_notremor);

       cfg = [];
       cfg.method = 'mtmfft';
       cfg.output = 'powandcsd';
       cfg.foi = freqs(f);
       cfg.taper = 'hanning';
       cfg.keeptrials = 'yes';
       freq_tremor = ft_freqanalysis(cfg,data_seg_tremor);
       freq_notremor = ft_freqanalysis(cfg,data_seg_notremor);
       freq_appended = ft_freqanalysis(cfg,dat_appended);

       cfg=[];
       cfg.method='dics';
       cfg.dics.lambda='5%';
       cfg.dics.keepcsd = 'yes';
       cfg.dics.keepfilter = 'yes';
       cfg.dics.reafilter = 'yes';
       cfg.frequency = freqs(f);
       cfg.channel = 'MEG';
       cfg.headmodel=hdm;
       cfg.sourcemodel=grid;
       cfg.reducerank=2;
       cfg.refchan = refchannel;
       source_appended_forfilter = ft_sourceanalysis(cfg, freq_appended);


       cfg=[];
       cfg.method='dics';
       cfg.dics.lambda='5%';
       cfg.dics.keepcsd = 'yes';
       cfg.headmodel=hdm;
       cfg.sourcemodel=grid;
       cfg.frequency = freqs(f);
       cfg.channel = 'MEG';
       cfg.reducerank=2;
       cfg.refchan = refchannel;
       if common_filter_dics == 1
           cfg.sourcemodel.filter = source_appended_forfilter.avg.filter;
           cfg.sourcemodel.label = source_appended_forfilter.avg.label;
       end
       source_tremor_dics{f}= ft_sourceanalysis(cfg, freq_tremor);
       source_tremor_dics{f}.pos = template_grid.pos;
       source_tremor_dics{f}.dim = template_grid.dim;
       source_notremor_dics{f}= ft_sourceanalysis(cfg, freq_notremor);
       source_notremor_dics{f}.pos = template_grid.pos;
       source_notremor_dics{f}.dim = template_grid.dim;

   end

   %% plot all results

   freq_to_plot = 4;

   cfg = [];
   cfg.parameter = 'coh';
   cfg.interpmethod        = 'cubic';
   it_tremor_dics = ft_sourceinterpolate(cfg,source_tremor_dics{freq_to_plot},t1);
   it_notremor_dics = ft_sourceinterpolate(cfg,source_notremor_dics{freq_to_plot},t1);

   cfg =  [];
   cfg.method = 'ortho';
   cfg.funparameter = 'coh';
   cfg.maskparameter = 'coh';
   cfg.interactive = 'yes';
   figure;
   cfg.funcolorlim = [0 max(it_tremor_dics.coh)];
   ft_sourceplot(cfg,it_tremor_dics);
   cfg.funcolorlim = [0 max(it_notremor_dics.coh)];
   ft_sourceplot(cfg,it_notremor_dics);
_______________________________________________
fieldtrip mailing list
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cjanmathijs.schoffelen%40donders.ru.nl%7C6118e6fdd6f34d13d4f408dc000261fe%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638385257435950519%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=6lm5S02fQCvioafyAUM6r1GI1MeILyBhA4EgKmert30%3D&reserved=0<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C1608eefc088d488eb35008dc00b3b404%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638386019011248683%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=weVdL3rCwfOuerjGp1bxGgFBFcxXIPG2fMkffiNaiak%3D&reserved=0>
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cjanmathijs.schoffelen%40donders.ru.nl%7C6118e6fdd6f34d13d4f408dc000261fe%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638385257435950519%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=IT%2BTdD7oONzOrjCySts00%2FwVENqMUf13WF7zBwGzGO4%3D&reserved=0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231219/57212b98/attachment.htm>


More information about the fieldtrip mailing list