@groovy.transform.CompileStatic class BidsFile extends java.lang.Object
Represents a single file entry in a BIDS dataset.
Stores the file path, BIDS suffix (e.g. "T1w", "bold"),
the list of BidsEntity key–value pairs parsed from the filename,
optional JSON sidecar and other associated file paths, and file-system
metadata (size, modification time) loaded on demand.
Instances are created by nfneuro.plugin.util.BidsCsvParser from
the TSV output of libBIDSsh_parse_bids_to_table. The
isPrimaryFile() and getBasename() helpers drive grouping
logic in the set handlers.
| Modifiers | Name | Description |
|---|---|---|
static java.util.List<java.lang.String> |
PRIMARY_EXTENSIONS |
|
static java.util.List<java.lang.String> |
TYPE_ALLOWING_PARTS |
|
static java.util.Map<java.lang.String, java.lang.String> |
VALID_EXTENSIONS |
| Type | Name and description |
|---|---|
java.util.List<java.lang.String> |
associatedFiles |
java.util.List<BidsEntity> |
entities |
java.lang.Long |
fileSize |
java.lang.String |
jsonSidecar |
java.lang.Long |
lastModified |
java.util.Map<java.lang.String, java.lang.Object> |
metadata |
java.lang.String |
path |
java.lang.String |
suffix |
| Constructor and description |
|---|
BidsFile(java.lang.String path)Construct a BidsFile for the given path. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
addAssociatedFile(java.lang.String filePath)Add associated file (JSON sidecar, etc.) |
|
void |
addEntity(java.lang.String name, java.lang.String value)Add entity to file |
|
void |
addEntity(BidsEntity entity) |
|
void |
addMetadata(java.lang.String key, java.lang.Object value)Add metadata to file |
|
boolean |
equals(java.lang.Object obj) |
|
java.lang.String |
getBasename()Get the base name of a file without extension |
|
java.lang.String |
getBasename(java.util.List<java.lang.String> excludeEntities)Get the base name of a file without extension |
|
BidsEntity |
getEntity(java.lang.String name) |
|
java.lang.String |
getEntityValue(java.lang.String entityName)Get entity value by name |
|
java.lang.String |
getExtensionType()Get extension type for categorization |
|
java.lang.String |
getFilename()Get filename without path |
|
java.lang.Object |
getMetadata(java.lang.String key)Get metadata value by key |
|
java.lang.String |
getParentDir()Get parent directory |
|
java.lang.String |
getSidecarPath()Get sidecar path (alias for jsonSidecar for compatibility) |
|
java.lang.String |
getType() |
|
boolean |
hasEntity(java.lang.String entityName)Check if entity exists |
|
int |
hashCode() |
|
boolean |
isPrimaryFile() |
|
void |
loadFileMetadata()Load file metadata (size, modification time) |
|
java.lang.String |
relativeTo(java.lang.String basePath)Convert absolute path to relative path from base path |
|
java.lang.String |
toString() |
|
static boolean |
typeAllowsParts(java.lang.String type) |
| 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 BidsFile for the given path.
The BIDS suffix is extracted automatically from the filename if possible.
path is null or emptypath - absolute or relative path to the BIDS fileAdd associated file (JSON sidecar, etc.)
filePath - Path to associated fileAdd entity to file
name - Entity namevalue - Entity valueAdd metadata to file
key - Metadata keyvalue - Metadata valueGet the base name of a file without extension
Get the base name of a file without extension
Get entity value by name
entityName - Entity name (e.g., "sub", "ses")Get extension type for categorization
Get filename without path
Get metadata value by key
key - Metadata keyGet parent directory
Get sidecar path (alias for jsonSidecar for compatibility)
Check if entity exists
entityName - Entity nameLoad file metadata (size, modification time)
Convert absolute path to relative path from base path
Groovy Documentation