[FieldTrip] ft_sourcestatistics does not recognize source input data

Werkle, Markus werkle at mpib-berlin.mpg.de
Mon Jan 2 15:09:07 CET 2017


Dear Jan-Mathijs,

yes, that did the trick! Setting cfg.dics.keepfilter = 'no' before passing the single trials through the common filter helped.

Thank you and Cristiano for your quick and efficient support!

Best,
Markus

*********************************************************************
Dr. Markus Werkle-Bergner, Dipl. Psych.
Senior Research Scientist (W2)

Jacobs Foundation Research Fellow 2017-2019

Max Planck Institute for Human Development
Center for Lifespan Psychology

Lentzeallee 94, 14195 Berlin

Tel.: 0049 (0)30 82406 447 Fax.: 0049 (0)30 824 99 39
Mail: werkle at mpib-berlin.mpg.de
http://www.mpib-berlin.mpg.de/en/staff/markus-werkle-bergner
*********************************************************************

________________________________________
Von: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl]
Gesendet: Montag, 2. Januar 2017 14:17
An: FieldTrip discussion list
Betreff: Re: [FieldTrip] ft_sourcestatistics does not recognize source  input   data

Markus,

Can you switch off the ‘keepfilter’ option before you do the ‘rawtrial’ business?

The error context suggests that MATLAB tries to allocate data to a cell-array, which is probably the spatial filter (or possibly the label). Since this information is not needed for the statistical inference, you can discard it.

Best,
JM


J.M.Schoffelen
Senior Researcher, VIDI-fellow
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands

On 02 Jan 2017, at 14:03, Werkle, Markus <werkle at mpib-berlin.mpg.de<mailto:werkle at mpib-berlin.mpg.de>> wrote:

Dear Cristiano,

thank you very much for this suggestion.

This is how my source-structures look like:

src00

src00 =

         freq: 9.7656
    cumtapcnt: [201x1 double]
          dim: [27 36 30]
       inside: [29160x1 logical]
          pos: [29160x3 double]
       method: 'rawtrial'
        trial: [1x201 struct]
           df: 201
          cfg: [1x1 struct]
   sampleinfo: [201x2 double]

src00.trial(1)

ans =

            pow: [29160x1 double]
          noise: [29160x1 double]
         filter: {29160x1 cell}
          label: {60x1 cell}
   filterdimord: '{pos}_ori_chan'


As you can see, the field 'inside' is included. And the dimension of the trial data match it too. I guess, I need to dig deeper into the FT-functions ...

Best,
Markus

*********************************************************************
Dr. Markus Werkle-Bergner, Dipl. Psych.
Senior Research Scientist (W2)

Jacobs Foundation Research Fellow 2017-2019

Max Planck Institute for Human Development
Center for Lifespan Psychology

Lentzeallee 94, 14195 Berlin

Tel.: 0049 (0)30 82406 447 Fax.: 0049 (0)30 824 99 39
Mail: werkle at mpib-berlin.mpg.de<mailto:werkle at mpib-berlin.mpg.de>
http://www.mpib-berlin.mpg.de/en/staff/markus-werkle-bergner
*********************************************************************

________________________________________
Von: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>]" im Auftrag von "Cristiano Micheli [michelic72 at gmail.com<mailto:michelic72 at gmail.com>]
Gesendet: Montag, 2. Januar 2017 13:43
An: FieldTrip discussion list
Betreff: Re: [FieldTrip] ft_sourcestatistics does not recognize source input    data

Dear Markus

Happy new year to you!

It might be about the number of sources declared as 'inside' in your head volume.
Please double check the indices of your source.inside field because an error of the type:

Error in ft_datatype_source (line 187)
           val{indx(k)}(1,:,:,:) = dat{indx(k)};


might indicate that there is a problem there. In fact if the source.inside field is empty I would imagine that this error would pop up. However I am not 100% sure because you did not include your src structures as attachments.

You might want also to try the option

dbstop if error (toggle back with 'dbstop if clear')

to identify the contents of your variable without interrupting the running functions/scripts
(it's an automatic breakpoint).


Best of luck!
Cris Micheli




On Mon, Jan 2, 2017 at 1:20 PM, Werkle, Markus <werkle at mpib-berlin.mpg.de<mailto:werkle at mpib-berlin.mpg.de><mailto:werkle at mpib-berlin.mpg.de>> wrote:
Dear Jan-Mathijs,

thank you for you fast reply. But unfortunately, removing the fields does not change the error message et all.

Best,
Markus

*********************************************************************
Dr. Markus Werkle-Bergner, Dipl. Psych.
Senior Research Scientist (W2)

Jacobs Foundation Research Fellow 2017-2019

Max Planck Institute for Human Development
Center for Lifespan Psychology

Lentzeallee 94, 14195 Berlin

Tel.: 0049 (0)30 82406 447<tel:0049%20%280%2930%2082406%20447> Fax.: 0049 (0)30 824 99 39<tel:0049%20%280%2930%20824%2099%2039>
Mail: werkle at mpib-berlin.mpg.de<mailto:werkle at mpib-berlin.mpg.de><mailto:werkle at mpib-berlin.mpg.de>
http://www.mpib-berlin.mpg.de/en/staff/markus-werkle-bergner
*********************************************************************

________________________________________
Von: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl><mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl><mailto:fieldtrip-bounces at science.ru.nl>]" im Auftrag von "Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl><mailto:jan.schoffelen at donders.ru.nl>]
Gesendet: Montag, 2. Januar 2017 12:50
An: FieldTrip discussion list
Betreff: Re: [FieldTrip] ft_sourcestatistics does not recognize source input data

