JSON

JavaScript Object Notation (JSON) is simply a convention for the formatting of a text file.

In BIDS, JSON files serve to hold metadata about other files. Their benefit is that they are machine readable, so that they can easily be read for analysis. They are perhaps most often encountered in two contexts.

  • The first is in a pair with a brain image. Here the JSON file describes the image acquisition, MR parameters and the like and contains much of the information traditionally found in a DICOM or .nii header.

  • The second is paired with a participants.tsv file. The participants.tsv holds information about the individual who contributed the associated MRI data. Because the participants file is sparse and simply includes titles at the top of each column (e.g., 'age', 'gender') the JSON file describes what each column represents. For instance, it might note that age is specified in years; gender is treated as binary for this project; etc.

Users do not have to worry about creating JSON files for brain images. These can be created automatically using software such as dcm2niix (a full list of converters is on the BIDS front page. ).

When creating the JSON file to accompany a participants.tsv file, details can be found within the BIDS specification. We also include an example below.

Full details of the JSON specification are at the website http://www.json.org/

Example contents of a participants.json file (Benjamin Lab)

"participant_id": {
    "LongName": "BIDS Identification number",
    "Description": "This is the BIDS ID set by those storing the data. This may differ from the MRI ID given by those acquiring the data.",
    "Units": "ID number",
    "TermURL": "http://bids.neuroimaging.io"
};
"mri_id": {
    "LongName": "MRI scanner patient ID",
    "Description": "This is the ID used by those acquiring the data.  It may differ from the BIDS ID.",
    "Units": "ID number",
};
"age": {
    "LongName": "Participant age in years",
    "Description": "Age in years, truncated. For example, 19 years 11 months 29 days is documented as 19 years)",
    "Units": "Years"
};
"sex": {
    "LongName": "Biological sex",
    "Description": "Biological sex of participant",
    "Levels": {
        "1": "Male",
        "2": "Female"
    }
};
"past_neurosurgery": {
    "LongName": "Previous neurosurgery",
    "Description": "The participant has had neurosurgery PRIOR to the current scan.",
    "Levels": {
        "1": "yes",
        "2": "no"
    }
};
"handedness": {
    "LongName": "Patient's self-reported handedness",
    "Description": "Handedness as stated by patient on scan day",
    "Levels": {
        "1": "Right",
        "2": "Left",
        "3": "Ambidextrous"
    }
};
"hand_pref_writing_R1_to_L5": {
    "LongName": "Hand preference - WRITING",
    "Description": "Hand preference item 1 from Veale (2014) four-item short form of the Oldfield Handedness Inventory ",
    "Levels": {
        "1": "Always right (100)",
        "2": "Usually right (50)",
        "3": "Both equally (0)",
        "4": "Usually left (-50)",
        "5": "Always left (-100)"
    },
    "TermURL": "https://doi.org/10.1080/1357650X.2013.783045"
};
"hand_pref_throwing_R1_to_L5": {
    "LongName": "Hand preference - THROWING",
    "Description": "Hand preference item 2 from Veale (2014) four-item short form of the Oldfield Handedness Inventory ",
    "Levels": {
        "1": "Always right (100)",
        "2": "Usually right (50)",
        "3": "Both equally (0)",
        "4": "Usually left (-50)",
        "5": "Always left (-100)"
    },
    "TermURL": "https://doi.org/10.1080/1357650X.2013.783045"
};
"hand_pref_toothbrush_R1_to_L5": {
    "LongName": "Hand preference - TOOTHBRUSH",
    "Description": "Hand preference item 3 from Veale (2014) four-item short form of the Oldfield Handedness Inventory ",
    "Levels": {
        "1": "Always right (100)",
        "2": "Usually right (50)",
        "3": "Both equally (0)",
        "4": "Usually left (-50)",
        "5": "Always left (-100)"
    },
    "TermURL": "https://doi.org/10.1080/1357650X.2013.783045"
};
"hand_pref_spoon_R1_to_L5": {
    "LongName": "Hand preference - SPOON",
    "Description": "Hand preference item 4 from Veale (2014) four-item short form of the Oldfield Handedness Inventory ",
    "Levels": {
        "1": "Always right (100)",
        "2": "Usually right (50)",
        "3": "Both equally (0)",
        "4": "Usually left (-50)",
        "5": "Always left (-100)"
    },
    "TermURL": "https://doi.org/10.1080/1357650X.2013.783045"
};
"oldfield_sf_lq": {
    "LongName": "Oldfield short form (Veale 2014) laterality quotient",
    "Description": "Hand preference from Veale's (2014) four-item short form of the Oldfield Handedness Inventory. This is calculated by taking the average of the 4 items, so that 100 is strong right preference; -100 is strong left; and -60 to +60 is considered mixed. A copy of the handedness questionnaire and scoring instructions are also available at jaimieveale.com; the URL for the paper itself follows.",
    "Units": "Laterality quotient (range from -100 [left] to +100 [right]",
    "TermURL": "https://doi.org/10.1080/1357650X.2013.783045"
};
"language_current": {
    "LongName": "Language most frequently used, currently",
    "Description": "The patient is asked: What language do you speak the most in daily life? I.e. >50% of the time"
};
"language_child": {
    "LongName": "Language spoken predominantly prior to age 8",
    "Description": "The patient is asked: What language did you speak the most before age 8?  If you are unsure–list the first language you spoke after birth."
};
"education": {
    "LongName": "Full years of education.",
    "Description": "Education is measured on a system similar to that documented in the Halstead Reitan Battery (2004). Credit is only given for full years of completed formal education, with standard allocations for high school (12y), an Associate's degree (14y), a Bachelor's degree (16y), Master's (18y) and a Doctorate (21y).  Details are provided in the pre-scan questionnaire accompanying the standardized fMRI battery.",
    "TermURL": "https://cogneuro.net"
};
"group": {
    "LongName": "Lab-allocated participant group.",
    "Description": "This will differ by the group collecting data.  We indicate patient type (e.g., epilepsy, tumor) and IRB protocol."
};
"researcher_collecting_fmri": {
    "LongName": "The person who ran this program and collected the fMRI data.",
    "Description": "Exactly that."
};
"bnt_raw": {
    "LongName": "Boston Naming Task v2 score.",
    "Description": "Raw score on Boston Naming Task v2.  This is the raw correct PLUS semantic cue correct.  999 = none exists.  888 = exists but not at hand when this program was run.",
    "Units": "Raw score points awarded (range 1-60)"
};
"bnt_date": {
    "LongName": "Date at which the Boston Naming Task v2 was administered.",
    "Description": "Date of BNT2 administration."
};
"scan_year": {
    "LongName": "Year in which this program was run and these files were generated.",
};
"scan_month": {
    "LongName": "Month in which this program was run and these files were generated.",
};
"scan_date": {
    "LongName": "Day of the month on which this program was run and these files were generated.",
};
"scan_time": {
    "LongName": "Time of day at which this program was run and these files were generated.",
};

Note: Full details available at BIDS website; the full specification is definitive.