bids-standard / bids-specification

Brain Imaging Data Structure (BIDS) Specification
https://bids-specification.readthedocs.io/
Creative Commons Attribution 4.0 International
278 stars 162 forks source link

iEEG specification for BrainVision format #172

Closed JegouA closed 5 years ago

JegouA commented 5 years ago

In the iEEG specification, BrainVision is one format accepted but the chosen extensions are only .eeg, .vhdr, and .vmrk. However, in this format, it is possible to save the data with the extensions .dat, .vhdr, and .vmrk. I asked BrainProduct and they said there is no difference between .eeg and .dat. Is it possible to add .dat as an acceptable extension for BrainVision format? @choldgraf @dorahermes @ftadel

sappelhoff commented 5 years ago

Hi @JegouA, thanks for reporting! Could you please specify under which circumstances you obtain a .dat file?

Furthermore, if there is no difference between .dat and .eeg, perhaps a quick fix for now would be to simply rename the files? See for example these tools:

  1. ~Matlab: https://gist.github.com/CPernet/e037df46e064ca83a49fb4c595d4566a~
  2. ~Python: https://mne-tools.github.io/mne-bids/auto_examples/rename_brainvision_files.html#sphx-glr-auto-examples-rename-brainvision-files-py~
  3. ~You can also ask BrainProducts for their proprietary renaming tool for a GUI approach~

EDIT

I realized that all of these tools only rename the filenames, not the extensions. So one would either have to:

A tool would be easily programmed, as only two things need to be changed for a given BrainVision file triplet to have a .eeg extension instead of a .dat one:

  1. <filename>.dat rename to <filename>.eeg
  2. Within <filename>.vhdr and <filename>.vmrk change the line DataFile=<filename>.dat to DataFile=<filename>.eeg
JegouA commented 5 years ago

While we converted our data to BrainVision format, we converted the data in .dat, .vhdr, .vmrk. BrainVision Analyzer offered to export the data in this format and BrainProduct team said: "The internal format of the data file is not depending on which of the two extensions are used". So, from my point of view, BrainVision format is .vhdr, .vmrk, .eeg and .vhdr, .vmrk, .dat. To be fair, both formats should be accepted because BrainVision is not only one format.

sappelhoff commented 5 years ago

What was the original format of your data? Does BrainVision analyzer give you the choice to export either as .dat or as .eeg?

To be fair, both formats should be accepted because BrainVision is not only one format.

sure that is always an option ... let's look for a parsimonious solution before adding to the specification though! :-)

olivierjmdavid commented 5 years ago

Hi, I agree that we should have the possibility to upload either .eeg or .dat for BrainVision format Best Olivier

JegouA commented 5 years ago

BrainVision gives the choice to export in .eeg and in .dat. We have different original formats.

choldgraf commented 5 years ago

Thanks for bringing this up @JegouA !

I think the question here is: how difficult is it to either 1. Export from the GUI into .eeg instead, or 2. Rename the file name from .dat to .eeg as a quick final step for the BIDS data structure?

I think the reason for trying to nail this down is that we don't want the specification to grow unnecessarily if it doesn't need to. Each individual growth (e.g. support ".dat" and ".eeg" instead of ".eeg") is relatively small, but put together this makes the specification harder to maintain and keep track of (e.g. .dat is a fairly generic file extension, so I could see this generating some confusion for people). I agree with @sappelhoff 's intuition that we should make sure there's really a tangible benefit to allowing either .dat or .eeg

sappelhoff commented 5 years ago

Thanks for chiming in @choldgraf :-)

two more notes from me:

  1. I updated my original answer regarding existing tools, please see: https://github.com/bids-standard/bids-specification/issues/172#issuecomment-470855241
  2. We accepted the BrainVision data format with the CORE specification in mind. That one mentions only .eeg actually :thinking: ... see spec ...then again they do have an example with .dat in the pdf, so we should alert them to this inconsistency
JegouA commented 5 years ago

Hello, I am in contact with BrainProducts, they are working on the format specification. They should come back with more information in the week. Thank you

JegouA commented 5 years ago

Hello, BrainProducts gave me more information about the format specification. The format used by BIDS is named "BrainVision Core file format" and it's .eeg, .vhdr, and .vmrk. (no .dat) They agree that the supported raw file format shall remain binary .eeg. They are correcting the specifications (pdf). I also suggest adding "BrainVision Core file format" in BIDS-iEEG/EEG specifications to avoid future confusion because BrainProducts confirmed there are several versions of BrainVision format.

I will change the extension of my data as well as the data file name in .vhdr. Thank you all for your comments.

sappelhoff commented 5 years ago

I also suggest adding "BrainVision Core file format" in BIDS-iEEG/EEG specifications to avoid future confusion because BrainProducts confirmed there are several versions of BrainVision form

thanks a lot for clarifying @JegouA. I agree that this should be added in the iEEG / EEG specification text explicitly. Would you like to make a Pull request?

JegouA commented 5 years ago

I would like to but I don't know how to do a pull request @sappelhoff

sappelhoff commented 5 years ago

sorry @JegouA ... I just saw your comment now. I would have linked you to this page for a brief description: https://github.com/bids-standard/bids-specification/blob/master/CONTRIBUTING.md#making-a-change-with-a-pull-request

... but you seem to have figured it out on your own.