loading¶
Lazy loading of atlas NIfTI + label CSV files from the HF dataset.
Classes:
| Name | Description |
|---|---|
Atlas | A loaded atlas — image, labels, and metadata. |
Methods:
| Name | Description |
|---|---|
load_atlas | Lazy-load an atlas by registry name. |
Classes¶
Atlas¶
Atlas(name: str, image: nb.Nifti1Image, labels: pl.DataFrame, kind: AtlasKind, citation: str) -> NoneA loaded atlas — image, labels, and metadata.
Constructed by load_atlas; users normally don’t instantiate
directly.
Attributes:
| Name | Type | Description |
|---|---|---|
name | str | Registry key (e.g. "harvard_oxford"). |
image | Nifti1Image | NIfTI volume. 3D for deterministic atlases, 4D for probabilistic ones (last axis indexes regions). |
labels | DataFrame | Two-column index, name table. For deterministic atlases index is the integer voxel value; for probabilistic atlases index is the region index along the 4th dim of image. |
kind | AtlasKind | "deterministic" or "probabilistic". |
citation | str | Short citation for the original atlas. |
Methods¶
load_atlas¶
load_atlas(name: str) -> AtlasLazy-load an atlas by registry name.
First call fetches the NIfTI + label CSV from
huggingface.co/datasets/nltools/niftis (cached locally
afterwards). Subsequent calls in the same process are memoized.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | Atlas key from list_atlases. | required |
Returns:
| Type | Description |
|---|---|
Atlas | An Atlas with image, labels, and metadata loaded. |