<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 Jasen,
<div class=""><br class="">
</div>
<div class="">When you state that the scale is ‘much too large’ that suggests that you have a specific expectation of the values that you typically get (using other software? what is the unit convention in that software?). Since you are not clear on what type
 of MEG system you have been working with, I cannot comment on the figure you report. (as a side note, if you are working with Elekta data (and MEG field gradients), if I recall well you need to read in the gradiometer description specifying the ‘coilaccuracy’
 option to be >=1 for the units to work well enough, otherwise the units may indeed be ill-defined).</div>
<div class=""><br class="">
</div>
<div class="">
<div>Besides, the physical units of (MEG) leadfields should be something like T/nAm, or (T/m)/nAm etc. , so I am not sure why you mention the scale to be of ‘1e-10 T’. </div>
<div><br class="">
</div>
<div>This being said, correctly dealing with units is tricky, since different MEG/EEG vendors have different unit conventions (e.g. metric distances expressed in cm/m/mm, potentials expressed in muV or V etc). FieldTrip aims to work internally with SI units
 (i.e. m V T etc). To this end, it tries to apply the required scaling based on the specified units in the (metadata), or based on educated guesses from the dataformat. Also, FT tries hard to synchronize the units of the different data objects that are required
 for the computation (volume conductor, gradiometers)</div>
<div><br class="">
</div>
<div>However - to complicate things a bit more - , FieldTrip data structures (e.g. gradiometer descriptions with coil positions, gradient baseline lengths, and volume conductor models) are typically broadcasted to the user with units that may not be SI (e.g.
 MEG gradients in T/cm, volume conductor models in mm).</div>
<div><br class="">
</div>
<div>By the way, if you want to explore this further, I’d recommend you to compute the leadfields using ft_prepare_leadfield, since in this way you are closer to the actual computation (while still relying on FieldTrip’s bookkeeping functionality). Note that
 Marc’s e-mail on the discussion forum is already 8 years old, and I am pretty sure that quite some things have changed (for the better) in the mean time.  </div>
