Vertebral segmentation & alignment
Spinal alignment, measured automatically.
SpineContour is an open-source research application that measures cervical, lumbar and standing full-spine radiographs, detecting which it has been given. It reports seven externally validated sagittal parameters: C2–C7 Cobb angle, C2–C7 SVA, global SVA, lumbar lordosis, sacral slope, pelvic tilt and pelvic incidence. It also reports PI–LL mismatch, segmental angles and disc heights. The code, model weights and desktop application are free, and everything runs on your own workstation.
01 · What it does
Seven validated measurements
C2–C7 Cobb angle and SVA, global C7–S1 SVA, lumbar lordosis, sacral slope, pelvic tilt and pelvic incidence, tested against four independent readers. Also PI–LL mismatch, segmental lordosis, disc angulation and disc heights, and T1 slope and T4 pelvic angle once you place T1 or T4 by hand.
Review and correct on the film
Landmarks for C2–C7, L1–S1 and both femoral heads are drawn on the image. Drag a point or place a missed level by hand, and the measurements update as you go. Each corrected film saves a label record you can use to retrain the models.
Built for a whole library
Segment a folder in one batch, work through a review queue with the arrow keys, and mark films with flags of your own. Export measurements as CSV, one row per film or paired pre-op to follow-up, or as a bundle that carries films and annotations to another computer.
Your data never leaves your workstation
SpineContour runs entirely on the machine you install it on. Nothing is uploaded. Radiographs and clinical data are read from disk and stay there, and there is no mechanism in the application to send them anywhere: no upload, no cloud processing, no telemetry, no account.
- No upload path for images, measurements, or reports
- No account, login, or license server
- No analytics, telemetry, or crash reporting
- Clinical data is imported from a CSV file you choose
- Exports are written to a location you pick on disk
- Works with networking disabled
02 · Inside the app
03 · How it works
From radiograph to measurement.
A multistage pipeline of neural networks finds the anatomy, then the measurements are calculated geometrically from the landmarks. You can see every landmark on the film and move any of them before you export.
-
Step 1
Find the regions
The film is routed as cervical, lumbar or full spine and cropped to the cervical and lumbosacral regions. A Keypoint R-CNN locates the S1 superior endplate.
-
Step 2
Place landmarks
Two HRNet-W32 networks place 23 cervical landmarks (C2–C7) and 22 lumbar landmarks (L1–L5 and the S1 endplate) on the cropped regions.
-
Step 3
Fit the hips
A U-Net with a ResNet-34 encoder segments the femoral heads. Two circles fitted by least squares give the hip axis, at the midpoint of their centres.
-
Step 4
Measure
Seven parameters are calculated by established conventions, and the result is checked for consistency. Measurements that need a missing landmark are left blank, never guessed.
| Parameter | Measured as | Sign |
|---|---|---|
| C2–C7 Cobb angle | The angle between the inferior endplates of C2 and C7 | Positive is lordosis |
| C2–C7 SVA | Horizontal distance from a plumb line through the C2 body centroid to the posterosuperior corner of C7 | Positive when C2 lies anterior |
| Global SVA | Horizontal distance from a plumb line through the C7 body centroid to the posterosuperior corner of S1 | Positive when C7 lies anterior to the sacrum |
| Lumbar lordosis | The angle between the superior endplates of L1 and S1 | Positive is lordosis |
| Sacral slope | The S1 superior endplate's inclination to the horizontal | Positive when the anterior margin is higher |
| Pelvic tilt | The angle between the vertical and the line from the S1 endplate midpoint to the hip axis | Positive when the hip axis lies anterior to the S1 midpoint |
| Pelvic incidence | The angle between that line and the perpendicular to the S1 endplate | Checked against PI = PT + SS |
04 · Measurement accuracy
Externally validated against four readers.
The models were tested on 99 lateral full-spine radiographs from the Lateral Full-spine X-ray Image Dataset, a public collection from a different source than any training data and excluded entirely from model development. Four readers, a medical student, a clinical spine fellow and two radiologists, annotated every film independently, blinded to the model and to each other. Model settings were fixed before testing. For each measurement, the model's disagreement with the readers (AI–human mean absolute error) was compared with the readers' disagreement with each other (human–human MAE).
| Parameter | Films | AI–human | Human–human | ΔMAE (95% CI) |
|---|---|---|---|---|
| C2–C7 Cobb angle | 79 | 4.56° | 3.06° | +1.49° (0.55 to 2.47) |
| C2–C7 SVA | 77 | 1.43 mm | 1.31 mm | +0.12 mm (−0.14 to 0.44) |
| Global SVA | 77 | 2.70 mm | 2.34 mm | +0.36 mm (−0.03 to 0.77) |
| L1–S1 lordosis | 95 | 4.26° | 4.24° | +0.02° (−0.59 to 0.63) |
| Sacral slope | 95 | 3.41° | 3.53° | −0.12° (−0.59 to 0.34) |
| Pelvic tilt | 85 | 1.50° | 1.52° | −0.02° (−0.25 to 0.22) |
| Pelvic incidence | 89 | 3.80° | 3.55° | +0.25° (−0.34 to 0.88) |
ΔMAE is the AI–human error minus the human–human error on the same films, so a negative value means the model disagreed with the readers less than they disagreed with each other. Confidence intervals are from 10,000 bootstrap resamples of images. An interval that includes zero does not by itself establish that the two are equivalent. Films missing a landmark a measurement needs, such as an obscured C7, were not counted for that measurement.
The C2–C7 Cobb angle shows the clearest gap and is the main area for improvement. The four readers agreed closely with each other: ICC(A,1) ranged from 0.800 for pelvic incidence to 0.996 for global SVA. These results are for the pipeline evaluated in the methods paper. Later releases have changed parts of it, such as region detection in version 1.7.0, and each release's notes compare that version with the same four readers.
Not yet validated: L1 pelvic angle, T4 pelvic angle and T1 slope are reported by the app but have not been validated, because no reference dataset with these measurements is available to us yet. Segmental angles and disc heights were not part of the paper's evaluation. Treat all of these as exploratory.
05 · Open research
Not for diagnostic or clinical use.
SpineContour is an investigational research tool. Its measurements, segmentations, and derived metrics have not been cleared or approved by any regulatory body. All output requires independent verification by a qualified reviewer.
To our knowledge, no externally validated system for automated sagittal measurement on radiographs had released both its trained weights and its source code. SpineContour does, so that others can replicate its performance, test it on their own patients, and improve it. We invite other centers to use it in their research and to contribute annotations, so that accuracy can be established across sites.
We're committed to keeping SpineContour open source and free to use. Please contact spine-contour@gmail.com with questions or if you'd like to collaborate.
spine-contour: An Open-Source Platform for Automated Spine Segmentation and Spinopelvic Parameter Measurement (methods paper · forthcoming)
Open resources
- Source code and trained model weights The desktop application, the inference backend and its model weights, on GitHub.
- Desktop releases Every Windows and macOS build, with its release notes and checksums.
- Label record format The JSON schema for the annotations the app writes when you correct a film.
- Training and evaluation code, and the study's annotations Will be linked here when the methods paper is published.
SpineContour is released under the GNU Affero General Public License, version 3 or later. Anyone may use, modify and share it, provided that versions they distribute or offer online stay open source.
Datasets used in model development and testing
BUU-LSPINE
5,308 lateral lumbar radiographs from Burapha University Hospital, Thailand, with published vertebral endplate annotations.
VinDr-SpineXR
64 spine radiographs from two hospitals in Hanoi, Vietnam, with endplates and femoral heads annotated by hand for this study.
Merlin
52 digitally reconstructed radiographs rendered from abdominal CT at a United States academic center, chosen to show spinal instrumentation and vertebroplasty or kyphoplasty cement.
CSXA
Cervical Spine X-ray Atlas: 4,963 lateral cervical radiographs from Dongzhimen Hospital, Beijing, with annotated landmarks, used to train the cervical models.
PubMed Central
157 lateral full-spine, lumbar and cervical radiographs reproduced in permissively licensed open-access articles, annotated by a clinical spine fellow. 134 were suitable for training.
Lateral Full-spine X-ray Image Dataset
External test only
99 lateral full-spine radiographs, held out of development entirely and used only to measure accuracy.
06 · Get SpineContour
Download SpineContour.
Version 1.8.0. Builds are published on GitHub, each with its checksum, so the link here is always the current release.
Neither build is code-signed yet, so your machine will warn you the first time.
- Windows shows a blue "Windows protected your PC" screen. Choose More info, then Run anyway.
- macOS refuses to open an unidentified developer. Control-click the app and choose Open, or allow it under System Settings, Privacy & Security.
The macOS build is for Apple Silicon only. Intel Macs are not supported.
SHA-256 · v1.8.0
Spine-Contour-Windows.exe
1af17fb2f4c5d74887931e155220d21de14117d965e564e38d31670520fa78ff
Spine-Contour-macOS-arm64.dmg
e4a084ddadddc5a94546b79ff12d5747744b58344d76828fce52a1522bdd31e7
Check yours with
Get-FileHash .\Spine-Contour-Windows.exe in PowerShell, or
shasum -a 256 Spine-Contour-macOS-arm64.dmg in Terminal.