<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 5 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hello Jan-Mathijs,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you for looking up my request. I figured it would be due to a referencing issue but could not understand why it was assuming the first electrode as the reference channel and this is why I wanted to report this.
</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For my case, my data is referenced to a channel that was excluded from the final file, thus from 64 electrodes in total, my data contains 63 channels. Do you (or anyone else) think that inserting a “reference channel” as data.elec.label{1}
 and running again the forward problem could be enough? Or following an “averaging referencing” path could also be a valid (and faster maybe) solution?</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you again for your help. </p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best wishes,</p>
<p class="MsoNormal">Zorzos Yiannis      </p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:fieldtrip@science.ru.nl">Schoffelen, J.M. (Jan Mathijs) via fieldtrip</a><br>
<b>Sent: </b>Wednesday, November 10, 2021 6:58 PM<br>
<b>To: </b><a href="mailto:fieldtrip@science.ru.nl">FieldTrip discussion list</a><br>
<b>Cc: </b><a href="mailto:janmathijs.schoffelen@donders.ru.nl">Schoffelen, J.M. (Jan Mathijs)</a><br>
<b>Subject: </b>Re: [FieldTrip] Explanation about the Fieldtrip-SimBio pipeline.</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Yiannis, <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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)).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Best wishes,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Jan-Mathijs<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On 2 Nov 2021, at 13:35, Ioannis Zorzos via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Dear all,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">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><span style="font-family:"Calibri",sans-serif">N_s</span></em>} cell
 array, where<span class="apple-converted-space"> </span><span class="MsoSubtleEmphasis"><i><span style="font-family:"Calibri",sans-serif;color:#404040">N_s</span></i></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><span style="font-family:"Calibri",sans-serif">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><span style="font-family:"Calibri",sans-serif">N_s</span></em>  cells, each one being of size {<em><span style="font-family:"Calibri",sans-serif">N_ch</span></em><span class="apple-converted-space"> </span>×
 3 double}, where<span class="apple-converted-space"> </span><em><span style="font-family:"Calibri",sans-serif">N_ch</span></em><span class="apple-converted-space"><i> </i></span>is the number of channels/electrodes used.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">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>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).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Is there a reason for this? Shouldn’t it start from the first channel?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thank you in advance.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Sincerely,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Zorzos Yiannis<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif">_______________________________________________<br>
fieldtrip mailing list<br>
</span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip"><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#954F72">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</span></a><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif"><br>
</span><a href="https://urldefense.com/v3/__https:/doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!ul2oMKwSlIeyLs3KdD7YtVe6QU587xFSOgvHNjrkMWanPIKg5VASFzKyqL71LWSalH3-DZiFjGb_0lw$"><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#954F72">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!ul2oMKwSlIeyLs3KdD7YtVe6QU587xFSOgvHNjrkMWanPIKg5VASFzKyqL71LWSalH3-DZiFjGb_0lw$</span></a><o:p></o:p></p>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>