bids.layout.BIDSJSONFile¶
- class BIDSJSONFile(filename)[source]¶
Represents a single JSON metadata file in a BIDS dataset.
Derived from BIDSFile and provides additional functionality for reading the contents of JSON files as either dicts or strings.
- Attributes:
- class_
- dirname
- filename
- is_dir
- path
relpath
Return path relative to layout root
- tags
Methods
copy
(path_patterns[, symbolic_link, root, ...])Copy the contents of a file to a new location.
get_associations
([kind, include_parents])Get associated files, optionally limiting by association kind.
get_dict
()Return the contents of the current file as a dictionary.
get_entities
([metadata, values])Return entity information for the current file.
get_json
()Return the contents of the current file as a JSON string.
get_metadata
()Return all metadata associated with the current file.
- __init__(filename)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
Methods
__init__
(filename)A simple constructor that allows initialization from kwargs.
copy
(path_patterns[, symbolic_link, root, ...])Copy the contents of a file to a new location.
get_associations
([kind, include_parents])Get associated files, optionally limiting by association kind.
get_dict
()Return the contents of the current file as a dictionary.
get_entities
([metadata, values])Return entity information for the current file.
get_json
()Return the contents of the current file as a JSON string.
get_metadata
()Return all metadata associated with the current file.
Attributes
class_
dirname
entities
filename
is_dir
metadata
path
registry
relpath
Return path relative to layout root
tags