[FieldTrip] Beamforming in FieldTrip and Brainstorm
Vladimir Litvak
litvak.vladimir at gmail.com
Fri Apr 19 09:54:56 CEST 2019
Dear Mikkel,
In principle, if you are far enough from the mesh it should work. If
because of the bad MRI the skull shape you extract is distorted then you
will just get incorrect results - garbage in, garbage out. Yes, for dipoles
I would recommend using a spherical model because it's hard to prevent the
dipole from getting into that bad zone in BEM. But if you combine spherical
model with mesh than the mesh should be spherified to fit inside the inner
sphere (unlike in MEG where it's not necessary). Robert has code for this
and this code is used in SPM but I'm not sure if appears in any FT tutorial.
Best,
Vladimir
On Thu, Apr 18, 2019 at 5:02 PM Mikkel Vinding <mikkel at cnru.dk> wrote:
> Dear Vladimir
>
> 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?
>
> Best regards
> Mikkel
>
> Mikkel C. Vinding
> NatMEG, Karolinska Institutet
> Nobels väg 9
> 171 77 Stockholm, Sweden
> Email: mikkel.vinding at ki.se
>
>
> On Thu, Apr 18, 2019 at 1:19 PM Vladimir Litvak <litvak.vladimir at gmail.com>
> wrote:
>
>> Dear Mikkel,
>>
>> 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.
>>
>> cfg = [];
>> cfg.headmodel = vol;
>> cfg.grid.pos = mesh.tess_ctx.vert;
>> cfg.moveinward = 6e-3; %move to empirically determined BEM safe zone
>> gridcorrect = ft_prepare_sourcemodel(cfg);
>>
>> mesh.tess_ctx.vert = gridcorrect.pos;
>>
>>
>> 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.
>>
>> Best,
>>
>> Vladimir
>>
>>
>>
>>
>> On Thu, Apr 18, 2019 at 9:35 AM Mikkel Vinding <mikkel at cnru.dk> wrote:
>>
>>> Dear all
>>>
>>> You can also call SPMs function from FieldTrip to make head models and
>>> source models. Here is a quick overview of a standard pipeline:
>>> http://natmeg.se/MEEG_course2018/preprocess_MRI_data2.html
>>>
>>> Best regards
>>> Mikkel
>>>
>>>
>>> Mikkel C. Vinding
>>> NatMEG, Karolinska Institutet
>>> Nobels väg 9
>>> 171 77 Stockholm, Sweden
>>> Email: mikkel.vinding at ki.se
>>>
>>>
>>> On Wed, Apr 17, 2019 at 1:12 PM Vladimir Litvak <
>>> litvak.vladimir at gmail.com> wrote:
>>>
>>>> Dear Ioanna,
>>>>
>>>> I'm not well familiar with Brainstorm but you could use SPM12 (
>>>> https://www.fil.ion.ucl.ac.uk/spm/) 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
>>>> http://www.fieldtriptoolbox.org/workshop/meg-uk-2015/fieldtrip-beamformer-demo/ 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 (
>>>> https://www.fil.ion.ucl.ac.uk/spm/doc/manual.pdf, p 121). You only
>>>> need to get up to the 'Forward' button, choose EEG BEM, press 'save' and
>>>> then you do:
>>>>
>>>> D = spm_eeg_load('dataset_name.mat');
>>>>
>>>> % convert sensors and volume conduction model from SPM
>>>> volsens = spm_eeg_inv_get_vol_sens(D, 1, 'MNI-aligned', 'inv', 'EEG');
>>>> vol1 = volsens.EEG.vol;
>>>> sens1 = volsens.EEG.sens;
>>>>
>>>> Best,
>>>>
>>>> Vladimir
>>>>
>>>> On Wed, Apr 17, 2019 at 11:08 AM Ioanna Zioga <i.zioga at qmul.ac.uk>
>>>> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>>
>>>>> I'm Ioanna and I'm a PhD student in Queen Mary University of London,
>>>>> doing EEG research on music learning and creativity [image:
>>>>> :slight_smile:]
>>>>>
>>>>>
>>>>> My question is on using Brainstorm and FieldTrip interchangeably to do
>>>>> beamforming on EEG data recorded by a 64-channel EGI system.
>>>>>
>>>>> 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.
>>>>>
>>>>>
>>>>> Therefore, I was wondering if I could:
>>>>>
>>>>> 1. Calculate the cross-spectral density in Fieldtrip
>>>>> (ft_freqanalysis)
>>>>> 2. Create the head model in Brainstorm
>>>>> 3. Run the source analysis in Fieldtrip (ft_sourceanalysis) using
>>>>> the head model from Brainstorm
>>>>>
>>>>> 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?
>>>>>
>>>>> Q2: Does anyone have a FieldTrip head model for a 64-channel EGI
>>>>> system?
>>>>>
>>>>>
>>>>> Any help would be very much appreciated!
>>>>>
>>>>>
>>>>> Thanks so much in advance,
>>>>> Ioanna
>>>>>
>>>>> _______________________________________________
>>>>> fieldtrip mailing list
>>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>>> https://doi.org/10.1371/journal.pcbi.1002202
>>>>>
>>>> _______________________________________________
>>>> fieldtrip mailing list
>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>> https://doi.org/10.1371/journal.pcbi.1002202
>>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>> https://doi.org/10.1371/journal.pcbi.1002202
>>>
>> _______________________________________________
>> fieldtrip mailing list
>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> https://doi.org/10.1371/journal.pcbi.1002202
>>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190419/b3aa45e5/attachment-0002.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202
More information about the fieldtrip
mailing list