[FieldTrip] How to run wpli connectivity analysis of beamformed source data?

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Thu Feb 4 08:52:26 CET 2021


Hi Charly,

The current code does indeed not support the computation of wpli(_debiased) using an input data structure that is of the type ’source’, as you already mentioned.

Yet, there might be a workaround if you convert the output to ft_sourceanalysis (in your pasted code snippet called source) into a representation that is ‘channel-like’. We recently added a function ft_virtualchannel to achieve that conversion. I haven’t tried this for the purpose of a subsequent wpli computation, but it might be worth a shot.

Best wishes,
Jan-Mathijs


On 2 Feb 2021, at 16:43, Billaud, Charly (Research Student) <billaudc at aston.ac.uk<mailto:billaudc at aston.ac.uk>> wrote:

Dear community,

I have been trying to run a connectivity analysis on beamformed source data using the script below with WPLI, but this only works when the method defined for the ft_connectivityanalysis is the coherency (cfg.method = ‘coh’). According to the fieldtrip website, wpli or wpli_debiased exist as methods, but these work only on frequency data (here, the freq variable). The problem is if I run the connectivity analysis on the freq rather than on the source data, I won’t be able to beamform its results using ft_sourceanalysis, since it requires freq data as well. Is it therefore possible to run a connectivity analysis with WPLI while having the data beamformed on a source model?


cfg             = [];
cfg.sourcemodel = sourcemodel;
cfg.headmodel   = headmodel;
lf  = ft_prepare_leadfield(cfg, dataclean);

cfg            = [];
cfg.method     = 'mtmfft';
cfg.output     = 'fourier';
cfg.keeptrials = 'yes';
cfg.tapsmofrq  = 1;
cfg.foi    = [0.5 4];
freq           = ft_freqanalysis(cfg, dataclean);

cfg                   = [];
cfg.frequency         = freq.freq;
cfg.method            = 'pcc';
cfg.grid              = lf;
cfg.headmodel         = headmodel;
cfg.keeptrials        = 'yes';
cfg.pcc.lambda        = '10%';
cfg.pcc.projectnoise  = 'yes';
cfg.pcc.fixedori      = 'yes';
source = ft_sourceanalysis(cfg, freq);
source = ft_sourcedescriptives([], source);

cfg         = [];
cfg.method  ='coh';
cfg.complex = 'absimag';
source_conn = ft_connectivityanalysis(cfg, source);


Best regards,

Charly

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210204/e943db4d/attachment-0001.htm>


More information about the fieldtrip mailing list