mne_bids.find_matching_paths#
- mne_bids.find_matching_paths(root, subjects=None, sessions=None, tasks=None, acquisitions=None, runs=None, processings=None, recordings=None, spaces=None, splits=None, descriptions=None, *, tracking_systems=None, entities=None, suffixes=None, extensions=None, datatypes=None, check=False, ignore_json=False, ignore_nosub=False, fnames=None)[source]#
Get list of all matching paths for all matching entity values.
Input can be str or list of str. None matches all found values.
Performs a recursive search, starting in
.root(if set), based onBIDSPath.entitiesobject.- Parameters:
- root
pathlib.Path|str The root of the BIDS path.
- subjects
str| array_like ofstr|None The subject ID. Corresponds to “sub”.
- sessions
str| array_like ofstr|None The acquisition session. Corresponds to “ses”.
- tasks
str| array_like ofstr|None The experimental task. Corresponds to “task”.
- acquisitions
str| array_like ofstr|None The acquisition parameters. Corresponds to “acq”.
- runs
str| array_like ofstr|None The run number. Corresponds to “run”.
- processings
str| array_like ofstr|None The processing label. Corresponds to “proc”.
- recordings
str| array_like ofstr|None The recording name. Corresponds to “recording”.
- spaces
str| array_like ofstr|None The coordinate space for anatomical and sensor location files (e.g.,
*_electrodes.tsv,*_markers.mrk). Corresponds to “space”. Note that valid values forspacemust come from a list of BIDS keywords as described in the BIDS specification.- splits
str| array_like ofstr|None The split of the continuous recording file for
.fifdata. Corresponds to “split”.- descriptions
str| array_like ofstr|None This corresponds to the BIDS entity
desc. It is used to provide additional information for derivative data, e.g., preprocessed data may be assigneddescription='cleaned'.Added in version 0.11.
- tracking_systems
str| array_like ofstr|None The motion tracking system labels to match for Motion-BIDS data. These correspond to the BIDS entity
tracksys. For example,tracking_systems="omcA"matches filenames containingtracksys-omcA.Added in version 0.19.
- entities
dict|None The values to match for the BIDS entities that have no keyword argument of their own, by entity name (as in
mne_bids.BIDSPath.entities). For example,entities={"echo": "1"}matches filenames containingecho-1, andentities={"reconstruction": ["norm", "raw"]}those containingrec-normorrec-raw. Each value can be a str, an array-like of str, or None.Added in version 0.21.
- suffixes
str| array_like ofstr|None The filename suffix. This is the entity after the last
_before the extension. E.g.,'channels'. The following filename suffix’s are accepted: ‘meg’, ‘markers’, ‘eeg’, ‘ieeg’, ‘T1w’, ‘participants’, ‘scans’, ‘electrodes’, ‘coordsystem’, ‘channels’, ‘events’, ‘headshape’, ‘digitizer’, ‘beh’, ‘physio’, ‘stim’.- extensions
str| array_like ofstr|None The extension of the filename. E.g.,
'.json'.- datatypes
str| array_like ofstr|None The BIDS data type, e.g.,
'anat','func','eeg','meg','ieeg'.- check
bool If
True, only returns paths that conform to BIDS. IfFalse(default), the.checkattribute of the returnedmne_bids.BIDSPathobject will be set toTruefor paths that do conform to BIDS, and toFalsefor those that don’t.- ignore_json
bool If
True, ignores json files. Defaults toFalse.- ignore_nosub
bool If
True, ignores all files that are not of the formroot/sub-*. Defaults toFalse.- fnamesiterable of path-like |
None File paths to filter instead of listing the files in
root, for example the members of an archive or the listing of a remote dataset. Each path must be insiderootor relative to it, and is not checked for existence. The returnedBIDSPathobjects arerootjoined with these paths. URLs are not accepted: pass the part after the dataset root, for example"sub-01/eeg/sub-01_task-rest_eeg.edf".Added in version 0.21.
- root
- Returns:
- bids_paths
listofmne_bids.BIDSPath The matching paths.
- bids_paths