Skip to main content

myoL3

Automated L3-level trunk-muscle analysis from CT. Give it a full-body CT; it localizes the L3 level and crops to it, segments the trunk muscles, strips interior fat, and quantifies per-muscle, per-side body composition.

Hugging Face | GitHub


Pipeline

full-body CT  ->  L3 localizer (presence-gated sliding window)  ->  z-crop
              ->  muscle segmentation (nnU-Net, in-Python)       ->  raw labels
              ->  strip interior fat (IMAT)                       ->  TOTAL muscle seg
              ->  per-muscle / per-side composition metrics       ->  JSON

Muscles: psoas, quadratus lumborum, erector spinae / multifidus. The muscle/low-attenuation split is a per-scan, per-muscle GMM crossover; interior fat (HU < −30) is removed to form the total-muscle segmentation.


Installation

Install PyTorch first (pytorch.org), then:

pip install myoL3

Download the model weights (localizer + segmenter, once only):

myol3-install /path/to/models/dir

On shared HPC clusters, point at existing files instead:

export MYOL3_LOCALIZER_CKPT=/shared/models/myol3/l3_localizer.pt
export MYOL3_SEGMENTER_CKPT=/shared/models/myol3/muscle_seg.pth

Usage

# full pipeline -> total muscle seg + composition map + metrics JSON
myol3 -i fullbody_ct.nii.gz -o total_muscle_seg.nii.gz \
      --save-comp composition.nii.gz --save-metrics metrics.json

# localize + crop only (no segmentation model needed)
myol3 -i fullbody_ct.nii.gz --save-crop l3_crop.nii.gz
Flag Description
-i, --input full-body CT (.nii / .nii.gz) — required
-o, --output total muscle segmentation (interior fat stripped); omit to only localize/crop
--save-crop also write the L3-cropped CT
--save-comp also write the 4-compartment map (muscle*10 + compartment)
--save-metrics also write per-muscle / per-side metrics (.json)
--localizer-ckpt / --segmenter-ckpt checkpoint overrides
--pad extra slices each side of the L3 crop
--device cpu | cuda (auto if unset)

Python API:

import myol3
myol3.run("fullbody_ct.nii.gz", "total_muscle_seg.nii.gz",
          save_comp="composition.nii.gz", save_metrics="metrics.json")

Metrics

Per muscle × side (L/R), in mm² (mean, median, std, n_slices):

  • muscle_csa — total-muscle cross-sectional area (edge-outlier trimmed)
  • fat_pv_muscle_csa — low-attenuation ("fat partial-volume") muscle
  • intramuscular_fat_csa — solidly-fat interior (IMAT)
  • outer_edge_pv_fat_csa — partial-volume boundary rim

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myol3-0.1.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

myol3-0.1.1-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file myol3-0.1.1.tar.gz.

File metadata

  • Download URL: myol3-0.1.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.5

File hashes

Hashes for myol3-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2cc1c2ae13d26278fc2d1dc484d1782474c717e081a80b004a6814d53be93fc9
MD5 1473357f459e01f0ba359b628c04afd6
BLAKE2b-256 38c9879acf9bdb8368d9f8efdc18baa1aa8c90a1b7b7ecd9a5eae185bb46b757

See more details on using hashes here.

File details

Details for the file myol3-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: myol3-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.5

File hashes

Hashes for myol3-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06039c67f34936a5602a39f46d2dc24d9cfd93bdb5c531d519734ea007567583
MD5 3e0caf8dfcda300e22cf00beae59a718
BLAKE2b-256 9c12d37facaae14a1f65e99552819235ceee29b3a469e4b6bcdc318a4e95fc98

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page