Skip to main content

AIND atlas terminology

CI semantic-release: angular License ruff uv Copier

Resolve and select brain structures in Allen atlas-assets terminologies

Installation

If you choose to clone the repository, you can install the package by running the following command from the root directory of the repository:

pip install .

Usage

A terminology is the tree of structures an atlas's annotation volumes label, in the atlas-assets format Allen publishes to the public allen-atlas-assets bucket. The package has no dependencies and never touches the network: the Allen adult mouse releases 2017 (which labels the CCFv3 2017 annotation), 2020, 2026-03 and 2026 ship with it (BUNDLED), pinned by checksum. Any other release loads with from_directory(path).

from aind_atlas_terminology import load, lateral, slicer_color_table

ccf = load()  # allen-adult-mouse-terminology 2017
ccf26 = load("2026")

# A structure is named by abbreviation, full name or identifier
ccf.term("LGd")  # Term(identifier='MBA:170', ...)
ccf.term("dorsal part of the lateral geniculate complex")
ccf.resolve("CUL4 5").matched_on  # 'alias': the IBL spelling of 'CUL4, 5'
ccf.term("LGd-c")  # StructureNotFoundError: ... did you mean LGd-co (...)?
ccf26.term("LH")  # AmbiguousStructureError: MBA:186 (Lateral habenula), MBA:1968 (Left hemisphere)
ccf.terms_for(["LGd", "TH", "CA1"])  # reports every failure at once
ccf.search("geniculate")

# Annotation values belong to a release, so they have their own lookup
ccf.by_value(170)  # LGd; in 2026, LGd is 1635
ccf.get("MBA:170")  # identifiers are stable across releases

# Subtrees
ccf.children("LGd")  # LGd-sh, LGd-co, LGd-ip
ccf.ancestors("LGd")  # root, grey, BS, IB, TH, DORsm, GENd
ccf.ancestor_at("LGd-co", 4)  # TH
ccf.partition("TH", 6)  # tiles the thalamus at depth 6
ccf.annotation_values("LGd")  # {170, 496345664, 496345668, 496345672}
ccf.values_present("LGd", np.unique(annotation))
ccf.in_order(["CB", "LGd", "CA1"])  # anatomical order

# Tables: plain dicts, which pandas, polars and pyarrow all read
pd.DataFrame(ccf.to_records())  # brainglobe's lookup_df columns, plus depth

# Hemispheres are a convention of some annotation volumes, not of the terminology:
# iblatlas and the compacted lateralized CCF negate left-hemisphere values
lateral.term_and_side(ccf, -496345668)  # (Term(... 'LGd-co' ...), 'left')
lateral.values_present(ccf, "LGd", np.unique(annotation), "left")
slicer_color_table(ccf, compact_values, "ccf.ctbl", lateralized=True)

Where a structure is named, an int is refused, since it could mean an identifier or a release's annotation value; brainglobe treats them as one number, which holds in 2017 and nowhere since. Releases since 2020 have several roots, and only 2017 publishes Allen's sibling order (has_sibling_order); elsewhere siblings keep the table's order.

Allen rewrites published files in place, so the vendored files are pinned in src/aind_atlas_terminology/data/sources.json with their sha256, ETag and modification time. uv run python scripts/update_terminologies.py re-downloads them and lists what changed; ... update_terminologies.py allen-adult-mouse-terminology <version> adds a release. A change to the data is a commit and a release of this package.

The bundled terminology data are © Allen Institute, CC-BY-4.0.

Contributing

Setup, checks, tests and conventions are in CONTRIBUTING.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for aind-atlas-terminology 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aind-atlas-terminology 0.2.0
File Size Uploaded Provenance Actions
aind_atlas_terminology-0.2.0.tar.gz 386.1 kB Without provenance Details for aind_atlas_terminology-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aind-atlas-terminology 0.2.0
File Interpreter ABI Platform Actions
aind_atlas_terminology-0.2.0-py3-none-any.whl Python 3 none any Details for aind_atlas_terminology-0.2.0-py3-none-any.whl

Total release size: 700.9 kB

Release files / aind_atlas_terminology-0.2.0.tar.gz

Download URL aind_atlas_terminology-0.2.0.tar.gz
Size 386.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e78d2fc515b7bc5aab8f3304135d48a27ab8998524d77cf62a210f6008c3c27e
BLAKE2b-256 checksum
How to use checksums
0288e8a4f7a893be866ca3d2c97d5921de88a0b1605a48243776d22dcf952c42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / aind_atlas_terminology-0.2.0-py3-none-any.whl

Download URL aind_atlas_terminology-0.2.0-py3-none-any.whl
Size 314.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da997acc50eb3f7f35c5dbe4b097e8d63f1321dd287fa8526c609acdb9bfb091
BLAKE2b-256 checksum
How to use checksums
93caaba000ecd13f8bd51f43ca35cad52313dc72fe00cf9951b39b5409c8512f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for aind-atlas-terminology 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page