Register histological brain sections to BrainGlobe atlases.
A VLM estimates position, an image-gen model lays down atlas colors, Elastix warps the rest.
Warning
LangSlice is in-development. Some atlases may produce mixed results; and horizontal and sagittal orientations haven't yet been thoroughly tested. LangSlice does not offer manual registration methods — it is meant to be used in combination with other registration software (ABBA, QUINT, PyNutil, BrainGlobe ecosystem, etc.). Export functions to these tools have not been fully developed yet.
A VLM agent (default langslice-gemma-4-E4B)
inspects the slice, explores candidate atlas planes through tool calls, and
submits an AP coordinate. Image generation then produces an atlas-colored
target from the histology, and itk-elastix recovers a dense B-spline
deformation. Results export to VisuAlign-compatible JSON for QUINT / ABBA.
conda env create -f environment.yml
conda activate langslice
pip install -e .
cp .env.example .env # add AI Studio / Vertex / OpenAI keys# Position estimation
langslice estimate slice.png
# End-to-end registration at a known atlas position
langslice register slice.png --position 3.9Full CLI: langslice --help. Pipeline detail: docs/index.md.
LangSlice hosts training/data helpers in shared packages under models/:
models/langslice-traces/langslice_tracesmodels/training-core/langslice_trainingmodels/data/langslice_data
Training entrypoints are exposed as model-scoped launchers:
langslice-gemma-rl and langslice-gemma-sft.
Public model-card metadata for the released variant is in
models/langslice-gemma-4/variants/langslice-gemma-4-e4b/README.md.
- Documentation — full pipeline + harness internals
- langslice-gemma-4-E4B — the v1.0 fine-tune
- SliceBench — self-contained position-estimation benchmark
tauri-gui/— desktop app
If you use LangSlice in your work, please cite the project metadata in
CITATION.cff. GitHub renders a "Cite this repository"
button in the right sidebar from that file.
BSD-3-Clause. See LICENSE.



