Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

ribline: Numbered 3D Rib Centerlines from Thoracic CT

Coronal MIPs of SCR case pet_ct_bc_eh_Anonymous_0004 showing thoracic CT, Pass-1 random-forest probability map, hybrid SCF plus U-Net fusion, and dilated ground-truth rib centerlines (Quan Wang, arXiv:2610.16047, Fig. 3 panels a, b, e, f)

Unfolded rib views, fracture screening and surgical navigation all need every rib traced and numbered as R01 to R12 and L01 to L12. Quan Wang posted arXiv:2610.16047 on 12 October 2026 with ribline, a three-stage pipeline that builds a lung-apex and vertebral-midline coordinate frame, detects rib voxels with a hybrid Semantic Context Forest plus 3D U-Net, then labels the curves with bilateral Viterbi matching and RibSnake refinement. On the Siemens Corporate Research (SCR) 2 mm thoracic CT rib centerline benchmark it reports a labeled Chamfer distance of 2.05 mm and 97.2% labeling accuracy on the 12 evaluation scans. Code is on GitHub under MIT, the package is on PyPI as ribline v0.3.0, and four pretrained model repos sit in a Hugging Face collection.

What goes in and what comes out

The input is a thoracic CT volume. The SCR data used for the numbers is resampled to 2 mm isotropic voxels (typical size about 155 x 142 x 165). The library also accepts NIfTI and MetaImage volumes through SimpleITK. About half of the SCR scans store signed Hounsfield units and half store unsigned shifted values; the forests and Stage 3 run a small HU standardisation step, while the U-Net sees a per-volume z-score of the raw stored intensities.

The output is up to 24 labeled 3D centerline curves, one per rib index on each side (R01 to R12, L01 to L12), after fragment consolidation, bilateral labeling and normal-plane centering. A DICOM viewer can use those curves for curved planar reformation of the rib cage, for lesion localisation relative to a numbered rib, and as the topological backbone of automated rib-fracture detection.

How it works

Stage 1 builds a thoracic coordinate frame from the lung apex and the vertebral midline, then a kyphosis-aware azimuthal angle that orders points along each rib from posterior to anterior.

Stage 2 is the voxel detector. An anatomically anchored Semantic Context Forest (150 trees, depth 24, 286 features, including canonical coordinates and multi-scale differential features) is max-fused with a plain three-level 3D U-Net (16 to 32 to 64 channels, GroupNorm, about 340k parameters). The fusion rule is Phyb(x) = max(PUNet(x), 0.75 PSCF(x)). The SCF is stronger on the short apical first ribs; the U-Net is cleaner on intermediate shafts. A lighter Pass-1 random forest is the baseline shown in the featured image.

Stage 3 turns the probability map into numbered curves. It masks bone, skeletonises, chains fragments, then runs a patient-scaled bilateral Viterbi dynamic program that couples the two hemithoraces. Template recovery fills missing terminal ribs when the contralateral partner supports it, and RibSnake recenters each curve in successive normal planes and smooths with a B-spline.

What the numbers say

On the 12 evaluation scans with the fixed ground truth (286 ribs), the full hybrid pipeline reaches labeled Chamfer distance (LCD) 2.05 +/- 0.48 mm, labeled clDice 0.886 at 3 mm and 0.945 at 4 mm, labeling accuracy 97.2% (278/286), and zero false-positive curves (Table 1). Hybrid with full Stage 3 beats SCF-only (LCD 2.88 mm, Acc 95.1%) and U-Net-only (LCD 3.40 mm, Acc 92.0%) in that ablation.

The 12-scan numbers are optimistic for Stage 3. The author states that the roughly 60 Stage-3 constants were tuned with access to the evaluation scans, while the detectors and atlas were fitted on the 47 training scans only. With the released detectors and Stage-3 constants frozen on the 47 annotated training scans (1,116 ribs), LCD is 2.63 +/- 1.91 mm and AccA is 95.4% (Table 2).

