labeling¶
Coordinate-level atlas labeling.
Adapted from atlasreader (BSD-3-Clause). Cite:
Notter et al. (2019). AtlasReader. JOSS 4(34), 1257.
Attributes:
| Name | Type | Description |
|---|---|---|
CoordsLike |
Methods:
| Name | Description |
|---|---|
label_coords | Look 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.DataFrameLook 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:
| Name | Type | Description | Default |
|---|---|---|---|
coords | CoordsLike | (N, 3) array-like of MNI mm coordinates (x, y, z). A single coord like (-42, -22, 56) is also accepted. | required |
atlas | str | Sequence [ str ] | Atlas name or list of names from list_atlases. One column is added to the output per atlas. | ‘harvard_oxford’ |
prob_threshold | float | For probabilistic atlases only — drop regions with probability (in percent units) below this threshold. | 5.0 |
Returns:
| Type | Description |
|---|---|
DataFrame | Polars DataFrame with columns x, y, z plus one |
DataFrame | column per atlas. All atlas columns are Utf8. |