Skip to content

Add the validated MedSAM2-Anatomy model to psi and hpsp studies#1

Open
jagh wants to merge 6 commits into
mainfrom
test
Open

Add the validated MedSAM2-Anatomy model to psi and hpsp studies#1
jagh wants to merge 6 commits into
mainfrom
test

Conversation

@jagh

@jagh jagh commented Apr 20, 2026

Copy link
Copy Markdown
Member

No description provided.

jagh added 6 commits March 19, 2026 09:55
- Add download_checkpoints.py/sh to pre-download all model checkpoints for offline/portable deployment across machines and cloud
- Add volume mounts in docker-compose.yml for persistent checkpoints and HF cache (avoids re-downloading on every container restart)
- Make MedGemma loading optional via ENABLE_MEDGEMMA env var to support GPUs with less than 35GB VRAM- Read HF_TOKEN from environment instead of hardcoded empty string
- Fix DICOM SEG export being disabled for non-reconstructable series by relaxing the is Reconstructable check in PanelSegmentation
- Add .env.example, .gitattributes, and update .gitignore- Update start.sh with pre-flight checkpoint validation
- Relax isReconstructable constraint from required to optional in all 7 hanging protocol presets (MPR, 3D four up, 3D main, 3D only, 3D primary, Axial Primary, MPR + 3D Volume)
- Add isPreset and icon to mprAnd3DVolumeViewport so it appears in the layout selector Advanced menu
- Rename mprAnd3DVolumeViewport display name from 'mpr' to 'MPR + 3D' for clarity
- Allow CT series with variable slice spacing to use MPR and 3D volume rendering layouts
- Add medsam2-anatomy Python package (TotalSegmentator priors + MedSAM2)
- Add frontend UI: model selector, modality/CT-window dropdowns, anatomy text input
- Add backend bridge (medsam2_anatomy_infer.py) and dispatch in basic_infer.py
- Add entrypoint.sh for TotalSegmentator model pre-download and nnUNet env setup
- Update Dockerfile to install medsam2-anatomy package
- Update docker-compose.yml with TotalSegmentator cache volume mount
- Update start.sh to create checkpoint directories on host
- Fix flipped flag encoding (bool vs string) for correct Z-axis slice mapping
…d enforce full-mode mask prompts:

- Add smart regional scan detection (Z-extent < 500mm) to skip doomed ROI-subset cropping on partial-body volumes, saving ~20-40s per request
- Keep ROI-subset with automatic fallback for full-body scans
- Enforce ts_fast=False default in medsam2_anatomy_infer.py for full-resolution 1.5mm TotalSegmentator
- Add detailed per-slice and majority-vote logging for MedSAM2 segmentation diagnostics
- Clean up temp directories after reading TS prior masks
@jagh jagh self-assigned this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant