Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a BIDS path using mne_bids

  2. Get all the info needed to create the events file

    1. if we create fixed length events: we need to extract the event id

    2. if we extract existing events we use mne.read_events()

  3. Convert the MEG file into a BIDS structure using mne_bids.write_raw_bids() and specify events_data and events_id

  4. Extract the events.tsv from the BIDS path

  5. Save it in the output directory

...

Note

This code works well on fixed length events but was not tested on data with existing events!!!!

Delete the BIDS folder created

To get BIDS compliant events.tsv and channels.tsv, we created a BIDS folder. When the Apps creating these files run on Brainlife, the BIDS folder, which is useless, is in the outputs files. Besides, its presence may be confusing for the App users:

...

So in main , we add the line:

Code Block
rm -r bids

after running the app.