[Eeglablist] Problem with newtimeftrialbaseln.m

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Thu Jan 20 08:47:01 PST 2022


Wonderful, thank you so much.

Makoto

On Thu, Jan 20, 2022 at 2:12 AM Klatt, Laura <Klatt at ifado.de> wrote:

> Dear Makoto,
>
> Thank you for your kind response! I appreciate the time you spent to
> review my question.
> As suggested, I opened a new issue on GitHub, using the link you provided.
>
> Kind regards,
> Laura
>
> --
> Dr. Laura-Isabelle Klatt
> Leibniz Research Centre for Working Environment and Human Factors
> Department of Ergonomics
> Research Unit: Information processing
> Ardeystr. 67
> 44139 Dortmund
>
> Contact:
> klatt at ifado.de
> +49 / 231 1084 260
> twitter: @LoraKlatt
>
> Personal website:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lauraklatt.github.io_&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=pyiMpJA6aQ3IKcfd-jIW1kWlr8b1b2ssGmoavJHHJ7Q&m=Af3rM1RftTwQ_XZYFLqh-8f_v_xqTr9A1WaiVLoJu76UKLpNLXRVwsod2iXLGzuF&s=u0fP8vJ_CmddJDNP8fpZCvJPih8s-7zVR5mCGd2XZXQ&e=
>
>
>
> Am 19.01.22, 03:44 schrieb "Makoto Miyakoshi" <mmiyakoshi at ucsd.edu>:
>
>     Dear Laura,
>
>     It is impressive that you successfully debugged EEGLAB. Thank you also
> for
>     kindly letting us know.
>     You underpinned a good problem. Could you please report it to the
>     developers so that in the next release of EEGLAB it will be fixed?
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sccn_eeglab_issues&d=DwIFaQ&c=-35OiAkTchMrZOngvJPOeA&r=kB5f6DjXkuOQpM1bq5OFA9kKiQyNm1p6x6e36h3EglE&m=itNiLbVQWPHLR--ZBQJOmbE-FVeXVA4BroY17yu4uFqZkRFprmV7m556waItCfVk&s=P0bZhi0oDTlOMGbZTLKcv-iyjb9QhU5V5EjC5LO0BC8&e=
>     I thought of copy and paste it on behalf of you but I realized you
> won't
>     receive any updates if I post it from my account.
>     I appreciate your patience and cooperation.
>     Thank you Laura!
>
>     Makoto
>
>     On Fri, Jan 7, 2022 at 10:12 AM Klatt, Laura via eeglablist <
>     eeglablist at sccn.ucsd.edu> wrote:
>
>     > Hi all,
>     >
>     > I encounter a problem with the newtimeftrialbaseln() function when I
> want
>     > to load erspdata using std_erspplot().
>     >
>     > Specifically, I created a STUDY design and precomputed ERSPs. In
> order to
>     > load the data to plot topographies, I then run the following lines
> of code
>     > (using EEGLAB v2021.1 and MATLAB R2021b):
>     >
>     > EEG=ALLEEG(1);
>     > electrodes = {EEG.chanlocs.labels};
>     > [STUDY, erspdata, ersptimes, erspfreqs] =
>     > std_erspplot(STUDY,ALLEEG,'channels',electrodes, 'noplot', 'on');
>     >
>     > And I get this error message:
>     >
>     > Index in position 3 exceeds array bounds. Index must not exceed 60.
>     >
>     > Error in newtimeftrialbaseln (line 99)
>     >             mbase = mean(P(:,:,tmpbase,:),3);
>     >
>     > Error in std_readdata>processtf (line 412)
>     >         dataout = newtimeftrialbaseln(P, xvals, g);
>     >
>     > Error in
>     >
> std_readdata>@(x)processtf(x,xvals,opt.datatype,opt.singletrials,params)
>     > (line 246)
>     >             dataTmp{iSubj} = cellfun(@(x)processtf(x, xvals,
> opt.datatype,
>     > opt.singletrials, params), dataTmp{iSubj}, 'uniformoutput', false);
>     >
>     > Error in std_readdata (line 246)
>     >             dataTmp{iSubj} = cellfun(@(x)processtf(x, xvals,
> opt.datatype,
>     > opt.singletrials, params), dataTmp{iSubj}, 'uniformoutput', false);
>     >
>     > Error in std_erspplot (line 250)
>     >     [STUDY, allersp, alltimes, allfreqs, events, paramsersp] =
>     > std_readdata(STUDY, ALLEEG, 'channels', opt.channels, 'timerange',
>     > params.timerange, ...
>     >
>     > I tracked the error down to newtimeftrialbaseln. According to the
>     > documentation of newtimeftrialbaseln the tf input data should have
> the
>     > following the dimensions:
>     > [freqs x times x trials] or [channels x freqs x times x trials].
>     >
>     > However, it seems like the variable that causes the code to crash
>     > (variable P, see line 99) has the wrong order of dimensions. In my
> case it
>     > is [freq x times x trials x channels].
>     > I cannot figure out why that is. The code runs fine if I am only
> trying to
>     > load data from one channel (i.e., when the input data is
> 3-dimensional:
>     > freqs x times x trials).
>     >
>     > Of course I could simply reshape the variable P, but I’d rather not
> mess
>     > around in the build-in EEGLAB functions without understanding why
> that
>     > error occurs.
>     >
>     > My current workaround is to only load one channel at a time, looping
>     > through my ‘electrodes’ variable until I have the data from all
> electrodes.
>     > But of course that is somewhat inefficient.
>     >
>     > I appreciate any comments or hints.
>     >
>     > Thanks a lot!
>     > Best,
>     > Laura
>     >
>     >
>     >
>     >
>     > --
>     > Dr. Laura-Isabelle Klatt
>     > Leibniz Research Centre for Working Environment and Human Factors
>     > Department of Ergonomics
>     > Research Unit: Information processing
>     > Ardeystr. 67
>     > 44139 Dortmund
>     >
>     > Contact:
>     > klatt at ifado.de
>     > +49 / 231 1084 260
>     > twitter: @LoraKlatt
>     >
>     > Personal website:
>     >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lauraklatt.github.io_&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=kB5f6DjXkuOQpM1bq5OFA9kKiQyNm1p6x6e36h3EglE&m=GUFNy43aiGBdmL9h_EH-a80yMQL2HHeeV4Urh90aLbh0ZGAYi4GEAAGNIYaSsoeC&s=9acLLWra8mFUmhTluc4OlBgBCYwKWYfIiLMqSzoVW6M&e=
>     >
>     > _______________________________________________
>     > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>     > To unsubscribe, send an empty email to
>     > eeglablist-unsubscribe at sccn.ucsd.edu
>     > For digest mode, send an email with the subject "set digest mime" to
>     > eeglablist-request at sccn.ucsd.edu
>
>
>



More information about the eeglablist mailing list