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

Write EEG/iEEG reference to JSON sidecar #713

Open
hoechenberger opened this issue Feb 25, 2021 · 5 comments
Open

Write EEG/iEEG reference to JSON sidecar #713

hoechenberger opened this issue Feb 25, 2021 · 5 comments

Comments

@hoechenberger
Copy link
Member

See #695 (comment)

@sappelhoff
Copy link
Member

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?

@hoechenberger
Copy link
Member Author

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…)

@hoechenberger
Copy link
Member Author

I'll make a PR and we can then discuss & iterate from there

@hoechenberger
Copy link
Member Author

hoechenberger commented Feb 25, 2021

Oh well it wouldn't be fun if it were easy, right?

@hoechenberger
Copy link
Member Author

hoechenberger commented Sep 14, 2023

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()?

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

No branches or pull requests

2 participants