dirconn.read_bids#
- dirconn.read_bids(root: str | PathLike[str], *, subject: str, task: str, session: str | None = None, run: int | str | None = None, datatype: str | None = None, level: str = 'sensor', description: str | None = None, nan: str = 'raise', bad_annotations: str = 'ignore') TimeSeries#
Read one recording from a BIDS dataset as a
TimeSeries.- Parameters:
root (path-like) – Root of the BIDS dataset, or of the derivatives dataset when
level="roi".subject (str) – BIDS entities.
task (str) – BIDS entities.
session (optional) – BIDS entities.
run (optional) – BIDS entities.
datatype ({"eeg", "meg", "ieeg"}, optional) – Inferred from the directory when only one exists.
level ({"sensor", "roi"}) –
"sensor"reads a standard raw BIDS recording throughmne-bids."roi"reads a dataset written withwrite_roi_bids()and requires theDirconnconvention entry.description (str, optional) – The
descentity; required forlevel="roi".nan ({"raise", "mask"}) – What to do with NaN samples, as in
TimeSeries.from_array():"mask"replaces them by 0 and marks them invalid inTimeSeries.valid(gaps in the recording).bad_annotations ({"ignore", "mask"}) – Sensor level only:
"mask"also marks samples underBAD_annotations invalid (needsnan="mask"). Ignored forlevel="roi", where invalid samples are stored as NaN.
- Return type: