brain_pipe.utils.path.BIDSPathGenerator¶
- class BIDSPathGenerator(root_dir)¶
Bases:
object
Generate BIDS paths for a given root directory.
- __init__(root_dir)¶
Create a new BIDSPathGenerator.
- Parameters:
root_dir (str) – The root directory of the BIDS dataset.
Methods
__init__
(root_dir)Create a new BIDSPathGenerator.
select_paths
([subjects, sessions, tasks, ...])Select BIDS paths for a given set of parameters.
- select_paths(subjects=None, sessions=None, tasks=None, runs=None, extensions='eeg', suffix='bdf')¶
Select BIDS paths for a given set of parameters.
- Parameters:
subjects (Optional[Union[str, Sequence[str]]]) – The subjects to select. When None, all subjects are selected. When a string, only the subject with the given name is selected. When a sequence of strings, all subjects with the given names are selected.
sessions (Optional[Union[str, Sequence[str]]]) – The sessions to select. When None, all sessions are selected. When a string, only the session with the given name is selected. When a sequence of strings, all sessions with the given names are selected.
tasks (Optional[Union[str, Sequence[str]]]) – The tasks to select. When None, all tasks are selected. When a string, only the task with the given name is selected. When a sequence of strings, all tasks with the given names are selected.
runs (Optional[Union[str, Sequence[str]]]) – The runs to select. When None, all runs are selected. When a string, only the run with the given name is selected. When a sequence of strings, all runs with the given names are selected.
extensions (Optional[Union[str, Sequence[str]]]) – The extensions to select. When None, all extensions are selected. When a string, only the extension with the given name is selected. When a sequence of strings, all extensions with the given names are selected.
suffix (Optional[Union[str, Sequence[str]]]) – The suffixes to select. When None, all suffixes are selected. When a string, only the suffix with the given name is selected. When a sequence of strings, all suffixes with the given names are selected.
- Returns:
A list of paths that match the given parameters.
- Return type:
List[str]