<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="">
Dear Alex,
<div class=""><br class="">
</div>
<div class="">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).</div>
<div class=""><br class="">
</div>
<div class="">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).</div>
<div class=""><br class="">
</div>
<div class="">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: <a href="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" originalsrc="https://pubmed.ncbi.nlm.nih.gov/34890794/" shash="zSNGkLcZs3sIEaOoJT8WvStz+TU3s1wvDM/ZI22HUzPPRlJAqyglehrD19IpN9UI8acRqATXIUKQ2RH/nf55HPAhW0rXsVcxrvYNp1sRIppxDDfiVVk9iBl1LS9tz92iWcasAH2C+9bXG0DTYCG9QLGPSbq1sqFjs8Qxc3Pi9pQ=" class="">https://pubmed.ncbi.nlm.nih.gov/34890794/</a>.
Some hands-on info is given here: <a href="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" originalsrc="https://www.fieldtriptoolbox.org/workshop/paris2019/handson_sourceanalysis/" shash="rirg9By2sQWfCvObZbBePWZ20twaHmTPPuH3HthflKsxNiMmpL3WFWTazYw8C9aJkspkHHifO1/jeYiGLa0baVTMHxXROEE2BLgvD6sF/7hho6gxuUOhCherLKs3m8T32do5s+moNrWGgR830oKwFfZsREOhExpcgWqW0jsZ3VY=" class="">https://www.fieldtriptoolbox.org/workshop/paris2019/handson_sourceanalysis/</a> (just
forget about the fact that in the tutorial example we used ‘lcmv’, and a cortical sheet constrained sourcemodel, that shouldn’t matter overall).</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 18 Dec 2023, at 20:22, Alexandra Kathrin Steina via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Dear Fieldtrip community,<br class="">
<br class="">
I am working with MEG and LFP data from patients with Parkinson’s disease/essential tremor.<br class="">
I want to compare how coherence between DBS-targets and cortex changes between tremor and tremor-free epochs at tremor frequency.<br class="">
For this, I’ve calculated coherence between LFPs and MEG and used a dics-beamformer to localize coherent sources.<br class="">
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.<br class="">
I've uploaded images of one example on WeTransfer under the following link: <a href="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" originalsrc="https://we.tl/t-B6dw2hF4aT" shash="RK6Ji8r/CnWDwvTgd01bMigIFaIP+cz5oH6OlH/0L2+kZMuTTsMCXDUCf9OaQsJrysSsJkLONZKWk3WIjhzqqWoHUilg4PudxoOm761GhXIuwctkH1qpm2rQpdEdoQD0aMA3k22i/2NX/2cfL8VYy0IgpkeDqid/JPMQkJNT7dc=" class="">
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</a>
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).<br class="">
In addition, the localization seems a bit strange to me, especially when compared with the sensor image.<br class="">
I’ve also applied a common filter, because I thought that it might solve the problem, but it did not.<br class="">
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).<br class="">
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.<br class="">
<br class="">
I would be grateful for advice on why this is happening!<br class="">
<br class="">
Best,<br class="">
Alex<br class="">
<br class="">
Code-snippet I've used:<br class="">
<br class="">
refchannel = 'LFP-right-2B-3B';<br class="">
freqs = 1:35;<br class="">
<br class="">
cfg=[];<br class="">
cfg.method='mtmfft';<br class="">
cfg.output='powandcsd';<br class="">
cfg.taper= 'hanning';<br class="">
cfg.foi = freqs;<br class="">
cfg.keeptrials = 'no';<br class="">
pow_csd_tremor =ft_freqanalysis(cfg,data_seg_tremor);<br class="">
pow_csd_notremor =ft_freqanalysis(cfg,data_seg_notremor);<br class="">
<br class="">
cfg = [];<br class="">
cfg.method = 'coh';<br class="">
coh_tremor = ft_connectivityanalysis(cfg,pow_csd_tremor);<br class="">
coh_notremor = ft_connectivityanalysis(cfg,pow_csd_notremor);<br class="">
<br class="">
cfg = [];<br class="">
cfg.interactive = 'yes';<br class="">
cfg.parameter = 'cohspctrm';<br class="">
cfg.refchannel = refchannel;<br class="">
cfg.layout = 'neuromag306planar.lay';<br class="">
ft_multiplotER(cfg,coh_tremor,coh_notremor);<br class="">
<br class="">
%% dics beamformer<br class="">
<br class="">
common_filter_dics = 1;<br class="">
<br class="">
for f = 1:length(freqs)<br class="">
<br class="">
dat_appended = ft_appenddata([],data_seg_tremor,data_seg_notremor);<br class="">
<br class="">
cfg = [];<br class="">
cfg.method = 'mtmfft';<br class="">
cfg.output = 'powandcsd';<br class="">
cfg.foi = freqs(f);<br class="">
cfg.taper = 'hanning';<br class="">
cfg.keeptrials = 'yes';<br class="">
freq_tremor = ft_freqanalysis(cfg,data_seg_tremor);<br class="">
freq_notremor = ft_freqanalysis(cfg,data_seg_notremor);<br class="">
freq_appended = ft_freqanalysis(cfg,dat_appended);<br class="">
<br class="">
cfg=[];<br class="">
cfg.method='dics';<br class="">
cfg.dics.lambda='5%';<br class="">
cfg.dics.keepcsd = 'yes';<br class="">
cfg.dics.keepfilter = 'yes';<br class="">
cfg.dics.reafilter = 'yes';<br class="">
cfg.frequency = freqs(f);<br class="">
cfg.channel = 'MEG';<br class="">
cfg.headmodel=hdm;<br class="">
cfg.sourcemodel=grid;<br class="">
cfg.reducerank=2;<br class="">
cfg.refchan = refchannel;<br class="">
source_appended_forfilter = ft_sourceanalysis(cfg, freq_appended);<br class="">
<br class="">
<br class="">
cfg=[];<br class="">
cfg.method='dics';<br class="">
cfg.dics.lambda='5%';<br class="">
cfg.dics.keepcsd = 'yes';<br class="">
cfg.headmodel=hdm;<br class="">
cfg.sourcemodel=grid;<br class="">
cfg.frequency = freqs(f);<br class="">
cfg.channel = 'MEG';<br class="">
cfg.reducerank=2;<br class="">
cfg.refchan = refchannel;<br class="">
if common_filter_dics == 1<br class="">
cfg.sourcemodel.filter = source_appended_forfilter.avg.filter;<br class="">
cfg.sourcemodel.label = source_appended_forfilter.avg.label;<br class="">
end<br class="">
source_tremor_dics{f}= ft_sourceanalysis(cfg, freq_tremor);<br class="">
source_tremor_dics{f}.pos = template_grid.pos;<br class="">
source_tremor_dics{f}.dim = template_grid.dim;<br class="">
source_notremor_dics{f}= ft_sourceanalysis(cfg, freq_notremor);<br class="">
source_notremor_dics{f}.pos = template_grid.pos;<br class="">
source_notremor_dics{f}.dim = template_grid.dim;<br class="">
<br class="">
end<br class="">
<br class="">
%% plot all results<br class="">
<br class="">
freq_to_plot = 4;<br class="">
<br class="">
cfg = [];<br class="">
cfg.parameter = 'coh';<br class="">
cfg.interpmethod = 'cubic';<br class="">
it_tremor_dics = ft_sourceinterpolate(cfg,source_tremor_dics{freq_to_plot},t1);<br class="">
it_notremor_dics = ft_sourceinterpolate(cfg,source_notremor_dics{freq_to_plot},t1);<br class="">
<br class="">
cfg = [];<br class="">
cfg.method = 'ortho';<br class="">
cfg.funparameter = 'coh';<br class="">
cfg.maskparameter = 'coh';<br class="">
cfg.interactive = 'yes';<br class="">
figure;<br class="">
cfg.funcolorlim = [0 max(it_tremor_dics.coh)];<br class="">
ft_sourceplot(cfg,it_tremor_dics);<br class="">
cfg.funcolorlim = [0 max(it_notremor_dics.coh)];<br class="">
ft_sourceplot(cfg,it_notremor_dics);<br class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="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" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="JpWHtfV6Xg2yGP5o2imqXnDr2ZBq4JYr2BNpahDal8jjhE3s/6Ziil0RRNegWtP4tusshdBZuOGDXNhqK9fyKRKg/YOMISYpqutywODe3UbQdv4T8xBVRcUKj8Pkj+7UELAf61UIOab7uuYayAqvGD33pJIIH/1KS4eCOVKyebs=" class="">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</a><br class="">
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<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>