<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 Kirstin,
<div class="">I’m glad that you managed to get it working for you now.</div>
<div class="">Please consider returning back to the community by appropriately clarifying the documentation on the website, and in the function. The updated function can be submitted through a pull request (PR) on github. Also, if your fix to the code is sufficiently
 generic, we are looking forward to this to be included in your PR!</div>
<div class=""><br class="">
</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 2 Oct 2019, at 18:30, Kirstin Heise <<a href="mailto:kirstin.heise@kuleuven.be" class="">kirstin.heise@kuleuven.be</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear Jan-Mathijs, 
<div class=""><br class="">
</div>
<div class="">thanks again for your response. </div>
<div class="">In fact, I solved the data channel - leadfield channel issue by minimally tweaking the ft_sourceanalysis script (around line 522 to assure that i2 allows for the actual max. number of possible channel, which may exceed the numel of channels given).
 This runs fine now. </div>
<div class=""><br class="">
</div>
<div class="">Regarding the EMG channel issue, I figured out that the ft_sourceanalysis with method dics_refchannel required the additional cfg.channel = ‘eeg’ information in order to run. This is actually missing in the tutorial code
<a href="http://www.fieldtriptoolbox.org/tutorial/coherence/#appendix-1-localisation-of-neuronal-sources-coherent-with-the-emg-using-beamformers" class="">
http://www.fieldtriptoolbox.org/tutorial/coherence/#appendix-1-localisation-of-neuronal-sources-coherent-with-the-emg-using-beamformers</a></div>
<div class="">and is not really a priori mentioned as mandatory in the description of the function.</div>
<div class=""><br class="">
</div>
<div class="">One general question that I have now is whether also for EEG-EMG coherence, DICS is accepted or whether I should rather not use a beamformer method? - Any opinion in this regard would be highly appreciated. </div>
<div class=""><br class="">
</div>
<div class="">Best regards, </div>
<div class="">Kirstin</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
</div>
<div class="">
<blockquote type="cite" class="">
<div class="">On 2 Oct 2019, at 16:27, Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl" class="">jan.schoffelen@donders.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Kirstin,
<div class=""><br class="">
</div>
<div class="">This is hard to debug without any data to look at… Yet, to answer your questions: I wouldn’t do interpolation for missing channels. Rather, I’d ensure that I compute a forward model only for the EEG channels that are available. This can be tweaked
 with a cfg.channel argument for ft_prepare_leadfield. Regarding your second question: I’d expect ft_sourceanalysis (with cfg.method = ‘dics’, and cfg.refchan = ‘thenameofyouremgchannel’) to run through fine if your data is well-behaved, in the sense that it
 contains a cross-spectral density estimate (or fourier transformed data) for the EEG channels + the EMG, AND if your forward model (leadfield) has been computed on exactly the same EEG channels. </div>
<div class="">BTW, are you aware of this tutorial? <a href="http://www.fieldtriptoolbox.org/tutorial/coherence/" class="">http://www.fieldtriptoolbox.org/tutorial/coherence/</a> It might provide some pointers into the right direction.</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 class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 30 Sep 2019, at 14:40, Kirstin Heise <<a href="mailto:kirstin.heise@kuleuven.be" class="">kirstin.heise@kuleuven.be</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Thank you for your response, Jan-Mathijs and sorry for my response latency…<br class="">
<div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
The script throws an error when using the pre-computed filter.</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
I do indeed have a mismatch between the channel number because the filter is computed for the possible number of EEG electrodes (in my case 127) and I am intending to run the next step in which I use the filter with the available data. </div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
The first question is, do I in any case need to interpolate missing channels (I wanted to avoid this)? And if not, what would be the best approach to solve this, taking care of the channel labels and order? </div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
The second question is related to the source localisation of the EEG activity correlated with the EMG. At this step, there are EMG channels in the data - I tried the tutorial and am confused which information is actually necessary for using the filter given
 that the sensor/channel labels must diverge between the filter (EEG only) and the data including the reference (EMG) channel. </div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Thanks again very much for your support. </div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Best regards, </div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Kirstin</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
