Skip to content

reading eeglab set files #2672

Closed
Closed

Description

@mmagnuski

I was wondering if you have any tools for reading eeglab .set files (along with .fdt) and converting to mne-python representation?
It would have seemed easy to do if not for the fact that sometimes (always?) scipy.io.loadmat fails in reading eeglab .set files (eeglab .set files are just .mat files). See my issue on scipy repo here.

Activity

  1. jasmainak commented on Dec 5, 2015

    @jasmainak
    Member

    Not at the moment, but I think this would be a useful addition definitely.

  2. mmagnuski commented on Dec 6, 2015

    @mmagnuski
    MemberAuthor

    I would be happy to dig into this, but I would have to use something else than scipy.io.loadmat to open the .set files. I'll try using h5py or h5io...

  3. jasmainak commented on Dec 6, 2015

    @jasmainak
    Member

    I tried the sample data from EEGLAB and it seems to be loading fine using scipy. Let us know what solution you find for your file.

  4. mmagnuski commented on Dec 6, 2015

    @mmagnuski
    MemberAuthor

    Did you try the file I link to in the issue here?
    With h5py I'm getting OSError: Unable to open file (File signature not found).

  5. mmagnuski commented on Dec 6, 2015

    @mmagnuski
    MemberAuthor

    I managed to open datasets from a different study with loadmat. I'll investigate this in the next couple of days.

  6. jasmainak commented on Dec 6, 2015

    @jasmainak
    Member

    I just tried and both files work fine for me.

  7. jasmainak commented on Dec 6, 2015

    @jasmainak
    Member

    ... but I'm on python2.7

  8. jona-sassenhagen commented on Dec 6, 2015

    @jona-sassenhagen
    Contributor

    This would be cool to have. Would you also do EEGLAB ICA files? :)
    As a workaround, I've previously used the BVA export function of EEGLAB.

  9. mmagnuski commented on Dec 6, 2015

    @mmagnuski
    MemberAuthor

    What do you mean by EEGLAB ICA files?
    eeglab keeps everything packed in the EEG structure (the .set file; the eeg signal is usually kept as float32 in a separate .fdt file). ICA weights are kept in EEG.icaweights and EEG.icasphere. I was planning to extract these too.

  10. jona-sassenhagen commented on Dec 6, 2015

    @jona-sassenhagen
    Contributor

    Yes, I meant writing out the EEGLAB ICA structure to mne/fif ICA objects.

  11. jasmainak commented on Dec 6, 2015

    @jasmainak
    Member

    I'm on it. I'll make a PR soon. @jona-sassenhagen you can lend a helping hand if you want ;) I'm not super-familiar with EEGLAB.

  12. added this to the 0.11 milestone on Dec 11, 2015
  13. mmagnuski commented on Jun 10, 2016

    @mmagnuski
    MemberAuthor

    Just BTW - I still can't import that file (or any other file for that study) I linked at the scipy issue through read_epochs_eeglab 😢 (on python 3 at least)

  14. jona-sassenhagen commented on Jun 10, 2016

    @jona-sassenhagen
    Contributor

    A practical workaround might be downsampling in EEGLAB.

  15. 16 remaining items

  16. KirstensGitHub commented on Sep 25, 2016

    @KirstensGitHub

    another file-type-related question: is there a way to use mne.read_evokeds on the .fdt and .set files?

  17. jasmainak commented on Sep 25, 2016

    @jasmainak
    Member

    @KirstensGitHub this is not possible as of now. I suppose we could theoretically support it. But I don't know what the other developers have to say. I'm sure @agramfort has an opinion on this. @KirstensGitHub isn't it possible for you to save the epochs and then average it in MNE?

  18. jona-sassenhagen commented on Sep 25, 2016

    @jona-sassenhagen
    Contributor

    Is the EEGLAB format intended to store evoked data? I think it's intended for epochs and continuous.

    EEGLAB is really not about evoked stuff, but about single trial stuff.

  19. jasmainak commented on Sep 25, 2016

    @jasmainak
    Member

    This is indeed what I thought ...

  20. zhang470 commented on Jan 14, 2017

    @zhang470

    On my Windows 10 system, the mne.io.read_raw_eeglab reader always tried to append ".mat" to the .set file name with the error No such file or directory: 'xxxx.set.mat'. I tried reading the same EEG data in edf format , and mne.io.read_raw_edf() worked just fine. Not sure why .mat is automatically appended to the .set file name...

  21. agramfort commented on Jan 14, 2017

    @agramfort
    SponsorMember
  22. zhang470 commented on Jan 14, 2017

    @zhang470

    scipy version: 0.18.1

    platform : win-64
    conda version : 4.2.15
    conda is private : False
    conda-env version : 4.2.15
    conda-build version : 2.0.2
    python version : 2.7.13.final.0
    requests version : 2.12.4

  23. jasmainak commented on Jan 14, 2017

    @jasmainak
    Member

    can you paste the error and also what exactly you are passing as input_fname?

  24. mmagnuski commented on Jan 14, 2017

    @mmagnuski
    MemberAuthor

    The error @KirstensGitHub had (didn't notice that discussion before) reminds me of another problem when reading set files - eeglab, when reading set + fdt files checks the filename in EEG.data but also the name of the set file (mne python only checks EEG.data). In some cases these names are not exactly the same (ie EEG.data.replace('.fdt', '.set') != set_filename) so might be good not to rely (at least not only) on EEG.data field.

  25. zhang470 commented on Jan 14, 2017

    @zhang470

    I just realize I need to do "import scipy" first. Now mne.io.read_raw_eeglab () can read raw EEG .set files just fine. But I could not get the mne.read_epochs_eeglab () to read in the epoched datasets in EEGLAB to work. The reader always showed AttributeError.

    epochs = mne.read_epochs_eeglab(fname)
    

    File "C:\Users\Yang\Anaconda3\lib\site-packages\mne\io\eeglab\eeglab.py", line 241, in read_epochs_eeglab
    uint16_codec=uint16_codec)
    File "", line 2, in init
    File "C:\Users\Yang\Anaconda3\lib\site-packages\mne\utils.py", line 708, in verbose
    return function(*args, **kwargs)
    File "C:\Users\Yang\Anaconda3\lib\site-packages\mne\io\eeglab\eeglab.py", line 484, in init
    event_type = '/'.join(ep.eventtype.tolist())
    AttributeError: 'int' object has no attribute 'tolist'

  26. agramfort commented on Jan 15, 2017

    @agramfort
    SponsorMember
  27. barisakin98 commented on Dec 25, 2019

    @barisakin98

    Hi,
    I am working on a .fdt file. While ı am trying to read it with python scipy-loadmat, I am taking this error:
    ValueError: Unknown mat file type, version 147, 65

    what should I do in this situation, thanks for your helps!

  28. jasmainak commented on Dec 25, 2019

    @jasmainak
    Member

    Can you please provide the full traceback? Also for questions, the right place to ask is the mailing list. You should post on github only if you are reasonably sure you have a bug

  29. agramfort commented on Dec 25, 2019

    @agramfort
    SponsorMember
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions