Skip to contents

Creates a Brain Imaging Data Structure (BIDS) JSON sidecar file from the metadata (data dictionary and levels table). Returns the JSON object or writes it to a file.

Usage

create_bids_sidecar(
  data,
  study,
  release = "latest",
  var_coding = "values",
  metadata_description = "Dataset exported using NBDCtools",
  path_out = NULL,
  pretty = TRUE
)

Arguments

data

tibble. The raw data or data with labels, see transf_label(). If the data is not labelled, the function will try to label the data first.

study

character. NBDC study (One of "abcd" or "hbcd")

release

character. Release version (Default: "latest").

var_coding

character. the variable coding, one of "values", "labels". If the data is processed with transf_value_to_label(), please use "labels".

metadata_description

string, the description of the metadata

path_out

character. the path to the output file. If NULL, the function will return the json object.

pretty

logical. Whether to pretty print the json.

Value

the json object or the path to the json file

Examples

if (FALSE) { # \dontrun{
data |> create_bids_sidecar()
data |> create_bids_sidecar(path_out = "data.json")
} # }