# MouseSeg > Open-source 3D murine micro-CT and cone-beam CT (CBCT) segmentation of 10 mouse organs at risk, subcutaneous xenograft tumors, and cradle-stripped body masks in under 10 seconds on standard CPUs and web browsers without GPUs. - Web application (local WebAssembly inference, zero scan uploads): https://mouseseg.joeyschulz.com/ - Source code, Python CLI, training scripts, and ONNX weights: https://github.com/wizrads/MouseSeg - Paper: Schulz JB, Haasch C, Kwon O, Bednarz BP. *MouseSeg: Open Source 3D Mouse Organ and Tumor CT Segmentation in Under 10 Seconds Without GPUs*. arXiv:2611.35548 (2026). https://doi.org/10.48550/arXiv.2611.35548 - License: Creative Commons Attribution-NonCommercial 4.0 International (`CC BY-NC 4.0`, preclinical and academic research use only). ## Overview and Capabilities MouseSeg provides automated 3D contouring of preclinical mouse computed tomography (`micro-CT` and low-dose flat-panel `CBCT`) scans in NIfTI format (`.nii` and `.nii.gz`) for preclinical radiotherapy treatment planning, Monte Carlo radiation dosimetry, radiopharmaceutical dosimetry, and longitudinal tumor volume tracking. Unlike GPU-bound 3D SwinUNETR or nnU-Net pipelines requiring hundreds of megabytes of weights and PyTorch/CUDA, MouseSeg uses knowledge-distilled, INT8-quantized 3D residual networks under 1 MB that execute identically in Python (`onnxruntime` on CPU) and in the browser (`onnxruntime-web` WebAssembly SIMD). Automated preprocessing handles heterogeneous preclinical CT exports without manual intervention: - Repairs broken unit `sform` NIfTI headers from `qform` voxel spacing and standardizes scans to canonical prone right-anterior-superior (`RAS`) orientation. - Detects `-400 HU` workstation air-clipping artifacts and restores exterior air to `-1000 HU` before `0.20 mm` isotropic resampling. - Strips stationary plastic and high-density composite animal imaging cradles prior to cropping and dose-ready mouse `Body` mask generation. - Shifts soft-tissue Hounsfield units (`HU`) smoothly toward `+45 HU` to tolerate uncalibrated CBCT drift. - Upsamples soft-tissue organ, tumor, and body masks onto the native input NIfTI voxel grid with 3D binomial and trilinear smoothing while preserving thin `Bone` and `Trachea` structures at native sharpness. ## Segmented Structures and NIfTI Label IDs MouseSeg outputs an integer `uint8` NIfTI label map aligned voxel-for-voxel with the input CT scan: 1. `1`: Urinary bladder 2. `2`: Lung (aerated and consolidated fibrotic parenchyma) 3. `3`: Heart 4. `4`: Liver 5. `5`: Intestine 6. `6`: Kidney 7. `7`: Spleen 8. `8`: Stomach 9. `9`: Trachea 10. `10`: Bone (skeleton) 11. `12`: Subcutaneous tumor An optional binary `uint8` cradle-stripped mouse `Body` mask (`--body-mask` in CLI; `Body (.nii.gz)` in browser) and per-structure volume (`mm^3`, `cm^3`) and mean `HU` table (`.csv`) are also produced. Two inference modes are included: `10 Organs + Tumor` (unified dual-window 3D network: `526,947` parameters, `0.96 MB` INT8 / `2.03 MB` FP32) and `Tumor Only` (3D tumor specialist: `522,012` parameters, `0.94 MB` INT8 / `2.01 MB` FP32). ## Usage ### Browser Web Application (Zero Installation, Zero Uploads) Open https://mouseseg.joeyschulz.com/ in any modern desktop or mobile browser, drag and drop a `.nii` or `.nii.gz` mouse CT scan (or click `Load Sample`), select `10 Organs + Tumor` or `Tumor Only`, and click `Run`. Inference runs 100% locally on the user's CPU via WebAssembly SIMD (`~4-9 s` on desktop CPUs); no scan bytes ever leave the device. Export `Masks (.nii.gz)`, `Body (.nii.gz)`, or `Volumes (.csv)` directly from the top bar. ### Python Command-Line Interface (Pure CPU, No PyTorch Required) ```bash git clone https://github.com/wizrads/MouseSeg.git && cd MouseSeg pip install -r requirements.txt # Single scan (10 organs + subcutaneous tumor + cradle-stripped body mask + CSV) python segment_mouse.py -i scan.nii.gz -o scan_mask.nii.gz --body-mask scan_body.nii.gz --csv scan_volumes.csv # Subcutaneous tumor specialist only python segment_mouse.py -i scan.nii.gz -o tumor_mask.nii.gz --mode tumor_only # Batch directory processing python segment_mouse.py -i /path/to/ct_folder/ -o /path/to/output_masks/ --body-mask --csv /path/to/output_masks/cohort_volumes.csv --threads 4 ``` Runtime inference dependencies are `numpy`, `scipy`, `nibabel`, and `onnxruntime` (CPU). Optional scanner fine-tuning (`3-20` labeled scans) and custom 3D U-Net training from scratch are supported via `pip install -r requirements-train.txt` with `python finetune.py` and `python train.py`. ## Benchmark Performance (181 Unseen Test CT Scans) - **Held-out public test set (`n = 124` scans from Rosenhain et al. and Jensen et al.)**: - Unified 3D network: `0.8366` mean 10-organ Dice (exceeding `0.6868` human interobserver 10-organ Dice), `0.8522` mean subcutaneous tumor Dice (`0.9260` median Dice, `1.27 mm` mean HD95, `0.9761` Lin concordance correlation), `97.1%` tumor sensitivity, and `100%` healthy control specificity in `9.30 s` mean desktop CPU runtime (`1.56 s` on Apple M3). - 3D Tumor Specialist: `0.8519` mean tumor Dice (`0.9268` median Dice, `1.18 mm` mean HD95) in `5.90 s` mean desktop CPU runtime. - **External institutional validation (`n = 57` scans, University of Wisconsin-Madison)**: - High-resolution `0.08 mm` micro-CT (`n = 9` scans across 4T1, EBC1, and CHLA20 models) and serial `1 mA` low-dose flat-panel CBCT (`n = 48` non-contrast scans from `12` mice): `100%` tumor detection with zero isolated false-positive islands (`0.8481` mean / `0.9102` median tumor Dice on `1 mA` CBCT). ## Citation Schulz JB, Haasch C, Kwon O, Bednarz BP. MouseSeg: Open Source 3D Mouse Organ and Tumor CT Segmentation in Under 10 Seconds Without GPUs. arXiv:2611.35548 (2026). https://doi.org/10.48550/arXiv.2611.35548 ```bibtex @article{schulz2026mouseseg, title = {{MouseSeg}: Open Source 3D Mouse Organ and Tumor {CT} Segmentation in Under 10 Seconds Without {GPUs}}, author = {Schulz, Joseph B. and Haasch, Campbell and Kwon, Ohyun and Bednarz, Bryan P.}, journal = {arXiv preprint arXiv:2611.35548}, year = {2026}, eprint = {2611.35548}, archivePrefix = {arXiv}, primaryClass = {eess.IV}, doi = {10.48550/arXiv.2611.35548}, url = {https://arxiv.org/abs/2611.35548}, note = {Code: https://github.com/wizrads/MouseSeg. Web application: https://mouseseg.joeyschulz.com} } ```