[FieldTrip] errors replicating Salzburg Fieldtrip tutorial

Tzvetan Popov tzvetan.popov at uni-konstanz.de
Thu May 23 09:22:17 CEST 2019


Dear Irene,
This is not going to work.
1. The headmodel is expressed in units of ‘m’ and aligned to the 4D/bti MEG coordinates. This has nothing to do with your EEG electrode positions.
2. As you already anticipated the type of headmodel is not appropriate for EEG source analysis.

I recommend the following:
1. Work out the tutorial with the provided data. 
2. Go thru it again and try to internalize the order of the analysis steps.
3. Switch to an EEG source analysis tutorial. Use the provided data there and try to understand the key differences. For example here: http://www.fieldtriptoolbox.org/workshop/natmeg/dipolefitting/
Or also here http://www.fieldtriptoolbox.org/workshop/aarhus/beamformingerf/
4. Go back and try to merge the two tutorials to reflect your needs.

Good luck
Tzvetan 

> Am 23.05.2019 um 08:55 schrieb Irene Varela Leniz <irene.varela at alumni.mondragon.edu>:
> 
> Dear both, 
> 
> You are right. I thought I was working with the latest version but I did not know that another more recent one had been released on April 19th. Anyway, what I could see investigating inside the function is that they have changed the way to configure the cfg in the function, right?
> 
> The function is not able to understand the cfg that I am configuring. I must mention that in my case, I am working with EEG, so for example the configuration of lcmv.reducerank I had to change it to 3. Anyway I get the following error related to the cfg:
> 
>                         cfg                 = [];
>                         cfg.label         = data.label;
>                         cfg.elec          = data.elec;
>                         cfg.vol         = hdm;
>                         cfg.lcmv.reducerank = 3; % I am working with EEG data
>                         cfg.normalize           = 'yes'
>                         cfg.grid = sourcemodel;
>                         [grid] = ft_prepare_leadfield(cfg);
> 
> 
> Error using ft_prepare_leadfield (line 110)
> It seems as if the first input argument is a FieldTrip data structure, while a cfg is expected
> 
> I also add information about how the data (EEG), the headmodel and the sourcemodel are:
> 
> hdm =
>   struct with fields:
>      bnd: [1×1 struct]
>     type: 'singleshell'
>     unit: 'm'
>      cfg: [1×1 struct]
> 
> sourcemodel =
>   struct with fields:
>        pos: [6426×3 double]
>        dim: [17 21 18]
>       unit: 'm'
>     inside: [17×21×18 logical]
>        cfg: [1×1 struct]
> 
> data = 
>   struct with fields:
>            hdr: [1×1 struct]
>          trial: {1×69 cell}
>           time: {1×69 cell}
>           elec: [1×1 struct]
>        fsample: 256
>          label: {128×1 cell}
>     sampleinfo: [69×2 double]
>            cfg: [1×1 struct]
> 
> On the other hand, if I'm working with EEG, do you think it makes sense to use files standard_singleshell.mat, atlas ROI_MNI_V4.nii, mri.mat and hdm.mat to create the leadfield? Do I need others for EEG?
> 
> Thank you for your attention. 
> 
> Best wishes, 
> 
> Irene
> 
> 
>> El mié., 22 may. 2019 a las 9:51, Schoffelen, J.M. (Jan Mathijs) (<jan.schoffelen at donders.ru.nl>) escribió:
>> You are not using the most recent fieldtrip code. See attached screenshot for a section of ft_checkconfig (which I took from https://github.com/fieldtrip/fieldtrip (utilities/ft_checkconfig.m)
>> 
>> The error message in your earlier e-mail pointed to line 529.
>> 
>> Jan-Mathijs
>> 
>> 
>> 
>> <Screen Shot 2019-05-22 at 09.48.49.png>
>>> On 22 May 2019, at 09:42, Irene Varela Leniz <irene.varela at alumni.mondragon.edu> wrote:
>>> 
>>> Dear Shoffelen, 
>>> 
>>> I am working with last Fieldtrip and MATLAB version so I'm afraid that's not the problem.
>>> 
>>> Best wishes, 
>>> 
>>> Irene
>>> 
>>>> El mié., 22 may. 2019 a las 9:38, Schoffelen, J.M. (Jan Mathijs) (<jan.schoffelen at donders.ru.nl>) escribió:
>>>> Hi Irene,
>>>> 
>>>> Please check which version of the code you are using, and update to a more recent version to FieldTrip, and try again. The line + error you report does not match the ones in the current version of Fieldtrip.
>>>> 
>>>> Best wishes,
>>>> Jan-Mathijs
>>>> 
>>>> 
>>>> 
>>>>> On 22 May 2019, at 09:21, Irene Varela Leniz <irene.varela at alumni.mondragon.edu> wrote:
>>>>> 
>>>>> Dear Fieldtripers, 
>>>>> 
>>>>> I am trying to replicate the well-known tutorial:salzburg [FielTrip] (http://old.fieldtriptoolbox.org/tutorial/salzburg). Anyway, I am getting some errors that I could not manage to solve. I would be really grateful if someone could lend me a hand.
>>>>> 
>>>>> I am working on section called "Localizing auditory evoked fields using beamforming techniques in parceled brain space". I managed to compute the sourcemodel as explained in the tutorial without any problem. But now, when "Computing the leadfield" I get an error message related with sourcemodel.inside field, which makes it impossible for me to create the leadfield. The structure is the following:
>>>>> 
>>>>> sourcemodel =
>>>>>   struct with fields:
>>>>>        pos: [6426×3 double]
>>>>>        dim: [17 21 18]
>>>>>       unit: 'm'
>>>>>     inside: [17×21×18 logical]
>>>>>        cfg: [1×1 struct]
>>>>> 
>>>>> The structure for computing the leadfield:
>>>>> 
>>>>>                         cfg                 = [];
>>>>>                         cfg.label         = data.label;
>>>>>                         cfg.elec          = data.elec;
>>>>>                         cfg.vol         = hdm;
>>>>>                         cfg.lcmv.reducerank = 2; % I am working with EEG data
>>>>>                         cfg.grid = sourcemodel;
>>>>>                         [grid] = ft_prepare_leadfield(cfg)
>>>>> 
>>>>> An the error I get:
>>>>> 
>>>>> Operands to the || and && operators must be convertible to logical scalar values.
>>>>> 
>>>>> Error in ft_checkconfig (line 529)
>>>>>   elseif isfield(cfg, 'grid') && isfield(cfg.grid, 'inside') && any(cfg.grid.inside>1)
>>>>> 
>>>>> Error in ft_prepare_leadfield (line 156)
>>>>> cfg = ft_checkconfig(cfg, 'inside2logical', 'yes');
>>>>> 
>>>>> I think the error comes from the fact that sourcemodel.inside is a 3-dimensional logical array. The operation - any(cfg.grid.inside>1)   does not output a logical scalar value because sourcemodel.inside is in 3 dimensions. 
>>>>> So far I have always worked with models whose inside parameter was of one dimension. Anyway, I'm not sure if this is the problem, please correct me if I'm wrong.
>>>>> 
>>>>> Has anyone encountered this same problem, and does anyone know how to fix it?  
>>>>> 
>>>>> Thank you very much for your attention, 
>>>>> 
>>>>> 
>>>>> Irene
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> 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/20190523/aed93e09/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