<div dir="auto" style="caret-color: rgb(0, 0, 0); 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; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<br class="">
</div>
</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 12 Sep 2019, at 17:35, Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl" class="">jan.schoffelen@donders.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Kirstin,
<div class=""><br class="">
</div>
<div class="">The EMG channels are not supposed to be added to the forward model.</div>
<div class=""><br class="">
</div>
<div class="">The error that is thrown suggests indeed a mismatch between the channels in the data and/or their order, that are used for the covariance/csd matrix and the channels and/or their order in the precomputed forward model. I would start by inspecting
 the list of channels at the line in which the error occurs (either putting in an explicit breakpoint, or use the command 'dbstop if error’) in cfg.channel, and sourcemodel.label. I’d expect the cfg.channel to only contain the EEG channels, unless you put in
 a weird cfg.channel into the ft_sourceanalysis’ cfg. Note that you don’t need to put in a cfg.channel at this stage.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 12 Sep 2019, at 16:27, Kirstin Heise <<a href="mailto:kirstin.heise@kuleuven.be" class="">kirstin.heise@kuleuven.be</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear FieldTrip community, 
<div class=""><br class="">
</div>
<div class="">I am following the pipeline of the  <a href="http://www.fieldtriptoolbox.org/tutorial/beamformingextended/#loading-of-the-data" class="">http://www.fieldtriptoolbox.org/tutorial/beamformingextended/#loading-of-the-data</a> tutorial to source localise
 EEG activity that is coherent with muscle/EMG channels. I have a pre-computed leadfield (using simbio), which does not include the muscle channels that I want to use. </div>
<div class=""><br class="">
</div>
<div class="">When attempting to run ft_sourceanalysis, I receive the following error message: </div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(160, 32, 240);" class="">
<span style="" class=""><br class="">
</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(160, 32, 240);" class="">
<span style="" class="">Error </span>using<span style="" class=""> </span>ft_sourceanalysis<span style="" class="">
</span>(line 542)</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(160, 32, 240);" class="">
<span style="" class="">There's a </span>mismatch<span style="" class=""> </span>
between<span style="" class=""> </span>the<span style="" class=""> </span>number/order<span style="" class="">
</span>of<span style="" class=""> </span>channels<span style="" class=""> </span>
in<span style="" class=""> </span>the<span style="" class=""> </span>data<span style="" class="">, </span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(160, 32, 240);" class="">
<span style="" class="">with </span>respect<span style="" class=""> </span>to<span style="" class="">
</span>the<span style="" class=""> </span>channels<span style="" class=""> </span>
in<span style="" class=""> </span>the<span style="" class=""> </span>precomputed<span style="" class="">
</span>leadfield/filter.</div>
<div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Courier; color: rgb(160, 32, 240);" class="">
<span style="" class="">This </span>is<span style="" class=""> </span>not<span style="" class="">
</span>easy<span style="" class=""> </span>to<span style="" class=""> </span>solve<span style="" class="">
</span>automatically.<span style="" class=""> </span>Please<span style="" class="">
</span>look<span style="" class=""> </span>into<span style="" class=""> </span>this.</div>
<div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Courier; min-height: 14px;" class="">
<br class="">
</div>
</div>
<div class="">Is there a way of solving this post hoc? I am not sure which information is required in which part of the leadfield structure. I saw that in the tutorial data set, there are more sensors in the data set than included in the forward model and wonder
 whether it is just a matter of adding the additional channels “somehow” in the forward model? </div>
<div class=""><br class="">
</div>
<div class="">Also, not having interpolated bad channels and hence having a different number of channels in the EEG data set, at what point can I control the numbering/order of the actual channels in the source reconstruction procedure? </div>
<div class=""><br class="">
</div>
<div class="">Thanks a lot for your support. </div>
<div class="">Best, </div>
<div class="">Kirstin</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
_______________________________________________<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="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
_______________________________________________<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="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<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="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
_______________________________________________<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="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
_______________________________________________<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>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>