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.

labeling

labeling

Coordinate-level atlas labeling.

Adapted from atlasreader (BSD-3-Clause). Cite:

Notter et al. (2019). AtlasReader. JOSS 4(34), 1257.

Attributes:

NameTypeDescription
CoordsLike

Methods:

NameDescription
label_coordsLook up anatomical labels for a set of MNI mm coordinates.

Classes

Methods

label_coords

label_coords(coords: CoordsLike, *, atlas: str | Sequence[str] = 'harvard_oxford', prob_threshold: float = 5.0) -> pl.DataFrame

Look up anatomical labels for a set of MNI mm coordinates.

For each coordinate, returns the atlas region(s) it falls in. Works for both deterministic atlases (single label per coord) and probabilistic atlases (formatted "42.0% Foo; 18.0% Bar" strings, sorted by descending probability).

Parameters:

NameTypeDescriptionDefault
coordsCoordsLike(N, 3) array-like of MNI mm coordinates (x, y, z). A single coord like (-42, -22, 56) is also accepted.required
atlasstr | Sequence [ str ]Atlas name or list of names from list_atlases. One column is added to the output per atlas.‘harvard_oxford’
prob_thresholdfloatFor probabilistic atlases only — drop regions with probability (in percent units) below this threshold.5.0

Returns:

TypeDescription
DataFramePolars DataFrame with columns x, y, z plus one
DataFramecolumn per atlas. All atlas columns are Utf8.