[Eeglablist] Mismatch in duration between EEG struct and eegplot()
Cedric Cannard
ccannard at protonmail.com
Tue Jun 27 10:00:57 PDT 2023
Dear Oda,
You probably forgot to update some other variables in your command lines, which are normally updated automatically when using the GUI.
Try to add this line before plotting:
EEG = eeg_checkset(EEG);
Cedric Cannard, PhD
Sent with Proton Mail secure email.
------- Original Message -------
On Tuesday, June 27th, 2023 at 1:02 AM, Oda van Jole via eeglablist <eeglablist at sccn.ucsd.edu> wrote:
> Hi,
>
>
> I have encountered a strange problem, namely a mismatch in duration between EEG struct and the x-axis in eegplot(). I am pre-processing a resting state EEG recording that consists of 5 minutes eyes open (EO) and 5 minutes eyes closed (EC), in addition to some seconds before, between, and after these sections. I extract the two 5 min sections using pop_select() into an EEG struct (EEGconds) containing the resulting two EEG structs from pop_select() - EO and EC. For each of them, EEG.xmax, size(EEG.data, 2), and the "Epoch end (sec)" in GUI indicates a duration of 300s as expected. When calling eegplot() from code, the x-axis will go to 600 seconds, even with an eeglab redraw first. However, if I use eegplot() manually via GUI, it stops at the 300 sec as expected. Why does this happen? Am I doing something wrong?
>
>
> Code:
>
>
> % Extract sections
>
> EOstart = EEG.event(find([EEG.event.edftype] == 1)).latency;
>
> EOend = EEG.event(find([EEG.event.edftype] == 2)).latency;
>
> EEGEO = pop_select(EEG, 'point', [EOstart, EOend]);
>
> % Repeat for EC but with correct event edftypes.
>
>
> EEGconds.EO = EEGEO; EEGconds.EC = EEGEC;
>
>
> EEG = EEGconds.EO;
>
> EEG.xmax % ~300
>
> size(EEG.data, 2)/EEG.srate % ~300
>
> eegplot(EEG.data) % Now I can scroll to 600 sec
>
> eeglab redraw;
>
> eegplot(EEG.data) % can still scroll to 600s
>
>
> This also occurs even if I delete EEGconds from the workspace after assigning EEGconds.EO to EEG.
>
>
> Thanks very much in advance for your help!
>
>
> Best wishes,
>
> Oda van Jole
> _______________________________________________
> 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