<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="">
Hi Charly,
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">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.</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>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 2 Feb 2021, at 16:43, Billaud, Charly (Research Student) <<a href="mailto:billaudc@aston.ac.uk" class="">billaudc@aston.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="">Dear community,<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class=""><br class="">
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?<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class=""><br class="">
<i class="">cfg             = [];<o:p class=""></o:p></i></span></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.sourcemodel = sourcemodel;<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.headmodel   = headmodel;<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">lf  = ft_prepare_leadfield(cfg, dataclean);<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class=""><o:p class=""> </o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg            = [];<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.method     = 'mtmfft';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.output     = 'fourier';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.keeptrials = 'yes';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.tapsmofrq  = 1;<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.foi    = [0.5 4];<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">freq           = ft_freqanalysis(cfg, dataclean);<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class=""><br class="">
cfg                   = [];<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.frequency         = freq.freq;<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.method            = 'pcc';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.grid              = lf;<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.headmodel         = headmodel;<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.keeptrials        = 'yes';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.pcc.lambda        = '10%';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.pcc.projectnoise  = 'yes';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.pcc.fixedori      = 'yes';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">source = ft_sourceanalysis(cfg, freq);<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">source = ft_sourcedescriptives([], source);<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class=""><o:p class=""> </o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg         = [];<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.method  ='coh';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">cfg.complex = 'absimag';<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class="">source_conn = ft_connectivityanalysis(cfg, source);<o:p class=""></o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt 70.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""><span class=""><o:p class=""> </o:p></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class=""><br class="">
Best regards,<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="">Charly<br class="">
<br class="">
<o:p class=""></o:p></span></div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" style="color: rgb(149, 79, 114); text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://doi.org/10.1371/journal.pcbi.1002202</a></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>