Converts a parser_spec list (as returned by bids_datatype_spec
or the internal func_spec() etc.) into a parser object suitable for
passing to register_datatype.
Arguments
- spec
A
parser_speclist with elementskeystruc,kinds, andtype, as returned bybids_datatype_spec.- typename
The name given to the final type element. Default is
"kind".
Examples
spec <- bids_datatype_spec(
type = "dwi",
entities = c("sub", "ses", "acq", "run"),
suffixes = list(dwi = c(".nii.gz", ".nii", ".bvec", ".bval", ".json"))
)
parser <- gen_parser(spec)