Naming conventions of files and folders

Files and folders

Muscle-BIDS file structure explained.

Within the bids standard filenames contain information label such as subject name, data type and sessions followed by a suffix containing extra information. Each label if followed by a value \<label\>-\<value\> connected by a "-". Each label is concatenated by a "\_", for example sub-PAT001_ses-001. After the last “_” any number of suffixes can follow. The data type is the first suffix, for example sub-PAT001_ses-001_dwi.nii.gz.

File Names

Next to the folder structure, the file names of a Muscle-BIDS dataset will tell a lot about what kind of file it is and what it contains. A Muscle-BIDS name contains a list of entities followed by a list of suffixes and is ended with an extension. In Muscle-BIDS filenames "-" and "_" have special meanings and can never be used outside their intended use.

Based on the Muscle-BIDS filename and its location it should be clear what data is contained within the file. Some examples are:

  • “sub-test01_ses-001_megre_b0.nii”
  • “sub-test01_ses-001_rep-flexion_dwi_dti_md.nii”
  • “sub-anonab_ses-002_stk-upper_wt2_t2.nii.gz”
  • “sub-anonab_ses-002_stk-upper_wt2_t2.json”

Study folder

A Muscle-BIDS study is one study folder (dir) that holds the file config.json and the following folders (the default names, which can be changed in the folders section of the config). QMRITools creates the ones it needs.

Folder Contents
01_sourcedata The DICOM files from the scanner, one folder per subject and session (subject or subject_session)
02_rawdata Converted NIfTI files with BIDS names, sorted by subject and session
03_derivatives Processed maps (for example fat fraction and diffusion maps), in the native space of the scan
04_merged Joined and registered data, segmentations and tractography results
05_analysis Excel sheets with the results per subject and one combined file for all subjects

After a run the study folder looks like this (for one subject 001_1 with Dixon data):

<study>/
  config.json
  01_sourcedata/001_1/
  02_rawdata/sub-001/ses-1/
    raw/                    dcm2niix output
    dix/                    sub-001_ses-1_stk-DIXON1_megre_dix_*.nii and .json
  03_derivatives/sub-001/ses-1/dix/    fitted maps and *_check.json files
  04_merged/sub-001/ses-1/
    dix/                    merged maps: sub-001_ses-1_megre_dix_wat.nii
    seg/                    sub-001_ses-1_seg_auto_megre_dix_outph.nii
  05_analysis/
    sub-001/ses-1/          sub-001_ses-1.xlsx
    All_<date>.xlsx         all subjects in one table

More details and a complete step by step example are given in the Muscle-BIDS manual.

Folders

To prevent ambiguity most MRI acquisitions are stored in predefined folders. Muscle-BIDS-compliant software will look in these folders for their needed raw source data. The following folders have been defined in Muscle-BIDS. QMRITools uses the following subfolders to store data in the Muscle-BIDS dataset.

An example of a folder structure is shown below:

└─example/
  ├─sub-cont001/
  │ ├─ses-visit1a/
  │ │ ├─dix/
  │ │ ├─quant/
  │ │ └─raw/
  │ ├─ses-visit1b/
  │ │ ├─dix/
  │ │ ├─dwi/
  │ │ ├─quant/
  │ │ └─raw/
  │ └─ses-visit2/
  │   ├─dwi/
  │   └─raw/
  ├─sub-pat0054/
  │ ├─ses-visit1/
  │ │ ├─dwi/
  │ │ ├─quant/
  │ │ └─raw/
  │ └─ses-visit2/
  │   ├─dix/
  │   ├─dwi/
  │   └─raw/
  └─sub-test002/
    ├─ses-visit1/
    │ ├─quant/
    │ └─raw/
    └─ses-visit2/
      ├─dwi/
      ├─quant/
      └─raw/