# ---- Manually enter entries ----------------------------------------
dataset_description <- BIDSDatasetDescription(
# a parent directory is mandatory as it defines what data
# dataset_description.json applies to
parent_directory = "/path/to/BIDS/folder",
Name = "A dummy experiments",
BIDSVersion = "1.6.0",
License = "CC0",
Authors = c("Zhengjia Wang"),
Acknowledgements = c(
"Package `bidsr` is a 3rd-party BIDS reader developed by",
"a RAVE (https://rave.wiki) team member with procrastination."
),
HowToAcknowledge = c(
"Please cite this paper:",
"https://doi.org/10.1016/j.neuroimage.2020.117341"
),
Funding = c(
"NIH R01MH133717",
"NIH U01NS113339",
"NIH 1R24MH117529"
),
ReferencesAndLinks = c(
"https://rave.wiki"
),
DatasetDOI = "https://doi.org/10.1016/j.neuroimage.2020.117341",
HEDVersion = "8.0.0",
GeneratedBy = list(
list(
Name = "Dipterix",
Version = "0.0.1",
Container = list(
Type = "r-package",
Tag = "dipterix/bidsr:0.0.1"
)
)
)
)
# access the information
dataset_description$License
dataset_description$GeneratedBy[[1]]$Container
# ---- Read from file ---------------------------------------------
# Run `download_bids_examples()` first
examples <- download_bids_examples(test = TRUE)
if(!isFALSE(examples)) {
example_descr <- file.path(
examples, "ieeg_epilepsy_ecog", "dataset_description.json")
x <- get_bids_dataset_description(example_descr)
x
# ---- Formatting --------------------------------------------------
# convert to R list (use recursive to expand field `GeneratedBy`)
as.list(x, recursive = TRUE)
# JSON string
format(x)
}
Run the code above in your browser using DataLab