[Eeglablist] How can I convert .xdf files to .bdf files while maintaining consistent event markers?

Pieterjan Vande Casteele Pieterjan.VandeCasteele at UGent.be
Tue Feb 17 10:13:52 PST 2026


I am currently struggling with converting EEG data from XDF (LabStreamingLayer) to BDF format while maintaining consistent event markers.

The Problem: When I convert the files, my string-based markers (e.g., 'cross', 'stim', 'left_good', 'feedback') are being automatically assigned arbitrary integers. These integers change with every new recording (e.g., 'cross' might be 31670 in File A and 15521 in File B).

This makes batch processing impossible, as the analysis scripts expect fixed trigger values (like 101, 105, 20, etc.).

I need a reliable way to hardcode a specific mapping (e.g., {'cross': 101, 'left_good': 20}) so that any software (BioSig, EEGLAB, etc.) reads the exact same integer every time.

Does anyone have a script or workflow to force these string labels into fixed BDF trigger values without corrupting the file header or causing scaling/offset issues?

Thanks in advance for your help!




More information about the eeglablist mailing list