How to save the preprocessed data in EEGLAB to.fIf format?

If you have a question or issue with MNE-Python, please include the following info:

  • MNE-Python version: 0.21.2
  • operating system: windows 10

Dear MEG developers,
I am encountering a problematic situation while saving epochs. I would like to take EEGLAB preprocessed EEG data from . set format conversion to .fif format , but it fails to save with this RuntimeWarning message:
C:\Users\SCEL.spyder-py3\temp.py:19: RuntimeWarning: This filename (26 post_ica_1.fif) does not conform to MNE naming conventions. All epochs files should end with -epo.fif, -epo.fif.gz, _epo.fif or _epo.fif.gz
data.save(subjects+’ post_ica_1.fif’,overwrite=True)
How can I solve this issue?
I need some help. Thanks!
Best,
Dan

import hypyp
import numpy as np
import mne
from mne.preprocessing import ICA
from mne.time_frequency import tfr_morlet
subjects=0
allsub = ['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26'];
for subjects in allsub:
    data_path='C:\\wangdan\\study 2\\EC_ICA\\'+subjects+' post_ica_1.set'
    data=mne.io.read_epochs_eeglab(data_path)
    data_path_save = 'C:\\wangdan\\study 2\\EC_ICA\\'+subjects+' post_ica_1.fif'
    data.save(subjects+' post_ica_1.fif',overwrite=True)

hi Dan

it’s not an error but just a warning.

to avoid this warning use:

post_ica_1-epo.fif

for the filename

Alex

3 Likes

Thank you for your helpful advice!