A list of relative file paths to organize.
A list of filename suffixes to categorize by (e.g., 'events').
A list of special directory names (e.g., 'phenotype').
An object containing two properties:
- candidates
: A list of all file paths that were successfully categorized.
- organizedPaths
: A Map where keys are the suffixes and special directories.
Each value is a Map with 'tsv' and 'json' properties, containing the corresponding
file paths. Keys will be present even if no files are found for them.
Organizes a list of relative file paths based on BIDS naming conventions.
This function filters and categorizes file paths into a structured object. It identifies files based on whether they are in special directories (like 'phenotype'), are top-level files, or are located within subject-specific directories ('sub-xxx').
Files are categorized by matching their filename against a list of suffixes (e.g., 'events', 'participants') or by their presence in a special directory. Only files with '.tsv' or '.json' extensions are considered.