Markus,

Can you remove the self-baked fields ‘stim’ and ‘rating’ and try again please?
Thanks,
BW,
JM


J.M.Schoffelen
Senior Researcher, VIDI-fellow
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands






On 02 Jan 2017, at 12:41, Werkle, Markus <werkle at mpib-berlin.mpg.de<mailto:werkle at mpib-berlin.mpg.de><mailto:werkle at mpib-berlin.mpg.de>> wrote:


Dear Fieldtrippers,


happy new year to everyone here!

This is the second attempt to get help on an issue with ft_sourcestatistics. As I still can not figure out where the problem resides, I give it a new try.

My goal is to use a common DICS filter to reconstruct single-trial data in three conditions. Afterwards, I want to run a test for a linear effect across the conditions. I thought to follow closely the descriptions in http://www.fieldtriptoolbox.org/example/common_filters_in_beamforming , especially in the way I extract the single-trial data. However, when I run ft_sourcestatistics, the single trial source data is not recognized as source data ...

Any ideas on what went wrong?

Below is the code and error-messages:



When I run the code below:

%----------------------------------------------------------------------------------------------------------
src_descrcfg = [];
src_descrcfg.keeptrials = 'yes';
src00 = ft_sourcedescriptives(src_descrcfg,src00);
src01 = ft_sourcedescriptives(src_descrcfg,src01);
src11 = ft_sourcedescriptives(src_descrcfg,src11);


src_statscfg = [];
src_statscfg.parameter   = 'trial.pow';
src_statscfg.method      = 'analytic';
src_statscfg.statistic   = 'indepsamplesregrT';
src_statscfg.alpha       = 0.05;
src_statscfg.correctm    = 'no';

src_statscfg.design(1,:)  = [ones(1,src00.df) 2*ones(1,src01.df) 3*ones(1,src11.df)];
src_statscfg.ivar         = 1; % the 1st row in cfg.design contains the independent variable

src_stat = ft_sourcestatistics(src_statscfg, src00, src01, src11);
%----------------------------------------------------------------------------------------------------------

I get the following output and error message:

original data contained 201 trials
the call to "ft_sourcedescriptives" took 0 seconds and required the additional allocation of an estimated 48 MB
original data contained 113 trials
the call to "ft_sourcedescriptives" took 0 seconds and required the additional allocation of an estimated 0 MB
original data contained 46 trials
the call to "ft_sourcedescriptives" took 0 seconds and required the additional allocation of an estimated 0 MB
Index exceeds matrix dimensions.

Error in ft_datatype_source (line 187)
          val{indx(k)}(1,:,:,:) = dat{indx(k)};

Error in ft_checkdata (line 251)
data = ft_datatype_source(data);

Error in ft_sourcestatistics (line 100)
varargin{i} = ft_checkdata(varargin{i}, 'datatype', 'source', 'feedback', 'no');



src00, src01, and src11 are source-solutions from a dics-beamformer with the following content:


src00 =

        freq: 9.7656
   cumtapcnt: [201x1 double]
         dim: [27 36 30]
      inside: [29160x1 logical]
         pos: [29160x3 double]
      method: 'rawtrial'
       trial: [1x201 struct]
          df: 201
         cfg: [1x1 struct]
  sampleinfo: [201x2 double]
      rating: [201x2 double]
        stim: {201x3 cell}


The source-solutions were based on a common dics-filter after running the following code:

%----------------------------------------------------------------------------------------------------------
% compute single trial spectra
mtmfftcfg.keeptrials = 'yes';
mtmfft_singletrl = ft_freqanalysis(mtmfftcfg,data);

% project all trials through common spatial filter %
dics_alltrl_cfg = [];
dics_alltrl_cfg = dics_commoncfg;
dics_alltrl_cfg.grid.filter = dics_common.avg.filter; % use the common filter computed in the previous step!
dics_alltrl_cfg.rawtrial    = 'yes';      % project each single trial through the filter. Only necessary if you are interested in reconstructing single trial data

tmp_dics_all = ft_sourceanalysis(dics_alltrl_cfg, mtmfft_singletrl); % contains the source estimates for all trials/both
%----------------------------------------------------------------------------------------------------------


Any ideas, why the data is not recognized as source-data when calling ft_sourcestatistics (obviously it is recognized correctly with ft_sourcedescriptives ...).


Thank you very much for your help.

Best regards,
Markus



*********************************************************************
Dr. Markus Werkle-Bergner, Dipl. Psych.
Senior Research Scientist (W2)

Jacobs Foundation Research Fellow 2017-2019

Max Planck Institute for Human Development
Center for Lifespan Psychology

Lentzeallee 94, 14195 Berlin

Tel.: 0049 (0)30 82406 447 Fax.: 0049 (0)30 824 99 39
Mail: werkle at mpib-berlin.mpg.de<mailto:werkle at mpib-berlin.mpg.de><mailto:werkle at mpib-berlin.mpg.de>
http://www.mpib-berlin.mpg.de/en/staff/markus-werkle-bergner
*********************************************************************
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl><mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip




_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl><mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl><mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip








More information about the fieldtrip mailing list