The stricter check is 5-fold cross-validation over all 59 annotated scans (1,402 ribs), detectors and atlas re-fitted per fold, Stage-3 constants frozen: LCD 3.64 mm (median 2.39 mm), AccA 91.8% (Table 3). Hybrid still beats SCF-only and U-Net-only there. First ribs remain the harder group (AccF 82.9% in CV; AccF 91.7% on the 12-scan split).

What the pictures show

The featured image is cut from Fig. 3 of the paper, coronal MIPs for scan pet_ct_bc_eh_Anonymous_0004. Left to right: the thoracic CT MIP, the Pass-1 random-forest probability map, the hybrid SCF + U-Net fusion, and the dilated ground-truth centerlines. Pass-1 lights up ribs but leaves a noisy purple background. Hybrid shows thick yellow shafts with less clutter between them. The ground-truth panel is the dilated reference the metrics compare against. Panels (c) SCF and (d) U-Net from the same figure are discussed in the text and skipped in the banner to keep the INPUT / BEFORE / AFTER / REFERENCE layout readable at blog size.

Where it falls short

Everything is SCR-only and 2 mm. Sixty scans from a single source, resampled to 2 mm isotropic, with no acquisition metadata for subgroup analysis. There is no multi-vendor or clinical deployment study, and paediatric or heavily pathological anatomy is untested.

The 12-scan evaluation split is the alphabetical tail of the file list, not a random draw. Stage-3 constants were tuned with evaluation access, so the headline 2.05 mm / 97.2% numbers should be read as in-sample for those constants. The author discloses this and publishes the frozen-constant 47-scan and 5-fold CV numbers above.

Annotation noise is real. One evaluation file (RIB_007) had two ribs merged under R07; the released fix_gt_annotations script splits it into R07 and R08 (the only file changed). Twelfth ribs are annotated inconsistently across the set. Missing or truncated first and twelfth ribs, and partial traces that stop at costal-cartilage gaps, are the main residual failures. Possible patient overlap between one training and one evaluation case cannot be ruled out from the anonymised names.

Code, weights, and data

The library is github.com/wq2012/ribline, MIT License, PyPI package ribline at v0.3.0 (checked 14 October 2026). Install with pip install ribline, or with the optional torch extra for the U-Net path. CLI entry points cover ground-truth repair, atlas building, ablation runs and evaluation. Unit tests and GitHub Actions CI ship with the repo.

Pretrained checkpoints live in the Hugging Face collection wq2012/ribline: the full hybrid suite, anatomical SCF alone (CPU-friendly), 3D U-Net alone, and a Pass-2 auto-context SCF baseline. Files include the Pass-1 and anatomical forests, rib_unet_3d.pth (epoch 20, the checkpoint that produced the published probability maps), the 24-rib atlas, and JSON benchmark reports for the 12-scan, 47-scan and 5-fold experiments.

Imaging data does not ship with the package. The SCR Analyze-style volumes and centerline spreadsheets are the supported benchmark; NIfTI and MetaImage work through SimpleITK for your own volumes.

How we would wire it into a viewer

We would run ribline as a server-side job that writes a derived series of overlay objects, never the original pixels. Read the thoracic CT, resample or confirm spacing, run the hybrid detector and Stage 3, then store each labeled centerline as a set of 3D polyline graphics (or a thin ribbon segmentation) tagged with the rib index R01 to R12 / L01 to L12. In the viewer those curves drive an unfolded rib layout, a click-to-number tooltip, and a side-by-side compare against the source MIP. A failed or low-confidence rib (especially first and twelfth) should stay visually distinct so a reader can correct it.

The public weights were trained on SCR 2 mm data, so we would re-fit or fine-tune Stage 2 on our own sites’ annotated centerlines before trusting the numbering in production, and we would keep Stage-3 constants under a site-specific config rather than treating the released numbers as universal. Before shipping we would time the full pipeline on our matrix size, check first-rib and twelfth-rib failure rates, and have a reader flip through unfolded views against the source. For related work on this site, see our posts on liver MRI masks under scanner shift and prompt-free 3D MRI organ boxes.

Sources

We build custom medical imaging platforms — advanced DICOM viewers, AI segmentation, and the clinical systems around them.

Get in Touch

Copyright © 2026 PYCAD. All Rights Reserved.