<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>Dear Vladimir</div><div><br></div><div>Thank you--that is an important note. We had that exact error in another tutorial for EEG because of a bad MRI. Moving the mesh surfaces could not fix the issue. We ended up using a sphere model instead. That still gave reasonable fits for single dipoles. That might also be an option?<br></div><div><br></div><div>Best regards</div><div>Mikkel</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font size="1"><span style="font-family:arial,helvetica,sans-serif">Mikkel C. Vinding<br>NatMEG, Karolinska Institutet<b><br>
</b>Nobels väg 9<br>171 77 Stockholm, Sweden<b><br>
</b>Email: <a href="mailto:mikkel.vinding@ki.se" target="_blank">mikkel.vinding@ki.se</a><b><br>
</b></span></font></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 18, 2019 at 1:19 PM Vladimir Litvak <<a href="mailto:litvak.vladimir@gmail.com">litvak.vladimir@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Dear Mikkel,<div><br></div><div>Your pipeline looks good. Just one point you and everyone else should be acutely aware of is that bemcp completely fails if your sources are too close to the inner skull surface. That means closer than half the length of the triangle side in the inner skull mesh. At some point we tested this extensively with Robert and in SPM there is a correction code that pushes the mesh inwards to make sure there is no problem. It looks like this (for a coordinate system expressed in meters). The distance of 6mm was found empirically by looking at correlations between the lead fields computed with bemcp vs. the spherical model and finding a value for which they are all above 0.9. For shorter distances, you can clearly see how the computation completely breaks down and gives nonsense lead-fields so it's not that they are slightly wrong, they are completely off. </div><div><br></div><div><div>cfg = [];</div><div>cfg.headmodel = vol;</div><div>cfg.grid.pos = mesh.tess_ctx.vert;         </div><div>cfg.moveinward = 6e-3; %move to empirically determined BEM safe zone</div><div>gridcorrect = ft_prepare_sourcemodel(cfg);</div><div>            </div><div>mesh.tess_ctx.vert = gridcorrect.pos;</div><div><br></div><div><br></div><div>I saw someone not being happy with bemcp on the list some time ago and that was the reason. If you make sure you stay in the safe zone, bemcp is great so I suggest you add something along these lines to your pipeline to save your users some misery. </div><div><br></div><div>Best,</div><div><br></div><div>Vladimir</div><div><br></div></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 18, 2019 at 9:35 AM Mikkel Vinding <<a href="mailto:mikkel@cnru.dk" target="_blank">mikkel@cnru.dk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Dear all</div><div><br></div><div>You can also call SPMs function from FieldTrip to make head models and source models. Here is a quick overview of a standard pipeline: <a href="http://natmeg.se/MEEG_course2018/preprocess_MRI_data2.html" target="_blank">http://natmeg.se/MEEG_course2018/preprocess_MRI_data2.html</a></div><div><br></div><div>Best regards</div><div>Mikkel<br></div><div><br></div><div><br></div><div><div dir="ltr" class="gmail-m_-2908762010495084015gmail-m_-3342976158595732383gmail_signature"><div dir="ltr"><div><font size="1"><span style="font-family:arial,helvetica,sans-serif">Mikkel C. Vinding<br>NatMEG, Karolinska Institutet<b><br>
</b>Nobels väg 9<br>171 77 Stockholm, Sweden<b><br>
</b>Email: <a href="mailto:mikkel.vinding@ki.se" target="_blank">mikkel.vinding@ki.se</a><b><br>
</b></span></font></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 17, 2019 at 1:12 PM Vladimir Litvak <<a href="mailto:litvak.vladimir@gmail.com" target="_blank">litvak.vladimir@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear Ioanna,<div><br></div><div>I'm not well familiar with Brainstorm but you could use SPM12 (<a href="https://www.fil.ion.ucl.ac.uk/spm/" target="_blank">https://www.fil.ion.ucl.ac.uk/spm/</a>) to make a template head model that you could then easily use in FT (as SPM and FT share the same forward computation code), See <a href="http://www.fieldtriptoolbox.org/workshop/meg-uk-2015/fieldtrip-beamformer-demo/" target="_blank">http://www.fieldtriptoolbox.org/workshop/meg-uk-2015/fieldtrip-beamformer-demo/</a> for an example of how you get the head model and sensors to FT. To generate the head model it would be enough to convert an example of your data to SPM, load it to '3D source reconstruction' interface and go through the sequence of buttons there as described in the SPM manual (<a href="https://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf" target="_blank">https://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf</a>, p 121). You only need to get up to the 'Forward' button, choose EEG BEM, press 'save' and then you do:</div><br>D = spm_eeg_load('dataset_name.mat');<br><br>% convert sensors and volume conduction model from SPM<br>volsens = spm_eeg_inv_get_vol_sens(D, 1, 'MNI-aligned', 'inv', 'EEG');<br>vol1    = volsens.EEG.vol;<br>sens1   = volsens.EEG.sens;<div><br></div><div>Best,</div><div><br></div><div>Vladimir</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 17, 2019 at 11:08 AM Ioanna Zioga <<a href="mailto:i.zioga@qmul.ac.uk" target="_blank">i.zioga@qmul.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_-2908762010495084015gmail-m_-3342976158595732383gmail-m_6777393240820465445gmail-m_6210167879400043178divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px"></p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
Hi All,</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
<br>
</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
I'm Ioanna and I'm a PhD student in Queen Mary University of London, doing EEG research on music learning and creativity <img title=":slight_smile:" class="gmail-m_-2908762010495084015gmail-m_-3342976158595732383gmail-m_6777393240820465445gmail-m_6210167879400043178emoji" alt=":slight_smile:" style="border: 0px none; vertical-align: middle; width: 20px; height: 20px; max-width: 690px; max-height: 500px;"></p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
<br>
</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
My question is on using Brainstorm and FieldTrip interchangeably to do beamforming on EEG data recorded by a 64-channel EGI system.</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
I haven't found an option to compute the cross-spectral density matrix for the beamforming in Brainstorm. On the other hand, with Brainstorm I could quite easily create a head model for the 64-channel EGI system my data were recorded with.</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
<br>
</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
Therefore, I was wondering if I could:</p>
<ol style="clear:both;color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
<li>Calculate the cross-spectral density in Fieldtrip (ft_freqanalysis)</li><li>Create the head model in Brainstorm</li><li>Run the source analysis in Fieldtrip (ft_sourceanalysis) using the head model from Brainstorm</li></ol>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
Q1: How can I use the head model (as computed in Brainstorm) in FieldTrip to run the ft_sourceanalysis function? What is the format that the head model structure should have?</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
Q2: Does anyone have a FieldTrip head model for a 64-channel EGI system?</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
<br>
</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
Any help would be very much appreciated!</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
<br>
</p>
<p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:15px">
Thanks so much in advance,<br>
Ioanna</p>
<br>
<p></p>
</div>
</div>

_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>