mne_bids.find_inherited_sidecars#
- mne_bids.find_inherited_sidecars(fname, candidates, *, root=None, extension='.json')[source]#
Choose the sidecar files that apply to a recording from a list of files.
Under the BIDS inheritance principle, a sidecar file applies to a recording if it has the same suffix, every entity in its name is in the recording’s name with the same value, and it is stored in the recording’s directory or in one above it, up to the dataset root.
- Parameters:
- fname
str The path of the recording.
- candidatesiterable of
str The files to choose from, for example the files of a dataset listing.
- root
str|None The root of the dataset, spelled as at the start of
fnameand ofcandidates. IfNone, the directory above thesub-*directory offnameis used.- extension
str The extension of the sidecar files.
- fname
- Returns:
Notes
Added in version 0.21.