imaging-3dlisted
Install: claude install-skill arbade/konsil
# Konsil 3D Imaging Scene
**Hard rule:** no language/vision model interprets image pixels anywhere in this pipeline. Every step is deterministic tooling. The output is a *communication aid* — it helps a patient/family/clinician see where the radiologist's written findings live in 3D. All interpretation stays with the written report.
## Prerequisites (one-time)
Run `scripts/setup_imaging.sh` — checks/installs: `dcm2niix` (brew), Python venv with `TotalSegmentator`, `nibabel`, `scikit-image`, `trimesh`. Model weights (~few GB) download on first run. On Apple Silicon use `--device mps`. Warn the user: full-res segmentation can take 10–45 min on CPU; `--fast` is ~1–3 min and sufficient for a communication scene.
**License note:** TotalSegmentator code and the default `total`/`total_mr` weights are Apache-2.0; several specialized subtasks are **non-commercial only**. This skill uses only the default task. Audit before any commercial redistribution.
## Pipeline
```
cases/<case-id>/inbox/DICOM/
→ scripts/dicom_to_scene.py --fast --device mps
1. dcm2niix → NIfTI volume
2. TotalSegmentator (default task) → per-structure NIfTI masks
3. marching cubes (scikit-image) → decimated STL per structure (trimesh)
4. structure volumes (ml) → structures.json (this structured data MAY be given to the board as text)
5. viewer.html (NiiVue via CDN) → volume + meshes, per-structure toggle/opacity
→ cases/<case-id>/scene/ (open viewer.html in a browser)
```