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

Error when trying to overwrite BIDS-data using mne_bids.write_raw_bids() and Nihon Kohden EEGs #3

Open
hotblack91 opened this issue Oct 7, 2021 · 0 comments

Comments

@hotblack91
Copy link

Hello,

I am working with EEG measurements in the Nihon Kohden format. For this reason I've decided to follow the workshop and modify the Jupyter notebooks in order to use my own data. So for example in the first notebook I use the function mne.io.read_raw_nihon(raw_path, preload=True) instead of mne.io.read_raw(raw_path) and so on.

Problem

When working with BIDS-data in the second notebook I encounter the following problem. I can write raw BIDS-data using the function mne_bids.write_raw_bids() but I additionally need to set format='Brainvision' and allow_preload=True (see code below).

out_path = pathlib.Path('out_data/sample_BIDS')

bids_path = mne_bids.BIDSPath(subject='01',
                              session='01',
                              task='eeg',
                              run='01',
                              root=out_path)


mne_bids.write_raw_bids(raw,
                        bids_path=bids_path,
                        events_data=events,
                        event_id=event_id,                        
                        format='BrainVision',
                        allow_preload=True,
                        overwrite=True)

Everything works fine the first time I run the code. However, if I try to modify the raw.info['subject_info'] adding in the birthday of the patient or some other information in a cell above (like it was done in the youtube tutorial) and then try to run again the mne_bids_write_raw_bids() I get the following error message:

OSError: File already exists: out_data/sample_BIDS/sub-01/ses-01/eeg/sub-01_ses-01_task-eeg_run-01_eeg.eeg.
Consider setting overwrite=True.

As you can see in the code above the argument overwrite was set to True. Is this a bug of the function or am I doing something wrong?

Thank you in advance!

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

1 participant