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.0.tar.gz (16.1 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.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: myol3-0.1.0.tar.gz
  • Upload date:
  • Size: 16.1 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.0.tar.gz
Algorithm Hash digest
SHA256 085e9757820ba52cc02af3e8e62ffaf81398a126ac8632f8137c9621d1230eb5
MD5 5106da9d81240d93252feea4e05641ce
BLAKE2b-256 bc122d9d8253d6374ebd4965dbe8cab980db497d42f62cd0dcbef6970ee17689

See more details on using hashes here.

File details

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

File metadata

  • Download URL: myol3-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc381d2a8b4cada5c493f88f3aa1acdddd3f006de6cc4d68c24f1e32f800e996
MD5 4fccf9f67ccb63c5c9b6a5f5d7a727c8
BLAKE2b-256 b2224aa975b586869abcc0921340da90b6113ef9ef98c993a28045076f3ac05e

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

0.1.1

2 files

This release

0.1.0 This release

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