<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 Nina,
<div class=""><br class="">
</div>
<div class="">Well, it sounds as if you’re almost there! Indeed, as you indicate yourself, dipole orientation plays a role here. The ’times 3’ in the output to ft_compute_leadfield results from the fact that a forward model has been computed for 3 dipoles at
each of the locations (i.e. a unit amplitude dipole pointing into the x/y/z/ direction respectively). If your generative model for your data is based on the idea that a single point dipole with fixed orientation per region describes the sources per regions
well enough, then you’d need to decide on an optimal orientation for each dipole, express this as a unit norm vector, and use these dipole moments to reduce your 128 x 270 matrix to a 128 x 90 matrix. This could be either done per region (i.e. take each 128
x 3 ‘leadfield’, and multiply that with the each regions 3x1 dipole moment), or in a single matrix multiplication, where you make a large block diagonal matrix of all dipole moments (which would result in a [128x270] * [270x90] matrix multiplication, where
the latter matrix is a (in matlab speak) blkdiag of all [3x1] moment vectors). Indeed, once you ‘lf’ is a 128 x 90 you can create your (average referenced) EEG timeseries just by means of a matrix multiplication (plus the optional addition of electrode noise). </div>
<div class=""><br class="">
</div>
<div class="">I guess the challenge now is to come up with a meaningfully defined orientation for each of the regions. Given that the atlas is a volumetric one, it’s not straightforward to apply a heuristic that is based on the dominant orientation of the cortical
surface in the parcel (which is the first thing I’d consider). Is there a possibility that you could use a surface based atlas, which would allow for such a heuristic?</div>
<div class=""><br class="">
</div>
<div class="">Best wishes, and keep up the good work,</div>
<div class="">Jan-Mathijs</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 15 May 2023, at 14:01, Nina Omejc via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Dear Fieldtrip community,<br class="">
<br class="">
I am a second year PhD student from Slovenia, looking for some help. As the title suggests, I am trying to project simulated source activity to the surface (EEG data simulation from sources).<br class="">
<br class="">
Up to now, I have simulated 90 timeseries at the source level using Jansen-Rit neuronal mass models, based on the AAL volumetric atlas (activity is placed in each center of the 90 regions), so I have 90x3000 matrix (sources x time points). I have decided to
project the source activity to 128 channel standard Biosemi 128 EEG setup. Now I have issues with defining forward model from the AAL sources to the EEG channels.<span class="Apple-converted-space"> </span><br class="">
<br class="">
<p class="">Currently, I have followed your online examples to create headmodel (BEM) and the forward model, with the important part of the code being:<span class="Apple-converted-space"> </span><br class="">
</p>
<div class="lineNode" style="font-size: 10pt; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-weight: normal;">
<div class="rtcContent" style="padding: 30px;">
<div class="lineNode" style="font-size: 10pt; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-weight: normal;">
<span style="white-space: pre;" class=""><span class="">headmodel = ft_read_headmodel(</span><span style="color: rgb(167, 9, 245);" class="">'standard_bem.mat'</span><span class="">);</span><span style="color: rgb(0, 128, 19);" class="">
</span></span></div>
<div class="lineNode" style="font-size: 10pt; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-weight: normal;">
<span style="white-space: pre;" class=""><span class="">[headmodel, sens] = ft_prepare_vol_sens(headmodel, sens);</span><span style="color: rgb(0, 128, 19);" class="">
</span></span></div>
<div class="lineNode" style="font-size: 10pt; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-style: normal; font-weight: normal;">
<span style="white-space: pre;" class=""><span class="">[lf] = ft_compute_leadfield(atlas_rois, sens, headmodel); where atlas_rois is a 90x3 double, with 3d positions of source dipoles (at AAL centers)</span></span></div>
</div>
</div>
<div class=""><br class="webkit-block-placeholder">
</div>
<p class="">What I don't understand is the output of the function<span class="Apple-converted-space"> </span><i class=""><span style="white-space: pre;" class=""><span class="">ft_compute_leadfield</span></span></i>, which is a 128x270 double. Could you please
explain what it represents? As far as I understand, the surface EEG should be obtained by the equation<span class="Apple-converted-space"> </span><i class="">surface_time_series =<span class="Apple-converted-space"> </span></i><i class=""><i class=""><i class="">forward_model
*<span class="Apple-converted-space"> </span></i>source_time_serie</i><i class="">s</i></i>, meaning that the dimensions should have been<span class="Apple-converted-space"> </span><i class="">[</i><i class=""><span style="color: rgb(55, 65, 81); font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-wrap; background-color: rgb(247, 247, 248); text-decoration-thickness: initial; float: none; display: inline !important;" class="">number
of electrodes) x (number of time points)</span>] = [</i><i class=""><span style="color: rgb(55, 65, 81); font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-wrap; background-color: rgb(247, 247, 248); text-decoration-thickness: initial; float: none; display: inline !important;" class="">number
of electrodes) x (number of sources)</span>] * [(</i><i class=""><span style="color: rgb(55, 65, 81); font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: pre-wrap; background-color: rgb(247, 247, 248); text-decoration-thickness: initial; float: none; display: inline !important;" class="">number
of sources) x (number of time points</span>], which comes down to: [128x3000] = [128x90] * [90x3000].... <span class="Apple-converted-space"> </span></i>Is there a reason 3*90=270? Do source (dipole) orientations play a role?<br class="">
</p>
<p class="">Additionally for clarification, to obtain the final EEG projection, would it be then correct to directly apply the equation<span class="Apple-converted-space"> </span><i class="">surface_time_series =<span class="Apple-converted-space"> </span></i><i class=""><i class=""><i class="">forward_model
*<span class="Apple-converted-space"> </span></i>source_time_serie</i><i class="">s,<span class="Apple-converted-space"> </span></i></i>with forward model being the variable<span class="Apple-converted-space"> </span><i class="">"</i><span style="white-space: pre;" class=""><span class="">lf</span></span><i class="">"</i>?<br class="">
</p>
<p class="">I have tried various toolboxes for this simulated sources to EEG projection (TVB, MNE, SPM, Fieldtrip) and had issues everywhere, but came the furthest with Fieldtrip, so I would really appreciate your help. General recommendations on this topic
would also be greatly appreciated.</p>
<p class="">Thank you very much!<br class="">
</p>
<p class="">Kind regards,</p>
<p class="">Nina Omejc<br class="">
</p>
<br class="">
<br class="">
_______________________________________________<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://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-pwnzebYdwU0MsbC5LpPVLirsl_jIXoSfVuy5cESHsSs-IyQ-8aBFQLd5LUgYaj2YpIlh09uai4LCOug7yd2P1Al0Gp3qW1QVQipXQ$" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-pwnzebYdwU0MsbC5LpPVLirsl_jIXoSfVuy5cESHsSs-IyQ-8aBFQLd5LUgYaj2YpIlh09uai4LCOug7yd2P1Al0Gp3qW1QVQipXQ$</a></div>
</blockquote>
</div>
<br class="">
</body>
</html>