Coord2Region
Coord2Region maps brain coordinates (or atlas region names) to anatomical labels, nearby studies, LLM summaries, and optional AI-generated images. It combines NiMARE, Nilearn, and MNE under a single CLI/Python API and ships with a companion web interface for configuration authoring.
Why Coord2Region?
- Atlas + studies in one stop. Fetch atlases, convert MNI ↔ Talairach, and query datasets such as Neurosynth, NeuroQuery, and NiMARE without wiring them up yourself.
- Optional AI enrichments. Provide API keys once (OpenAI, Gemini, Hugging Face, etc.) and the same workflow can emit human-friendly summaries or illustrative images.
- Reproducible outputs. Every command can emit YAML, JSON, and CSV artefacts so collaborators can re-run the exact pipeline.
- Browser builder. The React/Vite builder mirrors the CLI schema so first-time users can generate configs and commands without installing Python up front.
Quick Start
-
Install the package (Python 3.10-3.14):
python -m venv .venv source .venv/bin/activate pip install coord2region
-
Configure credentials and defaults. Run the helper once to create a private
config/coord2region-config.yaml. It covers atlas fetch directories as well as AI provider API keys (all optional).python scripts/configure_coord2region.pyPrefer environment variables? Set
OPENAI_API_KEY,GEMINI_API_KEY,HUGGINGFACE_API_KEY, etc. instead of generating the YAML. -
Run a CLI recipe.
# Atlas labels only coord2region coords-to-atlas 30 -22 50 --atlas harvard-oxford # Labels + studies + LLM summary (requires API key) coord2region coords-to-summary 30 -22 50 --atlas harvard-oxford --model gemini-2.0-flash # Region name workflow coord2region region-to-insights "Left Amygdala" --atlas harvard-oxford
-
Explore the builder. Visit the Config Builder to generate YAML/CLI commands interactively. Import/export configs to stay in sync with local runs.
-
Jump into Python (optional).
from coord2region import AtlasFetcher, AtlasMapper, AIModelInterface, generate_summary atlas = AtlasFetcher().fetch_atlas("harvard-oxford") mapper = AtlasMapper("harvard-oxford", atlas["vol"], atlas["hdr"], atlas["labels"]) print(mapper.mni_to_region_name([30, -22, 50])) ai = AIModelInterface(huggingface_api_key="YOUR_KEY") studies = [] # populate via coord2region.coord2study helpers print(generate_summary(ai, studies, [30, -22, 50]))
CLI recipes at a glance
| Goal | Command |
|---|---|
| Labels only | coord2region coords-to-atlas 30 -22 50 --atlas harvard-oxford |
| Labels + studies | coord2region coords-to-study 30 -22 50 --atlas harvard-oxford --radius-mm 10 |
| Labels + studies + summaries | coord2region coords-to-summary 30 -22 50 --atlas harvard-oxford --model gemini-2.0-flash |
| Add nilearn anatomical figures | coord2region coords-to-insights 30 -22 50 --image-backend nilearn |
| Region → coordinates + insights | coord2region region-to-insights "Left Amygdala" --atlas harvard-oxford |
All commands emit YAML/JSON/CSV outputs under coord2region-output/ by default. Use --result-dir to customise the export path.
Web interface
The web interface mirrors the CLI schema and lives at babasanfour.github.io/Coord2Region. It provides:
- Guided forms for inputs (coordinates or region names), atlas selection, study radius, summaries, and image options.
- Live YAML + CLI previews you can copy or download.
- Presets to learn common workflows (single peak lookup, region → coords, multi-peak insights).
- Import/export so you can iterate on a config in the browser and run the CLI locally.
| Builder (inputs & atlas) | Builder (outputs & providers) | Runner |
To preview or hack on the web stack locally, follow web-interface/README.md (Vite dev server + Jekyll shell + Playwright tests).
Further reading
- Documentation – user guide, pipeline walkthrough, API reference, tutorials.
- Examples gallery
- Web interface overview
- License · Contributing · Code of Conduct · Security Policy
- Preprint
API workflow
A compact overview of the Coord2Region pipeline: shows how inputs (coordinates or region names) are mapped to atlas labels, linked to study results, optionally enriched by AI summaries/images, and exported as reproducible artifacts.
Metadata
Release files for coord2region 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coord2region-0.1.5.tar.gz | 21.0 MB | Without provenance | Details for coord2region-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coord2region-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for coord2region-0.1.5-py3-none-any.whl |
Total release size: 21.1 MB
Release files / coord2region-0.1.5.tar.gz
| Download URL | coord2region-0.1.5.tar.gz |
|---|---|
| Size | 21.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
444fdb225f7ea41450ec10acb74d207e1791562ed361ba05f44ed276ef53120a
|
|
BLAKE2b-256 checksum How to use checksums |
fa9d41dd74c2a633c9aaca5d1730de7f8894fb78d06ebd4b3d2a8325c358654c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / coord2region-0.1.5-py3-none-any.whl
| Download URL | coord2region-0.1.5-py3-none-any.whl |
|---|---|
| Size | 77.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d7d0d9ef0cdc5901d3e141c5425d83a46372b6b006dc483182aa67cfe77aff0
|
|
BLAKE2b-256 checksum How to use checksums |
594ac49a6ffce2330dc01e514f8dfbd965f6a3bc197a67a7eafef85f5624cf31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for coord2region 0.1.5
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.