Agent-driven registration of histological brain sections to BrainGlobe atlases.
Sections: Allen Mouse Brain Connectivity Atlas, Allen Institute for Brain Science (connectivity.brain-map.org).
LangSlice gives a vision-language agent tools to register a stack of histology sections to a BrainGlobe atlas. The agent inspects the anatomy, sets positions and cutting angles, aligns sections in-plane, and optionally fits SyN deformations. It chooses regions and settings and can use an image model to trace borders where useful.
Source images stay unchanged. Work is checkpointed and undoable, with
coordinate and label maps, registration.json, and QuickNII / VisuAlign
exports. Coronal sections of the Allen mouse atlas are the most tested case.
In a terminal with conda (Miniforge):
conda create -n langslice python=3.11 -y
conda activate langslice
pip install "langslice[registration,mcp]"
langslice login # ChatGPT sign-in; or set OPENAI_API_KEY / GEMINI_API_KEY (see .env.example)From the source instead: download and extract it, open a terminal in the
folder with environment.yml, and run conda env create -f environment.yml.
On Windows, run the commands in Miniforge Prompt. Python 3.11 is required.
Atlases are downloaded by BrainGlobe on first use into the user's
.brainglobe folder. The environment includes the deformable engine
(FireANTs on torch) and the MCP server.
- Getting started: install LangSlice, connect the AI app you already use (Codex, Antigravity or Claude Code) and register a brain.
- Agents, CLI and MCP: Claude Code, Antigravity or Codex
through
langslice job, Claude Desktop through MCP, or the built-in agent withlangslice linear run sections/. - ABBA: export a registration as an ABBA project and open it with ABBA's Load State.
- Python: coding agents can open a job and write their own workflows using the same tools.
Tools · Tool plugins · File formats · Architecture · Full documentation
Cite LangSlice with its DOI, 10.5281/zenodo.23900540
(all versions; Zenodo lists a DOI for each release), or the metadata in CITATION.cff (GitHub's "Cite this
repository" button). BSD-3-Clause; see LICENSE.