<div dir="ltr">Dear Markus<div><br></div><div>Happy new year to you!</div><div><br></div><div>It might be about the number of sources declared as 'inside' in your head volume.</div><div>Please double check the indices of your source.inside field because an error of the type:</div><div><span style="font-size:12.8px"><br></span></div><div><i style="background-color:rgb(255,153,0)"><span style="font-size:12.8px">Error in ft_datatype_source (line 187)</span><br style="font-size:12.8px"><span style="font-size:12.8px">            val{indx(k)}(1,:,:,:) = dat{indx(k)};</span></i><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">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.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">You might want also to try the option </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><i>dbstop if error </i>(toggle back with 'dbstop if clear')</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">to identify the contents of your variable without interrupting the running functions/scripts</span></div><div><span style="font-size:12.8px"> (it's an automatic breakpoint).</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Best of luck!</span></div><div><span style="font-size:12.8px">Cris Micheli</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 1:20 PM, Werkle, Markus <span dir="ltr"><<a href="mailto:werkle@mpib-berlin.mpg.de" target="_blank">werkle@mpib-berlin.mpg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Jan-Mathijs,<br>
<br>
thank you for you fast reply. But unfortunately, removing the fields does not change the error message et all.<br>
<br>
Best,<br>
<span class="">Markus<br>
<br>
******************************<wbr>******************************<wbr>*********<br>
Dr. Markus Werkle-Bergner, Dipl. Psych.<br>
Senior Research Scientist (W2)<br>
<br>
Jacobs Foundation Research Fellow 2017-2019<br>
<br>
Max Planck Institute for Human Development<br>
Center for Lifespan Psychology<br>
<br>
Lentzeallee 94, 14195 Berlin<br>
<br>
Tel.: <a href="tel:0049%20%280%2930%2082406%20447" value="+493082406447">0049 (0)30 82406 447</a> Fax.: <a href="tel:0049%20%280%2930%20824%2099%2039" value="+49308249939">0049 (0)30 824 99 39</a><br>
Mail: <a href="mailto:werkle@mpib-berlin.mpg.de">werkle@mpib-berlin.mpg.de</a><br>
<a href="http://www.mpib-berlin.mpg.de/en/staff/markus-werkle-bergner" rel="noreferrer" target="_blank">http://www.mpib-berlin.mpg.de/<wbr>en/staff/markus-werkle-bergner</a><br>
******************************<wbr>******************************<wbr>*********<br>
<br>
______________________________<wbr>__________<br>
</span>Von: <a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.<wbr>nl</a> [<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.<wbr>nl</a>]&quot; im Auftrag von &quot;Schoffelen, J.M. (Jan Mathijs) [<a href="mailto:jan.schoffelen@donders.ru.nl">jan.schoffelen@donders.ru.nl</a>]<br>
Gesendet: Montag, 2. Januar 2017 12:50<br>
An: FieldTrip discussion list<br>
Betreff: Re: [FieldTrip] ft_sourcestatistics does not recognize source input data<br>
<div class="HOEnZb"><div class="h5"><br>
Markus,<br>
<br>
Can you remove the self-baked fields ‘stim’ and ‘rating’ and try again please?<br>
Thanks,<br>
BW,<br>
JM<br>
<br>
<br>
J.M.Schoffelen<br>
Senior Researcher, VIDI-fellow<br>
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands<br>
<br>
<br>
<br>
<br>
<br>
<br>
> On 02 Jan 2017, at 12:41, Werkle, Markus <<a href="mailto:werkle@mpib-berlin.mpg.de">werkle@mpib-berlin.mpg.de</a>> wrote:<br>
><br>
><br>
> Dear Fieldtrippers,<br>
><br>
><br>
> happy new year to everyone here!<br>
><br>
> 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.<br>
><br>
> 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 <a href="http://www.fieldtriptoolbox.org/example/common_filters_in_beamforming" rel="noreferrer" target="_blank">http://www.fieldtriptoolbox.<wbr>org/example/common_filters_in_<wbr>beamforming</a> , 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 ...<br>
><br>
> Any ideas on what went wrong?<br>
><br>
> Below is the code and error-messages:<br>
><br>
><br>
><br>
> When I run the code below:<br>
><br>
> %-----------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-----------------<br>
> src_descrcfg = [];<br>
> src_descrcfg.keeptrials = 'yes';<br>
> src00 = ft_sourcedescriptives(src_<wbr>descrcfg,src00);<br>
> src01 = ft_sourcedescriptives(src_<wbr>descrcfg,src01);<br>
> src11 = ft_sourcedescriptives(src_<wbr>descrcfg,src11);<br>
><br>
><br>
> src_statscfg = [];<br>
> src_statscfg.parameter   = 'trial.pow';<br>
> src_statscfg.method      = 'analytic';<br>
> src_statscfg.statistic   = 'indepsamplesregrT';<br>
> src_statscfg.alpha       = 0.05;<br>
> src_statscfg.correctm    = 'no';<br>
><br>
> src_statscfg.design(1,:)  = [ones(1,src00.df) 2*ones(1,src01.df) 3*ones(1,src11.df)];<br>
> src_statscfg.ivar         = 1; % the 1st row in cfg.design contains the independent variable<br>
><br>
> src_stat = ft_sourcestatistics(src_<wbr>statscfg, src00, src01, src11);<br>
> %-----------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-----------------<br>
><br>
> I get the following output and error message:<br>
><br>
> original data contained 201 trials<br>
> the call to "ft_sourcedescriptives" took 0 seconds and required the additional allocation of an estimated 48 MB<br>
> original data contained 113 trials<br>
> the call to "ft_sourcedescriptives" took 0 seconds and required the additional allocation of an estimated 0 MB<br>
> original data contained 46 trials<br>
> the call to "ft_sourcedescriptives" took 0 seconds and required the additional allocation of an estimated 0 MB<br>
> Index exceeds matrix dimensions.<br>
><br>
> Error in ft_datatype_source (line 187)<br>
>            val{indx(k)}(1,:,:,:) = dat{indx(k)};<br>
><br>
> Error in ft_checkdata (line 251)<br>
>  data = ft_datatype_source(data);<br>
><br>
> Error in ft_sourcestatistics (line 100)<br>
>  varargin{i} = ft_checkdata(varargin{i}, 'datatype', 'source', 'feedback', 'no');<br>
><br>
><br>
><br>
> src00, src01, and src11 are source-solutions from a dics-beamformer with the following content:<br>
><br>
><br>
> src00 =<br>
><br>
>          freq: 9.7656<br>
>     cumtapcnt: [201x1 double]<br>
>           dim: [27 36 30]<br>
>        inside: [29160x1 logical]<br>
>           pos: [29160x3 double]<br>
>        method: 'rawtrial'<br>
>         trial: [1x201 struct]<br>
>            df: 201<br>
>           cfg: [1x1 struct]<br>
>    sampleinfo: [201x2 double]<br>
>        rating: [201x2 double]<br>
>          stim: {201x3 cell}<br>
><br>
><br>
> The source-solutions were based on a common dics-filter after running the following code:<br>
><br>
> %-----------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-----------------<br>
> % compute single trial spectra<br>
> mtmfftcfg.keeptrials = 'yes';<br>
> mtmfft_singletrl = ft_freqanalysis(mtmfftcfg,<wbr>data);<br>
><br>
> % project all trials through common spatial filter %<br>
> dics_alltrl_cfg = [];<br>
> dics_alltrl_cfg = dics_commoncfg;<br>
> dics_alltrl_cfg.grid.filter = dics_common.avg.filter; % use the common filter computed in the previous step!<br>
> dics_alltrl_cfg.rawtrial    = 'yes';      % project each single trial through the filter. Only necessary if you are interested in reconstructing single trial data<br>
><br>
> tmp_dics_all = ft_sourceanalysis(dics_alltrl_<wbr>cfg, mtmfft_singletrl); % contains the source estimates for all trials/both<br>
> %-----------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-----------------<br>
><br>
><br>
> Any ideas, why the data is not recognized as source-data when calling ft_sourcestatistics (obviously it is recognized correctly with ft_sourcedescriptives ...).<br>
><br>
><br>
> Thank you very much for your help.<br>
><br>
> Best regards,<br>
> Markus<br>
><br>
><br>
><br>
> ******************************<wbr>******************************<wbr>*********<br>
> Dr. Markus Werkle-Bergner, Dipl. Psych.<br>
> Senior Research Scientist (W2)<br>
><br>
> Jacobs Foundation Research Fellow 2017-2019<br>
><br>
> Max Planck Institute for Human Development<br>
> Center for Lifespan Psychology<br>
><br>
> Lentzeallee 94, 14195 Berlin<br>
><br>
> Tel.: 0049 (0)30 82406 447 Fax.: 0049 (0)30 824 99 39<br>
> Mail: <a href="mailto:werkle@mpib-berlin.mpg.de">werkle@mpib-berlin.mpg.de</a><br>
> <a href="http://www.mpib-berlin.mpg.de/en/staff/markus-werkle-bergner" rel="noreferrer" target="_blank">http://www.mpib-berlin.mpg.de/<wbr>en/staff/markus-werkle-bergner</a><br>
> ******************************<wbr>******************************<wbr>*********<br>
> ______________________________<wbr>_________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
> <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
</div></div></blockquote></div><br></div>