<div><br class="">
</div>
<div>At this moment, I don’t see the need (yet) for any modification to the code, and I suggest that you explore a bit further, based on the above. </div>
<div><br class="">
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 25 Apr 2022, at 15:30, Jasen Devasagayam 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="elementToProof" style="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; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Hello Everyone, </span><br class="">
</div>
<div dir="ltr" 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="">
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br class="">
</div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
I ran into some confusion when looking at LCMV beamformed data, using the function, "ft_sourceanalysis". We are using a single shell forward model in these analyses. When looking at the output struct from this function, the lead fields were on the scale of
 1e-10 T,  which seems much too large for MEG fields. Looking into FieldTrip archives, I found a similar question by Marc Lalencette from 2014 (<a href="https://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008438.html" data-auth="NotApplicable" id="LPlnk894919" class="">https://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008438.html</a>)
 where it looks like the issue stems from the fact that fields are computed with respect to 'cm'. </div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br class="">
</div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
I applied a conversion factor, by multiplying all data by 1e-4, to get from 'cm^2' to 'm^2'. I applied this conversion factor in the function "ft_compute_leadfield" in Line 260: </div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">      lf = lf*headmodel.forwpar.scale^2*1e-4;</span><br class="">
</div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class="">
</span></div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">I had originally tried to just adjust the scaling factor, but making that one small change severely altered the data in multiple places in our pipeline, which in turn
 yielded lead fields on the scale of 1e-10 once again. In this case, the scaling factor is 1. </span></div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class="">
</span></div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">I was wondering if this would be the correct place and method to implement this modification. If not, would you have any suggestions on how to get sensible lead field
 values? </span></div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class=""><br class="">
</span></div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">Thank you. </span></div>
<div class="x_elementToProof" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">
<br class="">
</div>
<div class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<br class="">
</div>
<div id="x_Signature" class="">
<div class="">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
</div>
<div class=""></div>
<div class=""></div>
<div class=""></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" class="">
<table style="border-collapse: collapse; border: none;" class="">
<tbody class="">
<tr style="height: 87.3pt;" class="">
<td width="235" style="width: 176.1pt; border-style: none solid none none; border-right-width: 1pt; border-right-color: windowtext; padding: 0cm 5.4pt; height: 87.3pt;" class="">
<div style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif; text-align: center;" class="">
<span lang="EN-US" class=""><span id="cid:202c3e90-7ada-4ef9-9785-989c31436ce8"><Outlook-rebpi3hn.png></span> </span></div>
</td>
<td width="300" valign="top" style="width: 225.1pt; border: none; padding: 0cm 5.4pt; height: 87.3pt;" class="">
<div style="margin: 0cm 0cm 0cm 8.1pt; font-size: 12pt; font-family: Calibri, sans-serif; line-height: 19.200000762939453px;" class="">
<b class=""><span lang="EN-US" style="font-size: 13pt; font-family: Arial, sans-serif;" class="">Jasen Devasagayam</span></b><b class=""><span lang="EN-US" style="font-size: 9pt; font-family: Arial, sans-serif;" class="">, MASc</span></b></div>
<div style="margin: 0cm 0cm 0cm 8.1pt; font-size: 12pt; font-family: Calibri, sans-serif; line-height: 19.200000762939453px;" class="">
<span lang="EN-US" style="font-size: 9pt; font-family: Arial, sans-serif;" class="">Research MEG Technologist </span></div>
<div style="margin: 0cm 0cm 0cm 8.1pt; font-size: 12pt; font-family: Calibri, sans-serif; line-height: 19.200000762939453px;" class="">
<span lang="EN-US" style="font-size: 9pt; font-family: Arial, sans-serif;" class="">Neurosciences and Mental Health </span></div>
<p style="margin: 0cm 0cm 0cm 8.1pt; font-size: 12pt; font-family: Calibri, sans-serif; line-height: 19.200000762939453px;" class="">
<span lang="EN-US" style="font-size: 7pt; font-family: Arial, sans-serif;" class=""> </span></p>
<div style="margin: 0cm 0cm 0cm 8.1pt; font-size: 12pt; font-family: Calibri, sans-serif; line-height: 19.200000762939453px;" class="">
<span lang="EN-US" style="font-size: 9pt; font-family: Arial, sans-serif;" class="">The Hospital for Sick Children </span></div>
<div style="margin: 0cm 0cm 0cm 8.1pt; font-size: 12pt; font-family: Calibri, sans-serif; line-height: 19.200000762939453px;" class="">
<span lang="EN-US" style="font-size: 9pt; font-family: Arial, sans-serif;" class="">686 Bay St., Toronto, ON M5G 0A4 </span></div>
<div style="margin: 0cm 0cm 0cm 8.1pt; font-size: 12pt; font-family: Calibri, sans-serif; line-height: 19.200000762939453px;" class="">
<span lang="EN-US" style="font-size: 9pt; font-family: Arial, sans-serif;" class=""><span lang="EN-US" style="margin: 0px; font-size: 9pt; background-color: rgb(255, 255, 255); line-height: 16.8px; font-family: Arial, Arial_EmbeddedFont, Arial_MSFontService, sans-serif; font-variant-ligatures: none !important;" class=""><span style="margin: 0px;" class="">P 416-813-7654
 ext. 201535</span></span><span style="margin: 0px; font-size: 9pt; background-color: rgb(255, 255, 255); line-height: 16.8px; font-family: Arial, Arial_EmbeddedFont, Arial_MSFontService, sans-serif;" class=""> </span> </span></div>
<div style="margin: 0cm 0cm 0cm 5.4pt; font-size: 12pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class=""><a href="https://urldefense.com/v3/__https://www.instagram.com/sickkidstoronto/__;!!HJOPV4FYYWzcc1jazlU!_z-ur50qPdLAjDHYrdazjQumNhsOgHecva_beSA8RIZl4a1SHJdPrXCut_sNSh9JLEXshzdkRn3cFz69mkrlSAMNKcNqFNy4XWVpig$" data-auth="NotApplicable" title="https://www.instagram.com/sickkidstoronto/" class=""><span id="cid:66729eed-08e2-4094-ac07-df806e63bec9"><Outlook-3fzlys2n.png></span></a><span class=""> </span><a href="https://urldefense.com/v3/__https://twitter.com/SickKidsNews__;!!HJOPV4FYYWzcc1jazlU!_z-ur50qPdLAjDHYrdazjQumNhsOgHecva_beSA8RIZl4a1SHJdPrXCut_sNSh9JLEXshzdkRn3cFz69mkrlSAMNKcNqFNy8JEWS3A$" data-auth="NotApplicable" title="https://twitter.com/SickKidsNews" class=""><span id="cid:6c8229b1-f31a-40f6-81d2-9e3f6dc03b93"><Outlook-anx2aeuu.png></span></a><span class=""> </span><a href="https://urldefense.com/v3/__https://www.youtube.com/channel/UCleVfdmpkf7H5tnRRw7n39A__;!!HJOPV4FYYWzcc1jazlU!_z-ur50qPdLAjDHYrdazjQumNhsOgHecva_beSA8RIZl4a1SHJdPrXCut_sNSh9JLEXshzdkRn3cFz69mkrlSAMNKcNqFNz8sQdooQ$" data-auth="NotApplicable" title="https://www.youtube.com/channel/UCleVfdmpkf7H5tnRRw7n39A" class=""><span id="cid:fec4544c-1823-496d-a1e4-50b6625981d9"><Outlook-j5bhmd4s.png></span></a><span class=""> </span><a href="https://urldefense.com/v3/__https://www.linkedin.com/company/the-hospital-for-sick-children/?originalSubdomain=ca__;!!HJOPV4FYYWzcc1jazlU!_z-ur50qPdLAjDHYrdazjQumNhsOgHecva_beSA8RIZl4a1SHJdPrXCut_sNSh9JLEXshzdkRn3cFz69mkrlSAMNKcNqFNzzvsrwpw$" data-auth="NotApplicable" title="https://www.linkedin.com/company/the-hospital-for-sick-children/?originalSubdomain=ca" class=""><span id="cid:fa53b7fd-41cc-4873-84e5-0b180b81f6f8"><Outlook-psrt3plh.png></span></a> </span></div>
</td>
</tr>
</tbody>
</table>
<br class="">
</div>
</div>
</div>
</div>
</div>
<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="">
<hr 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="">
<font face="Arial" color="Gray" size="1" style="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; text-decoration: none;" class=""><br class="">
This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than
 the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.<br class="">
</font><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="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!_z-ur50qPdLAjDHYrdazjQumNhsOgHecva_beSA8RIZl4a1SHJdPrXCut_sNSh9JLEXshzdkRn3cFz69mkrlSAMNKcNqFNxqoASfaA$" style="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!_z-ur50qPdLAjDHYrdazjQumNhsOgHecva_beSA8RIZl4a1SHJdPrXCut_sNSh9JLEXshzdkRn3cFz69mkrlSAMNKcNqFNxqoASfaA$</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>