Skip to content

Fill in the Conversion Configuration File

The Salzburg MEG template creates a file called .meg_conversion_config.yml in your dataset project. This file tells the MEG BIDS conversion pipeline how to map trigger codes to event labels. You must fill it in before your first acquisition.

One config file is enough if you have only one task, or if each trigger code is used in only one of your tasks (for example, trigger code 1 appears only in task myfancytask). Otherwise, create a separate config file named .meg_conversion_<taskname>_config.yml for each task.

Make your changes through a merge request

Do not edit the config file directly on the main branch. Instead:

  1. Create an issue (work item) describing the change, for example Fill in MEG conversion config.
  2. Create a merge request from that issue and make your edits on its branch.
  3. When you are done, assign your Data Steward as Reviewer on the merge request.

The basic GitLab workflow explains issues, merge requests, branches, and reviews step by step.

One config file: edit the file in GitLab

  1. Navigate to your dataset project on the ANC.
  2. Above the file list, open the branch dropdown and select the branch of your merge request.
  3. In the file list, click .meg_conversion_config.yml. You may need to enable Show hidden files to see it, as the filename starts with a dot.
  4. Click the Edit button in the top right of the file view and select Edit single file.
  5. Make your changes in the editor according to the file structure.
  6. When done, scroll down, add a short commit message (e.g. Fill in conversion config), check that the target branch is your merge request branch, and click Commit changes.

One config file per task: edit in the Web IDE

  1. Navigate to your merge request. In the left sidebar, select Code > Merge requests, and then select your merge request.
  2. In the upper-right corner, select Code > Open in Web IDE. The Web IDE opens on your merge request branch.
  3. In the file explorer, rename .meg_conversion_config.yml to .meg_conversion_<taskname>_config.yml, using the task name from your .fif filenames.
  4. For each additional task, copy the file and rename the copy for that task.
  5. Fill in each file according to the file structure.
  6. Commit the changes to your merge request branch.

File structure

The config file uses your project slug as the top-level key. Under it, you define who to notify, how to handle participant IDs, and — most importantly — how to map trigger codes to BIDS event labels.

your-project-slug:
  hashParticipantID: false
  email:
    - you@institution.edu

  events:
    1:
      label: "stimulus_onset"
      type: "stimulus"
    2:
      label: "response_correct"
      type: "response"
    "10-20":
      label: "tone_low"
      type: "stimulus"

Fields

your-project-slug (required)
Replace this with the URL slug of your dataset project (e.g. my-meg-study). This must exactly match the slug set when creating the project.
hashParticipantID (required, boolean)
Whether to hash participant IDs for anonymisation before conversion. Set to true to anonymise, false to keep IDs as entered in the filename.
email (required, list)
One or more email addresses to be notified after a successful conversion. Add one address per line, each preceded by -.
events (required)

Maps trigger codes to BIDS event labels and types. Each entry is either a single code (integer) or a range (quoted string, e.g. "10-20"). All codes in a range receive the same label.

Each event entry requires:

Field Description
label The value written to the trial_type column in events.tsv. Use short, descriptive names without spaces (underscores are fine).
type Either "stimulus" or "response".
How to plan your trigger codes and event labels

Before filling in the config, list all trigger codes your stimulus software will send and decide on a label for each.

Trigger channels and reserved codes

The MEG system sends digital trigger codes via channels STI001–STI008. Codes 0 and 255 are hardware artefacts — always add them to ignore_triggers. Do not assign them to experimental events.

Choosing labels and types

  • Use "stimulus" for any event delivered to the participant (visual, auditory, tactile).
  • Use "response" for button presses, voice onset markers, or any participant-generated event.
  • Labels become the trial_type column in events.tsv — keep them short, descriptive, and without spaces (underscores are fine).

Single codes vs. ranges

  • If a range of codes encodes a continuous variable (e.g. stimulus ID 1–100 for different items), use the range format and give it a single descriptive label.
  • If individual codes within a range carry distinct meanings, list them separately.

Task, session, and run structure

Also decide on task name(s), session labels, and run numbering before acquisition — these go into the .fif filename (see Step 2 — Data acquisition) and must be consistent across all files in your dataset.

Example — fully filled in

This example is from an audiobook vocoding study with six vocoding conditions and three response types:

audiobook-vocoding:
  hashParticipantID: false
  email:
    - researcher@plus.ac.at

  events:
    22:
      label: "response_correct"
      type: "response"
    33:
      label: "response_wrong"
      type: "response"
    44:
      label: "response_no_response"
      type: "response"
    "51-74":
      label: "stimulus_original"
      type: "stimulus"
    "81-104":
      label: "stimulus_7chan"
      type: "stimulus"
    "111-134":
      label: "stimulus_5chan"
      type: "stimulus"
    "141-164":
      label: "stimulus_3chan"
      type: "stimulus"
    "171-194":
      label: "stimulus_2chan"
      type: "stimulus"
    "201-224":
      label: "stimulus_1chan"
      type: "stimulus"