[Eeglablist] ICLabel eeg_rpsd indexing error and a proposed solution

Edward Cheng b99401015 at ntu.edu.tw
Fri Feb 24 00:18:54 PST 2023


To whom it may concern,

I found an indexing error in ICLabel while processing eeg files in edf
format with different sampling frequencies.
-> For the EEG.srate = 200 ones, the Automagic runs without a hitch.
-> However, for the EEG.srate = 1000 ones, although runICA goes smoothly,
but the ICLabel give the following error: (eeg_rpsd.m, line 35, index in
position 2 is invalid)

[image: Screen Shot 2023-02-24 at 1 51 32 PM]
<https://urldefense.com/v3/__https://user-images.githubusercontent.com/126083032/221108494-efd9122c-e8d1-45a9-ad21-873a9f6099de.png__;!!Mih3wA!HXfByr0hKiA6R4jLQgv2szujtn5SZEraBVy9mqegt0fM0NCfBTIli2zkU1lORTat6UXfgPPIiUX-znYThhFyBrW8_kY$ >

Later, I found that in the eeg_rpsd.m file, when EEG.srate is 1kHz, the
n_points variable becomes 1E3, which is treated as a float rather than an
integer, causing subsequent indexings to fail.

A solution is proposed: add line 17 as shown in the next picture (n_points
= round(n_points)
[image: Screen Shot 2023-02-24 at 2 26 11 PM]
<https://urldefense.com/v3/__https://user-images.githubusercontent.com/126083032/221109230-28944d47-5d79-4fb5-9d8a-e31e7ea15776.png__;!!Mih3wA!HXfByr0hKiA6R4jLQgv2szujtn5SZEraBVy9mqegt0fM0NCfBTIli2zkU1lORTat6UXfgPPIiUX-znYThhFyYHAQrek$ >

I had also raised an issue on the sccn/ICLabel github page, but because
seeing that previous issues from the last year are not closed, I am
reposting it here for anyone interested.

Best regards,
Edward Cheng



More information about the eeglablist mailing list