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, suffixes=None, extensions=None, datatypes=None, check=False, *, ignore_json=False, ignore_nosub=False)[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 on BIDSPath.entities object.

Parameters:
rootpathlib.Path | str

The root of the BIDS path.

subjectsstr | array_like of str | None

The subject ID. Corresponds to “sub”.

sessionsstr | array_like of str | None

The acquisition session. Corresponds to “ses”.

tasksstr | array_like of str | None

The experimental task. Corresponds to “task”.

acquisitions: str | array-like of str | None

The acquisition parameters. Corresponds to “acq”.

runsstr | array_like of str | None

The run number. Corresponds to “run”.

processingsstr | array_like of str | None

The processing label. Corresponds to “proc”.

recordingsstr | array_like of str | None

The recording name. Corresponds to “rec”.

spacesstr | array_like of str | None

The coordinate space for anatomical and sensor location files (e.g., *_electrodes.tsv, *_markers.mrk). Corresponds to “space”. Note that valid values for space must come from a list of BIDS keywords as described in the BIDS specification.

splitsstr | array_like of str | None

The split of the continuous recording file for .fif data. Corresponds to “split”.

descriptionsstr | array_like of str | None

This corresponds to the BIDS entity desc. It is used to provide additional information for derivative data, e.g., preprocessed data may be assigned description='cleaned'.

Added in version 0.11.

suffixesstr | array_like of str | 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’

extensionsstr | array_like of str | None

The extension of the filename. E.g., '.json'.

datatypesstr | array_like of str | None

The BIDS data type, e.g., 'anat', 'func', 'eeg', 'meg', 'ieeg'.

checkbool

If True, only returns paths that conform to BIDS. If False (default), the .check attribute of the returned mne_bids.BIDSPath object will be set to True for paths that do conform to BIDS, and to False for those that don’t.

ignore_jsonbool

If True, ignores json files. Defaults to False.

ignore_nosubbool

If True, ignores all files that are not of the form root/sub-*. Defaults to False.

Returns:
bids_pathslist of mne_bids.BIDSPath

The matching paths.

Examples using mne_bids.find_matching_paths#

01. Read BIDS datasets

01. Read BIDS datasets

12. Updating BIDS datasets

12. Updating BIDS datasets