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

Passing a custom montage to the PrepPipeline(raw, montage=?)? #111

Closed
neerajww opened this issue Feb 3, 2022 · 5 comments
Closed

Passing a custom montage to the PrepPipeline(raw, montage=?)? #111

neerajww opened this issue Feb 3, 2022 · 5 comments

Comments

@neerajww
Copy link

neerajww commented Feb 3, 2022

Hi,

I am working with an (open-access )EEG dataset which has 255 channels (https://zenodo.org/record/4518754#.YfukTfXTXLC). It is curry file format, and I can load the dataset in mne with its montage information.

 raw = mne.io.read_raw_curry( <filename> + '.dat')

I am confused on how to pass the "montage" information to the pyrep pipeline. I will appreciate any help with this. Excuse me if this is a naive question.

@neerajww
Copy link
Author

neerajww commented Feb 3, 2022

As a follow up, i tried with montage=None expecting the PrepPipeline will extract information from the raw object.

PrepPipeline(raw, prep_params, montage=None)

But then I get the following (different) error.
image

@sappelhoff
Copy link
Owner

regarding your first question, see this example: https://pyprep.readthedocs.io/en/latest/auto_examples/run_full_prep.html?highlight=montage#load-data-and-prepare-it

regarding your second problem, that is a bit unexpected. Could you try saving your raw using raw.save, and then loading it again using mne.io.read_raw_fif? If the error disappears then, it might be a problem in MNE-Python with the curry data format

@neerajww
Copy link
Author

neerajww commented Feb 3, 2022

Thank you for the reply. I tried raw.save() saving the file as .fif but the error persists.
image

@sappelhoff
Copy link
Owner

You have to save as fif AND THEN reload the data from that saved fif datafile. Only saving is not enough :-) ... but the error log looks like you did exactly that. Weird how you still get an issue.

Can you do:

print(raw.get_data().shape)

and report what you get here?

Also can you run

import mne
mne.sys_info() 

and report the outputs here?

Which version of pyprep are you using, and how did you install it?

@neerajww
Copy link
Author

neerajww commented Feb 3, 2022

Yes, you guessed right- I saved + reloaded - the data.
Below is the version information.
image

Using the preload=True solved it. Thank you!
image

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