[Eeglablist] FW: EEGlab bug?

Plawecki, Martin Henry mplaweck at iupui.edu
Sun Apr 24 16:27:38 PDT 2022


Please see email below - I am not sure if it was ever received or I simply sent it to the incorrect email address.
Thanks
   Marty

Martin Plawecki MD, PhD
Associate Professor of Psychiatry
Indiana University School of Medicine

From: Plawecki, Martin Henry
Sent: Tuesday, April 19, 2022 7:37 AM
To: eeglab at sccn.ucsd.edu
Cc: Argyriou, Evangelia <evargyri at iupui.edu>
Subject: EEGlab bug?

Dr. Delorme and the EEGLab team,
We are new EEGlab users but moderately (or more) experienced Matlab users. (I have used individual EEGlab functions for some time, but never the entire package.) We are unsure if we have found a bug or are simply not familiar enough with EEGlab structures and would appreciate some guidance. It was also unclear if this message was the type to be sent to the EEGLab News List.

We created a study were we have 3 runs {0, 1, 2} of a task across 2 conditions {a, p}. The conditions correspond to a drug exposure and thus needed to be collected on different sessions {1, 2}. Condition order was randomized. Consequently, the session and condition variables contain different but related information.

I can duplicate the problem (error copied below) with two datasets from a single subject, representing both sessions (and thus both conditions) of the baseline run.
For this small dataset, We receive the following error message when trying to plot grand mean averages.

Unable to perform assignment because the size of the left side is 0-by-22 and the size of the right side is 1000-by-22.

Error in std_readfile (line 141)
                    measureData{iCell}(:, pointer:pointer+size(measureDataTmp{iData}{iCell},2)-1,:) = measureDataTmp{iData}{iCell};

Error in std_readdata (line 222)
             [dataTmp{iSubj}, params, xvals, yvals, eventsTmp{iSubj} ] = std_readfile( fileName, 'designvar',
             struct(bigstruct.design.variable), opts{:}, 'channels', opt.channels);

Error in std_erpplot (line 251)
        [STUDY, erpdata, alltimes, ~, ~, fileparams] = std_readdata(STUDY, ALLEEG, 'channels', opt.channels(chaninds), 'timerange',
        params.timerange, ...

Removing the session variable allows the plot.

The code appears to assume that each session must have both conditions, creating empty cells as a placeholder which eventually crashes it.
Are we using the Study variables incorrectly, or if this a potential flaw in the code?

I have copied out script/history below, and am happy to share the limited datasets if helpful. If desired, the sets will need to be shared via invitation to a Teams location given their size and local email limitations.

Thank you for any and all help you may be able to provide
Marty

Martin Plawecki MD, PhD
Associate Professor of Psychiatry
Indiana University School of Medicine

--------------------
History Script Copied below

[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG = pop_loadset('filename',{...
    'rbp0B0761.set',...
    'raa0B0761.set'...
    },'filepath','C:\Users\mplaweck\Desktop\Saccades\error\');
eeglab redraw

%%
% Flag noise components for rejection
EEG = pop_icflag( EEG,[0 0.2;0.9 1;0.9 1;0.9 1;0.9 1;0.9 1;0.9 1]);
[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET);

% create study
[EEG ALLEEG CURRENTSET] = eeg_retrieve(ALLEEG,1);
[STUDY ALLEEG] = std_editset( STUDY, ALLEEG, 'name','Alcohol_EEG','updatedat','on','savedat','on','rmclust','off' );
[STUDY ALLEEG] = std_checkset(STUDY, ALLEEG);
CURRENTSTUDY = 1; EEG = ALLEEG; CURRENTSET = [1:length(EEG)];

% design
STUDY = std_makedesign(STUDY, ALLEEG, 1, 'name','STUDY.design 1','delfiles','off','defaultdesign','off', ...
    'variable1','condition','values1',{'a','p'},'vartype1','categorical', ...
    'variable2','type','values2',{'AntiCue','AntiTarget','Fixation','SacCue','SacTarget'},'vartype2','categorical');

% update workspace variables and redraw EEGLAB
CURRENTSTUDY = 1; EEG = ALLEEG; CURRENTSET = [1:length(EEG)]; [STUDY, ALLEEG] = std_checkset(STUDY, ALLEEG);
eeglab redraw

%%
% Precompute and plot data by removing possible noise components

[STUDY, ALLEEG] = std_precomp(STUDY, ALLEEG, {},'savetrials','on', ...
    'rmicacomps','on', ...% remove ICA components pre-selected in each dataset
    'interp','on', ...    % interpolate channel if missing
    'recompute','on', ... % force recomputing ERP file even if it is already on disk
    'erp','on', 'erpparams',{'rmbase',[-200 0] }, ...
    'spec','on','specparams',{'specmode','fft','logtrials','off'}, ...
    'erpim','on','erpimparams',{'nlines',10,'smoothing',10});

%Plot individual channel ERPs across groups
STUDY = pop_erpparams(STUDY, 'plotconditions','together');

%%%%%%%% THIS STEP GIVES ERROR AND CANNOT CREAT GRAND AVERAGE ERP %%%%%%%%%
STUDY = std_erpplot(STUDY,ALLEEG,'channels',{'CPZ'}, 'design', 1);





More information about the eeglablist mailing list