[Eeglablist] Issues with running pop_selectcomps outside of GUI
Arnaud Delorme
arno at ucsd.edu
Thu Jun 14 11:54:21 PDT 2018
Hi Chris,
In your specific example, simply change
eegset(i) = pop_selectcomps(eegset(i),[comps])
to
EEG = eegset(i);
eegset(i) = pop_selectcomps(EEG,[comps])
And make sure you run this as a script (not a function). That should solve the issue.
I agree it is not ideal and it would be possible to modify this function to make it without this trick.
Best wishes,
Arno
> On Jun 10, 2018, at 7:57 PM, Chris Rose <u6t9n7 at u.northwestern.edu> wrote:
>
> Hello all,
>
> I realize this is probably better reported in Bugzilla, but I haven't been able to figure out where one sets up a login to access that, so apologies in advance for that.
>
> Basically I've been troubleshooting a series of errors while trying to get pop_selectcomps running in a script, as I need to process a large number of files and it seems less cumbersome than using the GUI in full. My data is structured such that each recording session is saved as a structure array populated by EEGLAB structures for each recording during the session (up to 6, taken from different individuals simultaneously).
>
> Trying to call the substructure eeg elements in their current form (as in eegset(i) = pop_selectcomps(eegset(i),[comps]) would initialize properly, but attempting to inspect individual components would cause an error whenever constructing the secondary figure. It seems that the call to pop_prop on line 160 of selectcomps had an error where inputname(1) was empty by the time pop_props was called:
>
> Error using pop_prop( , 0, 1, gcbo, { 'freqrange', [1 50] });
> Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.
>
> Error while evaluating UIControl Callback.
>
> I was able to circumvent this by creating a second set of variables, which I just called EEG and ALLEEG for convenience, to hold the current recording and sessions structure, respectively. This allowed for full displays of each component, however it would only allow me to select or reject component 1, and give errors when generating the figure for all the others. This seemed to be due to an inproper initialization of eeg.reject.gcompsreject, though I'm not sure exactly what this variable should look when functioning properly. Currently it is only a 0 or 1, depending on whether I had pressed reject for the first component. I tried hardcoding this to be an array of logicals that's the same length of the number of components, but it appears to get rewritten whenever I call selectcomps. Here's the error I get in those instances:
>
> Index exceeds matrix dimensions.
>
> Error in pop_prop (line 260)
> status = EEG.reject.gcompreject(chanorcomp);
>
> Error while evaluating UIControl Callback.
>
> Admittedly, I'm at a bit of a loss for how to fix this, I feel like it may even be that there is just a variable in my EEG structure that isn't populated correctly that pop_prop is dependent on, but have little inuition for what that might be (after using runica, I also had problems with selectcomps because eeg.icawinv and eeg.icaact hadn't been stored, but that was a much more straightforward fix). Thanks if you made it this far through my blundersome tale, and any help you can offer is greatly appreciated!
>
> Best,
>
> Chris
> _______________________________________________
> 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