[FieldTrip] errors replicating Salzburg Fieldtrip tutorial

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Wed May 22 09:51:06 CEST 2019


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



[cid:9C687774-46FE-4580-B3F5-6F066637A696 at dccn.nl]
On 22 May 2019, at 09:42, Irene Varela Leniz <irene.varela at alumni.mondragon.edu<mailto: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<mailto: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<mailto: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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190522/ca4a899e/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-05-22 at 09.48.49.png
Type: image/png
Size: 137414 bytes
Desc: Screen Shot 2019-05-22 at 09.48.49.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190522/ca4a899e/attachment-0002.png>
-------------- 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