How to save montage (ieeg, eeg, meg) in BIDS format?

Hello,

I am creating a BIDS dataset for ieeg, eeg, and meg data.
I am looking for a way ta save the montage file by subject. I didn’t find the answer on bids_specification.
Can I put the montage file in sub/ses/mod folder? Should it have a specific name?

Thank you.
Best regards,
Aude

perhaps - @sappelhoff

Hi @ajego,

I need some additional information to help you properly. Are the montage files per subject the empirical (measured) coordinates of the electrodes? If not, what exactly do you mean by montage file?

Have you taken a look at the electrodes.tsv files?

Worst case, you can of course include your custom files in the sub/ses folder. But that’ts not valid BIDS, and you would have to make use of the .bidsignore](https://github.com/bids-standard/bids-validator/#bidsignore) file to have your dataset pass the bids-validator

With more information I can be of more help :slight_smile:

Hello,

Thank you @franklin and @sappelhoff for your answers.
I will try to give you more information :slight_smile:.

I would like to save a montage file created by one of our software named AnyWave which allows to visualize the signal. You can choose channels to display and then save it in a file (montage file). This file can be re-used to display the channels of interest and run analysis on those channels.
BrainVision Analyzer also has this type of file.

I looked at electrodes.tsv but it is not what I need.
Do you think this file could be added in valid BIDS format? If not, I will use .bidsignore ^^.

Thank you

Yes in this case I would advise for using .bidsignore, although my general recommendation is to use .bidsignore most sparingly.

The only option to navigate around unsing .bidsignore would be to encode your montage data in custom columns within your channels.tsv or electrodes.tsv files (as appropriate) … and then supply a short script in your /code directory that can reconstruct the montage file from the montage data encoded in the bids files.

If this type of workflow (saving custom montages, and then adding to .bidsignore) is very common, … then it might be worth writing a tool implementing my second suggestion.

Good luck!

Thank you for your help.

I will study your option. :slight_smile:

Let me add something here, also for people that might find this thread in the future. “Montage” in EEG/iEEG is a bit of an ambiguous term (and hence not part of the BIDS specification). it can relate to the position of electrodes and/or the referencing and/or the display.

The placement of the electrodes should (as Stefan points out) be in the _electrodes.tsv.
The referencing scheme that was used in the recording and hence reflected in the values in the channels in the data file is to be specified in the (i)EEGReference field in the _(i)eeg.json and in detail for different channels in the reference column in the _channels.tsv file.

The way data is to be (or can be displayed), like in AnyWave with grouping and/or scaling channels, is not part of the specification. If you want to share that information (which I think is valuable, but possibly not so widely useable since not standard), you can give the file a name that makes most sense to you (hopefully BIDS-like) and add it to the .bidsignore.