Skip to content

greenpolo/LangSlice

Repository files navigation

LangSlice

Register histological brain sections to BrainGlobe atlases.
A VLM estimates position, an image-gen model lays down atlas colors, Elastix warps the rest.

Three histology slices registered to the Allen mouse atlas

How it works

Agent loop: inspect, explore atlas candidates, submit AP

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.

LangSlice registration pipeline: histology slice to atlas-colored target, dense warp, and overlay

Quick start

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.9

Full CLI: langslice --help. Pipeline detail: docs/index.md.

Model Hub Transition

LangSlice is migrating training/data helpers into shared packages under models/:

  • models/langslice-traces/langslice_traces
  • models/synthdata/synthdata
  • models/training-core/langslice_training
  • models/data/langslice_data

Training entrypoints are exposed as small launchers: langslice-single-turn-rl, langslice-isft, and langslice-sft-train.

Public model-card metadata for the released variant is in models/langslice-gemma-4/variants/langslice-gemma-4-e4b/README.md.

Links

About

Use vision-language models to perform alignment and registration of histological brain sections to ANY atlas in ANY orientation plane.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors