Open sappelhoff opened 5 years ago
No, the EDF header (which is also used in EDF+ and BDF) does not have room for it.
For BrainVision I know there can be a coordinates section, but I recall that is not a proper ini-section, but rather a comment block just like for impedances. ... No I am wrong here, the brain vision core PDF has Coordinates as a normal ini-like section (with radius, theta, phi).
In the EEGLAB .set format electrode positions can be present.
Also something to consider: in most EEG lab setups the electrode digitization is not integrated with the recording of the EEG time courses. Different softwares, sometimes different computers, hence the two types of data are usually not merged around acquisition time, but only at time of analysis. For the EEGLAB format (which of course is analysis software, not acquisition software) the .set file typically gets written after merging the two.
Thanks for the info on EDF, EDF+, and BDF!
In the EEGLAB .set format electrode positions can be present.
I will need to check out a .set
file to see whether they supply all other necessary information to interprete the electrode positions (coord system, units) ... or whether they do some internal conversion to a common coordsystem+units (like MNE-Python converts all digitization to Elekta/Neuromag space)
edit: it appears that neither coord system nor units are supplied: https://sccn.ucsd.edu/wiki/A05:_Data_Structures#EEG.chanlocs
No I am wrong here, the brain vision core PDF has Coordinates as a normal ini-like section (with radius, theta, phi).
that is correct, however traditionally (i.e., BEFORE the BrainVision Core Data Spec) this section was only used for the interaction between BrainVision Recorder and BrainVision Analyzer. --> this was never really intended as a way to input digitization data into the raw data file ... however, I do see that now this could become the case.
Unfortunately, the part in the "Coordinates" section in the BV Core Spec says nothing about the Coordinate system and the units used. -> this would be needed to make the coordinates section truly useful beyond the traditional interfacing between BV Recorder and BV Analyzer.
From my email exchanges I know that BrainVision Analyzer interprets the "Coordinate Section" in the same ways as a BVEF file (=BrainVision Electrode File) would be interpreted ... which is according to the following coordinate system, specified in "milimeters" (see image):
BrainVision also provides the "CapTrak" digitization device, which can save in the BVCT format ... I have made an entry into the Fieldtrip Wiki for that a while ago ... also, I just realized that this typo should be corrected: CapTrack --> CapTrak
However, entering the CapTrak BVCT file into the BrainVision raw data seems like a hack, and would very likely produce issues.
TL;DL: Yes, BrainVision Core Data Format permits a "coordinates" section ... but I think it's underspecified and many software packages will likely misinterpret this section if it is written by anything other than BrainVision Recorder or BrainVision Analyzer.
PS @robertoostenveld if you are interested in the correspondence surrounding BVEF, BVCT and the "Coordinates" section in BrainVision files, I can forward the emails to you.
just a question: why would you try to squeeze electrode position information in the EEG file, while it can already be stored in the electrodes.tsv
(and with the coordsystem.json
to explain)?
PS thanks for CCing me on the emails
just a question: why would you try to squeeze electrode position information in the EEG file, while it can already be stored in the electrodes.tsv (and with the coordsystem.json to explain)?
This whole cascade of questions and problems originated from a simple problem:
electrode.tsv
and coordsystem.json
files given some raw data in non-bids format (loaded as MNE-Python raw
object)--> The issues are:
electrodes.tsv
and coordsystem.json
will not correspond to the state of the data in the actual RAW fileI think this describes the situation exhausitvely, and it might explain to you why:
interesting, and non-trivial.
Let me reply how we do it - more or less - in FieldTrip (but not always 100% perfect)
ft_read_sens(filename)
, although you would still have to know which filename has the electrode measured positions. However, that never seems to be the problem. ft_electroderealign
, which adds the coordsys
field to the elec structure. The elec structure can then be added to the data.The lack of position information being measured needs to be properly represented in the BIDS structure. The recipient of the data can always use the template positions provided in the software that he/she uses; the data does not need to contain fake positions (and if so, it should beindicated that the electrode positions have been imputed). You would also not add a template/fake anatomical MRI to an EEG dataset, or template/fake triggers if you don't know what task the subject was doing. BIDS raw is in my opinion about what we measured (factual), not about what we would have liked to measure (desired).
The challenge converting data with FIeldTrip data2bids is similar. I have some examples, two are EEG specific, but neither have electrode positions. It would actually interesting to also make an example that does include positions, also to test the completeness of the implementation. That would use this option. Do you know of a proper raw EEG dataset plus electrodes that is already shared? We do not have one in the tutorials.
Thanks!
I completely agree with you that template positions should not be included in BIDS and have argued this way before.
If you want to read about opposing arguments, you can check out this thread (no need to check the code, the arguments are all in the comments): https://github.com/mne-tools/mne-bids/pull/244#discussion_r313958721
Do you know of a proper raw EEG dataset plus electrodes that is already shared? We do not have one in the tutorials.
Unfortunately I don't. I am currently collecting data, but it might well take another 6 months until I can share it.
Thanks for pointing out the MNE-python discussion.
I could use eeg-audodd for that. It is actually a Neuromag recording, but we reformatted it into BrainVision for an EEG-only workshop. I could also reformat the electrodes (now in a mat file) so that those are formatted (e.g. as BESA .sfp) as if they are recorded with more common digitizer software.
In case you are interested for testing purposes, you can download eeg-audodd.zip. It includes real electrodes in BESA .sfp format and real DICOM files. I think this is as close as it gets to a complete measured dataset in the original raw format prior to BIDS.
Thanks, that looks like it would make a good candidate for an EEG BIDS dataset with actual coords.
Just out of curiosity: Which digitizing apparatus was used to save in BESA .sfp format?
All data was originally recorded with the Neuromag Triux MEG system (which also controls the Polhemus) and stored in a .fif file. I then used FieldTrip to selectively get the EEG time courses and electrode positions and wrote those to file formats corresponding to raw data.
The .sfp was written with ft_write_sens.m in the latest master version, it is not yet in the release. I just implemented it yesterday for this purpose ;-)
@robertoostenveld do you happen to know whether it is possible to encode digitized electrode positions in the EDF, EDF+, and BDF data formats?
For the BrainVision format, I know that there is an optional
"Coordinates"
section, which is used for transferring information about a "montage" (should not be used for actual, measured 3D digitized sensor positions)For the EEGLAB format, it seems to be possible to encode locations as well, but I need to further look into this.