Skip to content
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

problem of lemon_dataset.py #295

Open
ScarletVV opened this issue May 23, 2024 · 19 comments
Open

problem of lemon_dataset.py #295

ScarletVV opened this issue May 23, 2024 · 19 comments

Comments

@ScarletVV
Copy link

When I ran this code, it output:
sub-032333 : **********************
sub-032333 : * PROCESSING FAILED! *
sub-032333 : **********************
sub-032333 : import_data : <function import_data at 0x7fd210b71900>
sub-032333 : <class 'FileNotFoundError'>
sub-032333 : [Errno 2] No such file or directory: '/home/uais1/Echo/OSL/DataPrepare/dataset/lemon/raw/sub-032333/RSEEG/sub-010041.vmrk'
sub-032333 : None

How can I fix this?

@ScarletVV ScarletVV changed the title problem of lemen_dataset.py problem of lemon_dataset.py May 23, 2024
@cgohil8
Copy link
Collaborator

cgohil8 commented May 23, 2024

The problem is it can't find this file:

/home/uais1/Echo/OSL/DataPrepare/dataset/lemon/raw/sub-032333/RSEEG/sub-010041.vmrk

Seems like there's a mismatch between the filename and subject directory. It's trying to find the file sub-010041.vmrk in the directory for sub-032333.

@ScarletVV
Copy link
Author

ScarletVV commented May 23, 2024

Yes it is, but my question is why the program wants to find the sub-010041.vmrk in the directory for sub-032333 ?
I just download the data from https://fcon_1000.projects.nitrc.org/indi/retro/MPI_LEMON/downloads/download_EEG.html and use one of them(sub-032333) to test the code and 124 line of code deleted

subjects = subjects[:2]

There is no subject named sub-010041 here, and no obvious reading of the .vmrk file code snippet in the code.

@cgohil8
Copy link
Collaborator

cgohil8 commented May 23, 2024

Where did you get lemon_dataset.py from? Can you send the contents of the script or a link.

@ScarletVV
Copy link
Author

It should call 1_preprocess.py in osl/examples/lemon. https://github.com/OHBA-analysis/osl/blob/main/examples/lemon/1_preprocess.py

@ScarletVV
Copy link
Author

This is the result of Jupyter Notebook running https://github.com/ScarletVV/lemon_process.git.

@cgohil8
Copy link
Collaborator

cgohil8 commented May 25, 2024

What version of MNE are you using?

@ScarletVV
Copy link
Author

MNE 1.3.1

@cgohil8
Copy link
Collaborator

cgohil8 commented May 25, 2024

Do get the same error if you do:

import mne

raw = mne.io.read_raw_brainvision("/home/uais1/Echo/OSL/DataPrepare/dataset/lemon/raw/sub-032333/RSEEG/sub-032333.vhdr")

@ScarletVV
Copy link
Author

yes

@cgohil8
Copy link
Collaborator

cgohil8 commented May 25, 2024

ah, it's an error in MNE then. You can try upgrade MNE:

conda activate osl
pip install --upgrade mne

Although OSL hasn't been tested against versions above MNE 1.3.1, so you might run into new bugs. If you update MNE does the following work:

import mne

raw = mne.io.read_raw_brainvision("/home/uais1/Echo/OSL/DataPrepare/dataset/lemon/raw/sub-032333/RSEEG/sub-032333.vhdr")

@ScarletVV
Copy link
Author

Same error after upgrading MNE. Can I solve this problem if I install a lower version of MNE?

@ScarletVV
Copy link
Author

Thank you for your patient guidance and answers. I will try similar work directly on MNE.

@cgohil8
Copy link
Collaborator

cgohil8 commented May 25, 2024

It's unlikely a lower version would fix this, but you can try.

You might be able to load it if you change the directory structure of the data. What happens if you create a new directory and copy only the .vhdr file into it. E.g. you can try something like:

mkdir ~/test
cp /home/uais1/Echo/OSL/DataPrepare/dataset/lemon/raw/sub-032333/RSEEG/sub-032333.vhdr ~/test
python
>> import mne
>> raw = mne.io.read_raw_brainvision("~/test/sub-032333.vhdr")

What happens then?

@ScarletVV
Copy link
Author

Still same error...

@cgohil8
Copy link
Collaborator

cgohil8 commented May 26, 2024

Can you try again downloading the data from here instead:
https://ftp.gwdg.de/pub/misc/MPI-Leipzig_Mind-Brain-Body-LEMON/

@ScarletVV
Copy link
Author

I try the data from your link then the mismatch error gone, but a new error :

sub-010005 : **********************
sub-010005 : * PROCESSING FAILED! *
sub-010005 : **********************
sub-010005 : set_eeg_reference : functools.partial(<function run_mne_anonymous at 0x7fda3b84f9a0>, method='set_eeg_reference')
sub-010005 : <class 'OSError'>
sub-010005 : could not get source code
sub-010005 : None
Computation complete
OSL osl_logger: handler 'console' level set to 'INFO'
logging to file: /home/uais1/Echo/OSL/DataPrepare/dataset/lemon/test_preproc/logs/osl_batch.log
Processed 0/1 files successfully

/home/uais1/Echo/osl/osl/preprocessing/mne_wrappers.py:67: RuntimeWarning: No bad channels to interpolate. Doing nothing...
getattr(dataset[target], method)(**userargs)
File "/home/uais1/Echo/osl/osl/preprocessing/batch.py", line 791, in run_proc_chain
dataset = append_preproc_info(dataset, config, extra_funcs)
File "/home/uais1/Echo/osl/osl/preprocessing/batch.py", line 367, in append_preproc_info
preproc_info += f"%% extra_funcs start %% \n{inspect.getsource(func)}\n%% extra_funcs end %%"
File "/home/uais1/anaconda3/envs/echo/lib/python3.10/inspect.py", line 1139, in getsource
lines, lnum = getsourcelines(object)
File "/home/uais1/anaconda3/envs/echo/lib/python3.10/inspect.py", line 1121, in getsourcelines
lines, lnum = findsource(object)
File "/home/uais1/anaconda3/envs/echo/lib/python3.10/inspect.py", line 958, in findsource
raise OSError('could not get source code')

@cgohil8
Copy link
Collaborator

cgohil8 commented May 28, 2024

What version of MNE are you using?

@ScarletVV
Copy link
Author

1.7.0 then down to 1.3.1 still same error.

@cgohil8
Copy link
Collaborator

cgohil8 commented Jun 8, 2024

Can you:

  • Re-install OSL from scratch to make sure you have the latest code.
  • Try commenting out the set_eeg_reference line in the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants