-
Notifications
You must be signed in to change notification settings - Fork 92
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
write_raw_bids() accepts (and silently ignores / alters) unsuitable extension #1041
Comments
agreed, this looks like a bug to me. I think it should "autoconvert" to FIF ... or raise an exception demanding |
what behavior would you expect? I would say it should just write to .fif
and not warn.
… Message ID: ***@***.***>
|
I maybe didn't explain it well. The input I have is FIFF. The data type is eeg. BIDS mandates that EEG data be stored in BrainVision format; FIFF is not allowed. MNE-BIDS silently converts my data from FIFF to BV, even though the target BIDSPath I supply explicitly states an extension of .fif So in my perception, MNE-BIDS simply overrules what I explicitly asked it to do (write the data to FIFF), in order to conform to BIDS. Instead, it should raise an exception, stating that EEG data cannot be written to FIFF as it violates the standard. |
let me give you the following use case. I have combined MEG/EEG data and I
just want to analyse the EEG data.
Take ds117 for example. Original data is in FIF and I don't see why
derivatives eg filtered raw data after picking the EEG
channels shouldn't stay in FIF. Does it make sense?
… Message ID: ***@***.***>
|
Yes I totally agree, and I would say we should amend the BIDS standard to allow for FIFF for EEG data as well. But it's currently not the case. As for derivatives, that further complicates things, yes!! But currently it is how it is: BIDS doesn't allow FIFF for EEG, at least not for raw data. Unless I'm missing something in the spec -- @sappelhoff? |
agreed. And I think this is in line with the spec --> EEG data that was recorded together with MEG data can be stored under an If you want to completely rip out the EEG data from the MEG format and only deal with EEG, then I think it's fair to require that you use BIDS conventions for EEG and convert your data and then continue. |
I would say we keep the file as MEG datatype and store things in FIF for
now.
But I see the problem we are facing with the pipeline that stores all
derivatives in FIF...
… Message ID: ***@***.***>
|
… the BIDSPath Some extensions / formats are only allowed for certain data types, e.g. .vhdr is (i)EEG-only. When passing a BIDSPath containing both datatype and extension to write_raw_bids(), in case of a mismatch we would previously simply silently replace the incorrect extension, effectively writing to a location (and file format) the user didn't expect. We now raise an exception in such situations. Fixes mne-tools#1041
I've been trying to address this in #1053 but I ran into an issue: It appears the My proposal would be to get rid of the |
can we make format auto default to use the extension in bidspath and if not
provided default to some default of datatype?
… Message ID: ***@***.***>
|
Maybe that would be a good idea. Currently it infers the format based in the data, for example if there are MEG channels it will pick meg |
When trying to write EEG data to a FIFF file,
write_raw_bids()
happily accepts a respectiveBIDSPath
, but actually writes the data to a BV file.It should at least warn, or even better, raise an exception.
MWE:
produces:
The text was updated successfully, but these errors were encountered: