mne-bids
mne-bids copied to clipboard
Write EEG/iEEG reference to JSON sidecar
See https://github.com/mne-tools/mne-bids/pull/695#issuecomment-786165997
amend our documentation, suggesting users do the following before calling write_raw_bids:
- if the reference channels are present in the data, call raw.set_eeg_reference() to make the reference explicitly known
- if the reference channels are not present in the data:
- add them via raw.add_reference_channels()
- call raw.set_eeg_reference() to make the reference explicit The cool thing would be that if the reference electrode is part of the montage, we'd get the reference electrode location for free :) Then call write_raw_bids(), which should extract the reference channel info from raw.info['chs'] -> this will need a PR Easiest is to start with the assertion that all channels have the same reference, so we can write it to [i]EEGReference in the sidecar JSON.
and if users don't do it we keep writing n/a
?
and if users don't do it we keep writing
n/a
?
Yeah… I mean, if you will, this follows the principle we're applying to events already: if they are not specified, we don't write any (well… we do warn, though…)
I'll make a PR and we can then discuss & iterate from there
Oh well it wouldn't be fun if it were easy, right?
- https://github.com/mne-tools/mne-python/issues/8962
We still don't have a solution for this, do we? :( I want to store some BV data in BIDS format. The data doesn't contain the reference channel. Now I'm not sure which approach to take to make BIDS aware of this reference.
Shall I just add it via raw.add_reference_channels()
and leave it as all-zeros before calling write_raw_bids()
?