CLI usage¶
This page describes the active CLI and Tauri GUI workflows.
Position Estimation¶
langslice estimate <image> [--atlas ...] [--model ...] [--workflow ...]
langslice estimate-group <img1> <img2> ... [--interval 200] [--atlas ...]
langslice estimate-brain <image_folder> [--atlas ...] [--anchors ...]
Single-slice and group position estimation run through the ADK harness. The agent
surface is intentionally small: fetch_atlas, submit_estimate, and
submit_group_estimate.
Whole-brain estimation discovers a folder of slices, estimates anchor slices, interpolates center positions, runs windowed image-gen estimation for the remaining slices, and fits a constrained monotonic position curve.
Image-Gen Registration¶
langslice register <image> --position <mm> [--registration-mode direct|agentic] [--image-model ...] [--review-model ...] [--max-candidates 3] [--out ...]
Registration has one active method: image-gen registration.
- Load, normalize, and downsample the histology slice.
- Generate atlas inputs at the requested atlas position.
- Ask the image model to generate an atlas-colored target aligned to the histology.
- Register the generated target to the atlas color map with itk-elastix.
- Warp the atlas through the recovered transform.
- Return the model-generated atlas target, Elastix-warped atlas, warped-border overlay, and VisuAlign markers.
Modes:
directgenerates one candidate and returns it.agenticlets an ADK review agent inspect up to three candidates before confirming one.
Provider routing:
- Google image models use the Google provider adapter.
gpt-image-2uses the OpenAI Images API by default.- Flux models use the OpenAI-compatible Images API path.
Tauri GUI¶
The desktop app lives in tauri-gui/. For position estimation, registration,
and quick-affine preview, Rust sends one request to the Python engine service
protocol:
The service streams progress/log events and returns typed JSON result or error
envelopes. In the developer checkout, the Rust bridge uses the local src/
package so the app exercises the worktree code. Export still shells out through
the legacy langslice register --out ... --json path until the engine API has
an affine-aware export request. Rust continues to handle atlas loading,
reslicing, mesh serving, local engine management, and image thumbnail caching.
Engine Contract Artifacts¶
The engine API is defined in Python Pydantic models and mirrored into generated frontend types:
The generated TypeScript contract is written to both tauri-gui/src/lib/ and
web-demo/src/lib/. The web demo declares only its supported subset of engine
methods.
Debug And Request Capture¶
Set LANGSLICE_VLM_DEBUG_DIR to save run artifacts. For ADK estimation request auditing,
set LANGSLICE_ADK_CAPTURE_REQUESTS_DIR to write redacted JSONL request captures.