Closed dipterix closed 4 years ago
Thank you for catching this! The two files should actually be consistent in naming. There was a 1-to-1 mapping in these data, so I corrected it accordingly with pull request #193
I saw your PR, thanks for the information. I have another question unrelated to this issue:
In sub-<label>_[ses-..]_task-xx[_run-..]_ieeg.json
, I didn't see any entry indicating where the data file is in BIDS specification document. Is it always save to assume changing extension guarantees the data files?
For example in ieeg_visual
, there is sub-01_ses-01_task-visual_run-01_ieeg.json
. Assuming we are using BrainVision format, if I change .json
to .vhdr
, can I guarantee the header file?
A follow-up issue is in .vhdr
file, the meta information actually indicates data file name, i.e. .eeg/.dat
files. The file name might not look like sub-xxx_ses-xxx_task-xxx...._ieeg.eeg
. Should I stick to BIDS convention, or should/can I use data file indicated by header file, or both? And if both, how can I get that information?
Is it always save to assume changing extension guarantees the data files? if I change .json to .vhdr, can I guarantee the header file?
not sure if it's guaranteed to work ... seems not very robust to do it this way. Have you looked at
? :-)
A follow-up issue is in .vhdr file, the meta information actually indicates data file name, i.e. .eeg/.dat files.
that's correct ... the BrainVision file format consists out of three files ... and the VHDR and VMRK files both contain internal links to the other files (including the EEG file).
You will need to fix the internal links when renaming the data files to fit the BIDS convention.
You could do that manually ... but it's better to write a script for it. Or even better, to re-use software that's already out there to take care of this.
See for example this tutorial: https://mne.tools/mne-bids/stable/auto_examples/rename_brainvision_files.html#sphx-glr-auto-examples-rename-brainvision-files-py
I'm writing R
functions to read BIDS-iEEG data into R language. The specification document has the following structure:
sub-<label>/
[ses-<label>]/
ieeg/
sub-<label>[_ses-<label>]_task-<label>[_run-<index>]_ieeg.<manufacturer_specific_extension>
sub-<label>[_ses-<label>]_task-<label>[_run-<index>]_ieeg.json
That's why I was asking whether it's safe to assume data files and json descriptors share the same file name.
Also I tried BIDS validator. It passes the test even when electrodes.tsv files are missing. Is there any place where I can find mandatory files?
That's why I was asking whether it's safe to assume data files and json descriptors share the same file name.
no, it's not safe. It'll work for most cases, but not for all. See for example the inheritance principle. a JSON can be defined at a completely different directory level but still "belong" to the data in a given directory level. So here, it's impossible to simply replace extensions and get the same file.
Is there any place where I can find mandatory files?
That's in the BIDS specification in the respective section for each file.
Also I tried BIDS validator. It passes the test even when electrodes.tsv files are missing.
If you find that the BIDS validator behaves strangely or "wrongly" on a certain topic, feel free to open an issue on bids-standard/bids-validator --> the validator is NOT perfect, and we are happy to receive bug reports when they are well documented :-)
Then given a data file, I have to not only look for json files that belongs it its specification, but also to look up higher structure for all possible meta files? For file like sub-som682_ses-somecog01_task-spatialobject_run-01_ieeg.vhdr
, I need to look at meta files in folders
proj/sub-som682/ses-somecog01/ieeg
proj/sub-som682/ses-somecog01
proj/sub-som682/
proj/
Also do you have plans to develop packages to support BIDS structure in R?
Then given a data file, I have to not only look for json files that belongs it its specification, but also to look up higher structure for all possible meta files?
in theory yes
Also do you have plans to develop packages to support BIDS structure in R?
I haven't heard of any such plans, and I am relatively unaware of neuroimaging or electrophysiology analysis in R. But if you are interested in finding collaborators, I'd suggest you:
In example
ieeg_visual/sub-01/ses-01/ieeg/
Channel names in
channels.tsv
areiEEGxxx
while names inelectrodes.tsv
arexxx
. Should two files be consistent? If not where can I find information to match these two files?For example, I select electrodes based on electrodes.tsv, but then I want to get information from channels.tsv. One easiest way is to have a one-to-one or one-to-many mapping so that I can join these two tables.