[Eeglablist] Using ICLabel/ICFlag component removal in a Python-based workflow

Arnaud Delorme adelorme at ucsd.edu
Mon Mar 25 18:33:23 PDT 2024


Hi Chris,

Octave 8.x appears to have a change in how it handles array slices compared to MATLAB. This results in a drastic slowdown (approximately 10,000 times) when executing the ICLabel neural network, with runtimes increasing from 10 seconds to potentially 30 hours. You might consider trying Octave 5 as a workaround. Also, the compiled version of EEGLAB includes ICLabel, and its upcoming 2024.1 release will support automated script execution (no graphical interface required).

Arno

> On Mar 25, 2024, at 12:37 PM, Christopher James Winnard via eeglablist <eeglablist at sccn.ucsd.edu> wrote:
> 
> Hi,
> 
> Apologies if this is a silly question. I'm trying to implement EEGLab's ICA tools into a Python workflow, and I'm struggling to use ICLabel/ICFlag for component removal.
> 
> One approach I tried was to create a function in MATLAB/EEGLAB, and use the matlab.eng class of the MATLAB Python module to run this in my Python script. The function should ideally take in a .set file, run ICA, run ICLabel/ICFlag, allow the user to reject bad components, and then save the EEG data as a .set. I would then just reopen this set in the Python script. This method works fine for most other analysis work, but it seems to have issues because of the interactive nature of ICLabel/ICFlag.
> 
> I've also tried using Oct2Py to run the code more directly "within" Python, but I have had various issues getting this to work properly for ICLabel/ICFlag and to display the GUI. In all honesty I'm not so experienced with Oct2Py, so I'm not sure if there is an obvious solution I have missed.
> 
> Any advice would be greatly appreciated.
> 
> Kind regards,
> Chris Winnard
> 
> _______________________________________________
> 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