[Eeglablist] Using ICLabel/ICFlag component removal in a Python-based workflow
Christopher James Winnard
c.j.winnard at qmul.ac.uk
Mon Mar 25 12:37:27 PDT 2024
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
More information about the eeglablist
mailing list