ucdavis / erplab

ERPLAB Toolbox is a free, open-source Matlab package for analyzing ERP data. It is tightly integrated with EEGLAB Toolbox, extending EEGLAB’s capabilities to provide robust, industrial-strength tools for ERP processing, visualization, and analysis. A graphical user interface makes it easy for beginners to learn, and Matlab scripting provides enormous power for intermediate and advanced users.
http://erpinfo.org/erplab
271 stars 73 forks source link

cannot compute grand average #147

Open Valeebarons opened 3 years ago

Valeebarons commented 3 years ago

Description

Hi,

I have 4 ERP sets with one bin each. I computed the average per subject for all the channels (n = 19). The epochs are based on the only bin I have. When I try to average across all the sets, though, I get an error message: "Unable to perform assignment because the size of the left side is 19-by-1-by-4 and the size of the right side is 19-by-1." (I included the entire error message in "Actual Behavior") Given that 4 represents the number of erpsets included, I wondered where this error comes from...

I performed a grand average before with erplab, and the only difference I notice between the erpsets I am using now and the ones I used in the past, concerns the number of trials included: in that case I had more than 1, while now I just need one for my analysis. It does not sound reasonable to me, but can the error be dependent on that?

Thanks a lot in advance for your help.

Steps to Reproduce

structure of my ERPsets:

   erpname: 'ERPsubj4_monkey_artrej'
   filename: 'ERPsubj4_monkey_artrej.erp'
   filepath: 'C:\Users\vb\Documents\MATLAB\BCIabsence\FRPs\ERP\Healthy_volunteers\subj4'
  workfiles: {'reref_ar'}
  subject: ''
  nchan: 19
  nbin: 1
  pnts: 6963
  srate: 4096
  xmin: -0.2000
  xmax: 1.4998
  times: [1×6963 double]
  bindata: [19×6963 double]
  binerror: [19×6963 double]
  datatype: 'ERP'
  ntrials: [1×1 struct]
  pexcluded: 43.8000
  isfilt: 0
  chanlocs: [1×19 struct]
  ref: 'average'
  bindescr: {''}
  saved: 'yes'
  history: [1x2402char]
  version: '8.20'
  splinefile: ''
  EVENTLIST: [1×1 struct]
  dataquality: [1×3 struct]


Expected behavior:


Get a grand average ERP set


Actual behavior:


Error:

Unable to perform assignment because the size of the left side is 19-by-1-by-4 and the size of the right side is 19-by-1. Error in gaverager (line 427) dq_data_here(:,:,:,s) = ERPT.dataquality(where_dqm_indx).data;

Error in pop_gaverager (line 352) [ERP, serror, msgboxText ] = gaverager(ALLERP, lista, optioni, erpset, nfile, wavg, stderror, artcrite, exclunullbin, warn, DQ_spec);

Error in pop_gaverager (line 173) [ERP, erpcom] = pop_gaverager(ALLERP, 'Erpsets', erpset,'Criterion', artcrite, 'SEM', stdsstr,...


Versions

OS version Windows 10
Matlab version R2018b
EEGLAB version 2021.0
ERPLAB version 8.20
ammsimmons commented 3 years ago

Hi. Did you create the original ERPsets with a version of ERPLAB before v8.0? If so, you may need to uncheck any options for "DQ/Data Quality" in the ERP Grand Averager GUI. If this solves the issue, then going forward you should expect to see this error with data not averaged with a version of ERPLAB older than ERPLAB v8.0.