API Reference#
Welcome to the technical reference for Coord2Region.
While the CLI is great for quick recipes, the Python API is designed for experienced users. It allows you to integrate anatomical mapping, literature search, and AI summarization directly into your existing scripts, notebooks, and data processing pipelines.
Why use the Python API?#
Batch Processing: Loop through thousands of coordinates efficiently using the
pipeline.Custom Workflows: Use the
AtlasFetcherto download atlases for your own use, even outside of Coord2Region.AI Integration: Import
llmto add semantic summaries to your ownpandasDataFrames or analysis results.
Quick Access#
Most users will only need a few core components. Use this cheat sheet to find the right tool for your task:
Goal |
Component |
|---|---|
Run Everything |
|
Map Coordinates |
|
Manage Data |
|
Query Literature |
|
Generate Summaries |
|
Configure Settings |
|
The package is organized into logical sub-systems. You can browse the full tree in the left navigation sidebar, but here is a guide to what lives where:
`coord2region.pipeline`: The “glue” code that stitches modules together.
``coord2region.fetching``: Data input. Handles interactions with
nilearnandmnedatasets.`coord2region.ai_model_interface`: External APIs. Contains the logic for querying Neurosynth and NeuroQuery.
`coord2region.llm`: Generative AI. Functions for prompting OpenAI, Gemini, and Hugging Face models.
`coord2region.utils`: Low-level helpers for file I/O, validation, and logging.
Tip
Pro Tip: If you are looking for the exact arguments for the CLI, they map 1-to-1 with the arguments in Coord2RegionConfig.