-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
non-existent field 'ref' #1
Comments
cc @apoorva6262 |
Correct me if I'm wrong, but I don't think MNE actually saves any referencing info unless it's an average reference in projection mode. So I think the best way to resolve this for We should probably also call Since @cbrnr worked on EEGLAB exports before, any thoughts on this? Maybe we should add a field to MNE like EEGLAB to store referencing info? |
@jackz314 , yeah I did perform average referencing on my dataset. |
@jackz314 can you reproduce with one of your test files? It is strange that we did not notice before. You are right that currently MNE doesn't store the reference, although this has been discussed before (and I think it should be added). If setting |
The weird thing is all the files exported from my test files work fine in EEGLAB even without the ref field, the field seems to be created automatically by EEGLAB if it doesn't exist in the set file. I'm not sure what exactly happened here though, maybe it's the EEGLAB version? Or maybe there are some extra steps involved in getting this error? Either way, I think setting the @apoorva6262 can you provide some details on how you're getting the error? Is it just by loading in the set file alone? What version of the EEGLAB are you using? |
@jackz314 , I actually opened a .set file that I initially saved on EEGLAB. I read this file on MNE , performed average referencing, filtering and ICA and then saved the file as .set and just loaded it on EEGLAB. I use EEGLAB v2020.0 version. I get this error when using export_mne_epochs(epochs, "file_name.set") and export_mne_raw(raw, "file_name.set"). |
I pushed a fix that just adds the ref field to the set file, it's on the main branch, can you try it and see if it works? |
@cbrnr I confirmed that if you leave the ref field as an empty string, or nothing at all just like before, EEGLAB (v2021.0) will create the ref field and set it to 'common'. |
Do I need to reinstall the eeglabio package ? |
You should be able to install like this
|
still the same error |
I just added explicit type conversion so the second error shouldn't appear again, but I'm not sure about the ref error. |
@jackz314 but why did the error happen in the first place if the |
Also, I'm pretty sure |
@apoorva6262 I just downloaded the older version of EEGLAB (v2020.0) and tested out some of my exported files, it seems like the ref error is no longer thrown if the ref field is added. Can you verify that you actually installed the latest version of eeglabio? What might have happened is pip didn't install the latest version of the code because there's already a version with the same major version installed, so you might need to uninstall the existing eeglabio first before installing again. @cbrnr I looked at the older version of EEGLAB's code and it doesn't create the ref field automatically, hence the error. The field is only created automatically in the 2021 version it seems. I'm not sure why common is used as the default value by EEGLAB, but at least in EEGLAB there're "common" and "average" two different types. |
Alright then!
OK, that's strange. |
In EEGLAB, the code to add the default ref field is:
in the old version it has this code as well, but it also in some conditions (when |
OK, so setting it to |
works now! thank you so much! |
FYI @jackz314 there's a report of a possible bug on the MNE forum: https://mne.discourse.group/t/opening-set-files-on-eeglab/3108
The text was updated successfully, but these errors were encountered: