brain_deer.infrastructure.bids.entities¶
BIDS filename parsing and lightweight item records.
Classes¶
One indexed file in a BIDS dataset (metadata only until loaded). |
Functions¶
|
Return |
|
Parse a BIDS-style basename into entities, suffix, and extension. |
|
Infer BIDS datatype folder from a file path. |
|
Build a |
|
Stable layer identity across subjects: entities except |
|
Role key for a |
|
Recover a role key from a layer's |
|
Human-readable layer name for the Files tab (role-stable, no |
Module Contents¶
- class brain_deer.infrastructure.bids.entities.BIDSItem¶
One indexed file in a BIDS dataset (metadata only until loaded).
- brain_deer.infrastructure.bids.entities.split_bids_extension(filename: str) tuple[str, str]¶
Return
(stem, extension)handling.nii.gz.
- brain_deer.infrastructure.bids.entities.parse_bids_filename(filename: str) tuple[dict[str, str], str, str]¶
Parse a BIDS-style basename into entities, suffix, and extension.
- brain_deer.infrastructure.bids.entities.infer_datatype(path: pathlib.Path, dataset_root: pathlib.Path) str¶
Infer BIDS datatype folder from a file path.
- brain_deer.infrastructure.bids.entities.item_from_path(path: pathlib.Path, dataset_root: pathlib.Path) BIDSItem | None¶
Build a
BIDSItemfrom an on-disk path, orNoneif not BIDS-like.
- brain_deer.infrastructure.bids.entities.role_key_for_entities(entities: dict[str, str], suffix: str, *, kind: str = '') str¶
Stable layer identity across subjects: entities except
sub, plus suffix.Used as
loaded_fileskeys for BIDS layers so subject switches can hot-swap payloads without tearing down scene settings (opacity, colormap, projections, …).
- brain_deer.infrastructure.bids.entities.role_key_for_item(item: BIDSItem) str¶
Role key for a
BIDSItem(subject-independent).