<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 Yiannis,
<div class=""><br class="">
</div>
<div class="">We looked into this in more detail, and our conclusion is that the first row of the transfer matrix indeed is intended to be zero. That is, the low-level computations (in external/simbio) by construction compute the potentials referenced to the
 (arbitrary) first electrode in the electrode list. Thus the for-loop starting at ‘2’  in sb_transfer is intentional.</div>
<div class=""><br class="">
</div>
<div class="">The aim of the FieldTrip code, is to return the EEG leadfields average referenced, unless explicitly defined by the user. Somehow this did not go entirely well in this case. We will fix this in the code. Thanks for reporting.</div>
<div class=""><br class="">
</div>
<div class="">For now, in order to be able to use the computed leadfields in combination with the data, you need to ensure that the referencing scheme in the data is consistent with the referencing scheme for the leadfields. It would make sense to average reference
 both, or to reference the data against the first channel (as per the data.elec.label(1)).</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>
<blockquote type="cite" class="">
<div class="">On 2 Nov 2021, at 13:35, Ioannis Zorzos 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="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: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Dear all,</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Recently, I came across something peculiar regarding the Leadfield matrix and the transfer matrix of the conduction volume model, created after following the Fieldtrip-SimBio pipeline.</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
The Leadfield matrix (from now on called LF) that is produced (which is a field inside the leadfield struct created from the ft_prepare_leadfield function) is a {1 x<em class=""><span style="font-family: Calibri, sans-serif;" class="">N_s</span></em>} cell
 array, where<span class="Apple-converted-space"> </span><span class="MsoSubtleEmphasis" style="color: rgb(64, 64, 64); font-style: italic;">N_s</span><span class="Apple-converted-space"> </span>is the number of sourcepoints specified during the creation of
 sourcemodel. Assuming that all the source points are “inside” the brain (i.e. the “inside” field of the leadfield struct would be a column  {<em class=""><span style="font-family: Calibri, sans-serif;" class="">N_s</span></em><span class="Apple-converted-space"> </span>x
 1} full of ones), then LF contains<span class="Apple-converted-space"> </span><em class=""><span style="font-family: Calibri, sans-serif;" class="">N_s</span></em>  cells, each one being of size {<em class=""><span style="font-family: Calibri, sans-serif;" class="">N_ch</span></em><span class="Apple-converted-space"> </span>×
 3 double}, where<span class="Apple-converted-space"> </span><em class=""><span style="font-family: Calibri, sans-serif;" class="">N_ch<span class="Apple-converted-space"> </span></span></em>is the number of channels/electrodes used.</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
I noticed that the first row of each of these cells from the LF (i.e. for the first channel/electrode) for each of the source points is zero. This is obviously due to the transfer matrix, of which the first row is also comprised of zeros, and is created with
 the<span class="Apple-converted-space"> </span><i class="">sb_transfer.m</i><span class="Apple-converted-space"> </span>function. In this function, the creation of the transfer matrix clearly starts from the second in order channel/electrode (the for loop
 starts from the second channel).</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Is there a reason for this? Shouldn’t it start from the first channel?</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thank you in advance.</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Sincerely,</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Zorzos Yiannis</div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></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://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!ul2oMKwSlIeyLs3KdD7YtVe6QU587xFSOgvHNjrkMWanPIKg5VASFzKyqL71LWSalH3-DZiFjGb_0lw$" 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://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!ul2oMKwSlIeyLs3KdD7YtVe6QU587xFSOgvHNjrkMWanPIKg5VASFzKyqL71LWSalH3-DZiFjGb_0lw$</a><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></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>