@groovy.transform.CompileStatic class BidsDataset extends java.lang.Object
Represents a parsed BIDS dataset.
Holds the root path, the dataset name and description loaded from
dataset_description.json, the full list of BidsFile objects
produced by the parser, and the participant table from participants.tsv
(if present).
Provides convenience query methods (getFilesBySuffix, getFilesByEntity, getSubjects, getSessions, getSuffixes) used by the grouping handlers.
| Type | Name and description |
|---|---|
java.util.Map<java.lang.String, java.lang.Object> |
description |
java.util.List<BidsFile> |
files |
java.lang.String |
name |
java.util.List<java.util.Map<java.lang.String, java.lang.String>> |
participants |
java.lang.String |
path |
| Constructor and description |
|---|
BidsDataset(java.lang.String path)Construct a BidsDataset for the given root directory. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
addFile(BidsFile file)Add file to dataset |
|
java.util.List<BidsFile> |
getFilesByEntity(java.lang.String entityName, java.lang.String entityValue)Get files by entity value |
|
java.util.List<BidsFile> |
getFilesBySuffix(java.lang.String suffix)Get files by suffix |
|
java.util.List<java.lang.String> |
getSessions()Get all unique sessions in dataset |
|
java.util.Map<java.lang.String, java.lang.Object> |
getStatistics()Get dataset statistics |
|
java.util.List<java.lang.String> |
getSubjects()Get all unique subjects in dataset |
|
java.util.List<java.lang.String> |
getSuffixes()Get all unique suffixes in dataset |
|
void |
loadParticipants()Load participants.tsv if it exists |
|
java.lang.String |
toString() |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait() |
Construct a BidsDataset for the given root directory.
The constructor validates and canonicalises the path to prevent directory-traversal
attacks, then attempts to load dataset_description.json to populate
name and description.
path - absolute path to the BIDS dataset root directoryAdd file to dataset
file - BIDS fileGet files by entity value
entityName - Entity nameentityValue - Entity valueGet files by suffix
suffix - BIDS suffix (e.g., "T1w", "bold")Get all unique sessions in dataset
Get dataset statistics
Get all unique subjects in dataset
Get all unique suffixes in dataset
Load participants.tsv if it exists
Groovy Documentation