Skip to contents

Finds files in the mock BIDS tree by matching file names and BIDS entities.

Usage

# S3 method for class 'mock_bids_project'
search_files(x, regex = ".*", full_path = FALSE, strict = TRUE, ...)

Arguments

x

A mock_bids_project object.

regex

A regular expression to match filenames (node names). Default ".*".

full_path

If TRUE, return full paths (prefixed with x$path). If FALSE, return relative paths within the BIDS structure. Default FALSE.

strict

If TRUE (default), queries for a BIDS entity (e.g., task="X") require the entity to exist on the file node and match the pattern. If FALSE, files lacking the queried entity are not automatically excluded (though they won't match if the pattern isn't .*).

...

Additional BIDS entities to match (e.g., subid = "01", task = "rest"). Values are treated as regex patterns unless they are simple strings without regex characters.

Value

A character vector of matching file paths, or NULL if no matches.