Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

loading

loading

Lazy loading of atlas NIfTI + label CSV files from the HF dataset.

Classes:

NameDescription
AtlasA loaded atlas — image, labels, and metadata.

Methods:

NameDescription
load_atlasLazy-load an atlas by registry name.

Classes

Atlas

Atlas(name: str, image: nb.Nifti1Image, labels: pl.DataFrame, kind: AtlasKind, citation: str) -> None

A loaded atlas — image, labels, and metadata.

Constructed by load_atlas; users normally don’t instantiate directly.

Attributes:

NameTypeDescription
namestrRegistry key (e.g. "harvard_oxford").
imageNifti1ImageNIfTI volume. 3D for deterministic atlases, 4D for probabilistic ones (last axis indexes regions).
labelsDataFrameTwo-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.
kindAtlasKind"deterministic" or "probabilistic".
citationstrShort citation for the original atlas.

Methods

load_atlas

load_atlas(name: str) -> Atlas

Lazy-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:

NameTypeDescriptionDefault
namestrAtlas key from list_atlases.required

Returns:

TypeDescription
AtlasAn Atlas with image, labels, and metadata loaded.