Error with read_ica Function

Hi everyone, I am using ICA on my EEG data, and I have been attempting the read_ica function on my ICA fif file. However, I am receiving this error message: “Could not find ICA data.”

I looked up the source code, and I found where the error originated from. However, I am not sure how to fix it. I would love to hear suggestions!

Hello @lmctx13,

we’ll need much more information here: which version of MNE-Python are you using, how did you create the “ICA fif file”, how are you trying to read it.

Thanks,
Richard

Hi Richard,

  1. I am using version 1.0.3 of MNE.
  2. As for creating the ICA fif file, I applied ICA to my EEG data (with ica.apply(), which returns a Raw object in this case) and saved the Raw object to an ICA fif file (using raw.save()).
  3. I am attempting to use the read_ica method to read the ICA fif file (which ends with the -ica.fif extension).

I hope this helps. Let me know if you need any more information!

Hello @lmctx13,

after applying ICA to raw data via ica.apply(raw), what you get back is still raw data, but now cleaned thanks to ICA. When you then call raw.save(), again, you’re saving raw data. Of course, this file cannot be loaded via read_ica().

Best wishes,
Richard

Hi Richard,

Thank you for your help and for letting me know. I used ica.save() instead, and that worked for me!

1 Like