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').
The relative file paths organized according to 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.
Organize a list of relative file paths based on BIDS naming conventions.