Data Naming and Storing
Data Naming and Storing: MEG
Data host
The MEG data is securely stored on NYU Box; access is given by invitation only. The Data folder is structured in the standardized BIDS format. Please raise an issue on the GitHub repository if you think the structure does not conform to BIDS.
If you are unable to access the datasets, you do not have the required permission: kindly send an email to nyuad.meg@nyu.edu.
Data naming BIDS protocol
Your data should be stored in the BIDS format. A typical MEG dataset from NYUAD contains the files and folders described below, following the BIDS specification.
In the following, [SUB_ID] should be replaced with the ID of the subject.
Note
If you find a bug in the BIDS naming format, please raise an issue on GitHub or create a pull request with your proposed modifications.
Directory structuring
Your file structure should look like this:
a root level directory named after your project (
PROJECT_NAME)within the root directory, you should have:
README.md: general information on your projectdataset_description.json: a JSON object detailing the authors, project name, grants and so onsub-[SUB_ID]: a folder for each subject, within which there should be:optionally, a
ses-[SES_ID]folder, whereSES_IDis a numeric session ID, inside which you will find:meg(mandatory): contains your MEG data and other metadatabeh(optional): behavioural data of the session
if there is no
ses-[SES_ID]folder, the subject does not have multiple sessions; in that casemegis found directly within thesub-[SUB_ID]folder
sourcedata(optional): the files as they were before any conversion or renaming, such as the laser scan project, the logs of the stimulus computer and the eye-tracker files. Following BIDS, this folder sits at the root of the dataset, next to thesub-[SUB_ID]folders, and repeats the subject and session folders inside:sourcedata/sub-[SUB_ID]/[ses-[SES_ID]/]. BIDS does not prescribe the names of the files insourcedata, and recommends following its naming where possible: start each file name with the same entities as the recording it belongs to. AREADMEat the root ofsourcedatashould say what the folder holds.
Note
Datasets acquired before this rule keep a sourcedata folder inside each sub-[SUB_ID] or ses-[SES_ID] folder.
The KIT pipeline does not read sourcedata, so these datasets work as they are; use the root-level folder for new datasets.
Additionally, the root directory can have:
events.json: metadata about the device used for presenting the stimulievents.tsv: information about the types of trials, their onset and durationtask-[PROJECT_NAME]_meg.json: information about the MEG system used, the sampling frequency and so on
If these three files are not found at the root of your dataset, each subject or session might have a specific configuration. In that case, make sure to have these files within the subject or session folder, adding the sub/ses IDs to the name of the file.
The three files can also exist both at the root of your dataset and within each session/subject, when some parameters are specified at the level of the dataset while others are specific to the session/subject.
Note
General BIDS notes:
If a particular file applies to all runs, it should not have the
runentity in its nameIf a particular file applies to all sessions, it should not have the
sesentity in its name
Filename Entities and Ordering
The BIDS standard enforces a strict ordering of components (entities) in filenames. The following table shows the order in which entities must appear if they are present. Entities marked as Mandatory must always be included.
Entity |
Status |
Description |
|---|---|---|
|
Mandatory |
Subject ID. Unique identifier for the subject. |
|
Optional |
Session ID. Required if the subject has multiple sessions. |
|
Mandatory |
Task name (required for functional data). |
|
Optional |
Acquisition parameter (e.g., |
|
Optional |
Run index. Used if multiple runs of the same task are acquired. |
|
Optional |
Modality. |
|
Optional |
Split index. Specific to .con split files. |
|
Optional |
Processing label (e.g., |
|
Optional |
Coordinate space (e.g., |
Suffix |
Mandatory |
The modality or file type suffix (e.g., |
Extension |
Mandatory |
The file extension (e.g., |
Warning
The order of these entities is fixed. For example, sub-001_task-rest_ses-01_meg.con is INVALID because ses must come before task.
The correct name is sub-001_ses-01_task-rest_meg.con.
MEG-Laserscan files
A
.fsnfile, namedsub-[SUB_ID]_acq-laserproject_headshape.fsn: this file is obtained by saving the whole FastScan laser project (File > Save). The.fsnfile is stored undersourcedata/sub-[SUB_ID]/(sourcedata/sub-[SUB_ID]/ses-[SES_ID]/when there are sessions), at the root of the dataset.Two
.txtfiles holding the head surface scan and the stylus points, both stored undermeg:sub-001_ses-01_acq-head_headshape.txtis the head scan of the participantsub-001_ses-01_acq-points_headshape.txtis the stylus points location file of the participant
MEG-KIT files
Depending on the experiment, many .con files can be produced by the KIT machine.
.confiles are named:sub-[SUB_ID]_ses-[SES_ID]_task-[TASK_NAME]_run-[RUN_ID]_split-[SPLIT_INDEX]_meg.conexample:
sub-001_ses-01_task-audiovisualmotor_run-03_meg.conif you applied the
CALMfiltering or another kind of pre-processing to your.confile:sub-[SUB_ID]_task-[TASK_NAME]_proc-CALMnoisereduction_meg.con, or replace theprocvalue with the name of your filterexample:
sub-001_task-attention_proc-CALMnoisereduction_meg.con
the
splitentity is used when, in a single session, the scan results in multiple acquisition files; use it to indicate the order of the filesall
.confiles should be stored undermeg
.mrkfiles are named:sub-[SUB_ID]_ses-[SES_ID]_task-rest_acq-[MARKER_ORDER_NUMBER]_space-ALS_markers.mrk, where:[MARKER_ORDER_NUMBER]is the chronological order in which the marker was acquired in that sessionthe
taskshould be set torestbecause no stimulus events are involved (otherwise the BIDS Validator issues a warning)the
spacerefers to the coordinate system: for Yokogawa/KIT it is Anterior on the X-axis, Left on the Y-axis and Superior on the Z-axis, therefore ALS
all
.mrkfiles should be stored undermeg
Declaring which recordings a marker measurement belongs to (
scans.tsv):By default the pipeline chains the markers chronologically: with n
.confiles (ordered byrunandsplit) and n+1.mrkfiles, recording i uses markers i (before) and i+1 (after). This needs one marker measurement between every two consecutive recordings.When a measurement bounds several recordings (markers taken, two tasks recorded back to back, markers taken again), declare the pairs in the BIDS acquisition table
sub-[SUB_ID]_ses-[SES_ID]_scans.tsvstored in the session folder, with two additional columns:filename acq_time marker_before marker_after meg/sub-001_ses-01_task-A_run-1_meg.con 2026-10-19T09:12:00 meg/sub-001_ses-01_task-rest_acq-1_space-ALS_markers.mrk meg/sub-001_ses-01_task-rest_acq-2_space-ALS_markers.mrk meg/sub-001_ses-01_task-B_run-2_meg.con 2026-10-19T09:40:00 meg/sub-001_ses-01_task-rest_acq-1_space-ALS_markers.mrk meg/sub-001_ses-01_task-rest_acq-2_space-ALS_markers.mrk meg/sub-001_ses-01_task-C_run-3_meg.con 2026-10-19T10:05:00 meg/sub-001_ses-01_task-rest_acq-2_space-ALS_markers.mrk meg/sub-001_ses-01_task-rest_acq-3_space-ALS_markers.mrk
filenameandacq_timeare the standard BIDS columns (one row per.confile, includingproc-variants, paths relative to the session folder);marker_beforeandmarker_afterare additional columns, described in ascans.jsonnext to the table so that the BIDS validator accepts them. Usen/awhen no measurement exists on that side.When the table is present every recording of the session must be listed; the KIT-to-FIF stage refuses a recording that is missing from it or that lists a file that does not exist.
2-kit_con_to_fif.py --write-scans-draftwrites a draft table and itsscans.jsonunderderivatives/from the chain rule and the recording times; correct it, then copy both files into the session folder.The
task-restlabel of the markers is kept because a measurement between two tasks belongs to both; BIDS itself (one or two marker files per raw file,acq-pre/acq-post) has no way to share a measurement without duplicating the file.
Note
The
sesentity is optional, but must be present if the same subject had multiple sessionsThe
runentity is optional, but must be present if, in the same session, a subject had multiple MEG acquisitions leading to multiple.confiles
MEG-OPM files
The OPM (FieldLine) system writes .fif files with its own native names (for example
20240415_113034_sub-NA_file-emptyRoom-raw.fif). These must be renamed to a BIDS-valid
form before storage: drop the -raw suffix and add a task label.
The .fif files are named:
sub-[SUB_ID]_ses-[SES_ID]_task-[TASK_NAME]_meg.fifexample:
sub-001_ses-01_task-restingstate_meg.fifall
.fiffiles and theirchannels.tsvandmeg.jsonsidecars are stored undermeg
Empty-room (noise) recordings
Empty-room recordings (noise recordings) are acquired with no participant in the magnetically shielded room, to characterize system noise and to estimate noise covariance. BIDS has a dedicated convention for them, which NYUAD follows.
Store every empty-room recording under a single reserved subject sub-emptyroom,
with a session label equal to the recording date (ses-YYYYMMDD) and the task
noise:
sub-emptyroom/
ses-<YYYYMMDD>/
sub-emptyroom_ses-<YYYYMMDD>_scans.tsv
meg/
sub-emptyroom_ses-<YYYYMMDD>_task-noise_acq-<kit|opm>_run-<NN>_meg.<con|fif>
sub-emptyroom_ses-<YYYYMMDD>_task-noise_acq-<kit|opm>_run-<NN>_channels.tsv
sub-emptyroom_ses-<YYYYMMDD>_task-noise_acq-<kit|opm>_run-<NN>_meg.json
Conventions:
sub-emptyroom(used literally) is the only subject for noise data. Do not assign a numeric subject ID.ses-<YYYYMMDD>is the date the empty room was recorded, for exampleses-20240628.task-noiseis always the task for empty-room data.acq-kitmarks the KIT/Yokogawa SQUID system andacq-opmmarks the FieldLine OPM system. This is how both systems coexist in one dataset, because BIDS has no dedicated system entity.run-<NN>numbers multiple recordings taken on the same day with the same system (run-01,run-02, and so on).proc-CALMnoisereductionis appended when an on-system noise-reduced copy of a run is stored next to the raw run.Conditions that must not go in the file name (for example “helium heater on”, “OPM present or removed”, or the original file name) are recorded in the
commentsandoriginal_filenamecolumns of the sessionscans.tsv, documented by asub-emptyroom_scans.jsondata dictionary.
Examples:
sub-emptyroom_ses-20240628_task-noise_acq-kit_run-03_meg.con
sub-emptyroom_ses-20240415_task-noise_acq-opm_run-01_meg.fif
sub-emptyroom_ses-20241023_task-noise_acq-kit_run-01_proc-CALMnoisereduction_meg.con
Note
Empty-room recordings contain no participant data, so no demographic fields are
required beyond the reserved sub-emptyroom entry in participants.tsv.
Note
For the KIT system the channels.tsv typing depends on the recording date: from
2018 onward the sensor mapped to MEG 092 is recorded as a reference magnetometer
(a known hardware fault), giving 207 MEGMAG plus 17 MEGREFMAG; recordings before
2018 have 208 MEGMAG plus 16 MEGREFMAG.
Note
This layout is the one produced for the NYUAD empty-room dataset on NYU Box. See the BIDS empty-room specification at https://bids-specification.readthedocs.io/en/stable/modality-specific-files/magnetoencephalography.html.
Data uploading
Steps:
Access the MEG data folder on NYU Box
Identify the project that the data belongs to, or request a new project folder
Open the folder of that project, or create it if it does not exist
Follow the BIDS structure described above within each project folder
Make sure that all the files have been uploaded to the folder
Data Naming and Storing: MRI
MRI data is hosted on XNAT.
Link to MRI data (access is given on request, subject to eligibility)
https://xnat.abudhabi.nyu.edu/#/login
Contact the XNAT administrator at admin.nyuad.xnat@nyu.edu.