Repository navigation
Spine Contour v1.4.0
Spine Contour 1.4.0
A level no longer has to be all of its points or none. When only part of a vertebra is on the film, such as C7 with its
inferior endplate hidden by the shoulders, the annotator places the points that are there, finishes the level with
FINISH, and the app measures what that gives. The points that are missing can be placed later, or an endplate removed;
the label record carries the level with null corners where the points are not on the film.
Placing only some of a level's points
- A vertebral body, C3–C7 and L1–L5, may be finished with one endplate: SA and SP, or IA and IP. C2 may be finished
with its inferior pair or its centroid alone. T1, S1, T4 and the femoral heads are unchanged. - While a body or C2 is being placed, the edit bar shows FINISH right after FIT (the bar reads FIT, FINISH, UNDO,
CANCEL, RESET TO PREDICTION, DONE). It is enabled once an endplate, or C2's pair or centroid, is whole and no part is
half set; its title isFinish with the points placed; the rest are not on this film. A level with one corner of a
pair cannot finish: place the other corner, or UNDO. A level with every point set still finishes by itself. - The level reads Manual (Edited, when the model had placed it) and Place… is still offered. On the film it draws as
its endplate line, with the model's whole body dashed beneath it if the other endplate was removed; C2 draws as its
line, its centroid dot, or both. - The measurements follow from the points: with C7's superior endplate alone, C2–C7 SVA and C6–C7 segmental lordosis
read, and C2–C7 Cobb, C6–C7 disc angulation and C7–S1 SVA show —. With C2's centroid alone SVA reads and Cobb and
C2–C3 show —. With L1's inferior endplate alone the L1–S1 lumbar lordosis and L1PA show —, L1–L2 disc angulation
reads, and L2–S1 onward read. - A result from the model with one endplate, which the cervical segmentation can return, now reads Segmented and draws
as its line, where it read Not placed and drew nothing. - The edit bar's help line box is narrower, so a long help line wraps inside its box instead of the bar taking a second
row, in every edit-bar state.
C7's centroid
- C7 stays a vertebral body and gains an optional third part, its centroid, like C2's. The four corner clicks still
finish C7 by themselves; the centroid is a fifth chip, CENTROID, hollow until placed, and the bar reads
PLACING C7 · n OF 5. Place it during the placement by choosing its chip, or later by clicking the hollow chip or
the row's Place…. FINISH accepts a centroid alone, and Delete on the focused CENTROID removes it. A whole C7
without its centroid counts as partial, so its row offers Place…, which resumes at the centroid step. - On a full-spine film the C7–S1 SVA plumb reads from the placed centroid, else from the mean of C7's four corners,
else shows —, so it reads even when C7 is partial. The model's own C7 centroid is never read back as a placed point. - The label record's
levels.C7carriescentroidandmodel_centroid(a point or null) and listscentroidin
edited_points, under the same schema id; a record saved before this reads with the centroid null.
T1 slope and T4 pelvic angle
- A T1 superior endplate and a T4 centroid placed by hand are now kept with the film and drawn outside edit mode (T1 as
a line in its colour, T4 as a cross in its), on every region. They reach the study ast1_superiorandt4_centroid,
and an older study without them reads unchanged. - Two measurements read from them, both computed by the backend and shown as stored. T4 pelvic angle (T4PA) is L1PA's
construction with the T4 centroid: the angle at the hip axis between the lines to the T4 centroid and to the S1
superior endplate midpoint, unsigned, 0 to 180 degrees, on lumbar and full-spine films. T1 slope is the acute
angle between the T1 endplate line and the image horizontal, unsigned, 0 to 90 degrees, on cervical and full-spine
films. The Measurements panel gains T4 PELVIC ANGLE after L1 PELVIC ANGLE and T1 SLOPE after C2–C7 SVA, each
selecting its construction on the stage; the Parameters grid gains a T4PA and a T1 slope column; the CSV and
the paired export gainT4PAandT1 slope (deg). - A value is a dash (an empty cell in the CSV) whenever an input is missing: T4PA without the T4 centroid, a head or S1;
T1 slope without the T1 endplate, or with its two points identical; either on a film outside its family. Unchecking
T1 or T4 names the measurement that goes to a dash. No model places T1 or T4, so a prediction never produces either
value. A T1 or T4 an older record holds (placed before 1.4.0, when they never reached the study) lands on the study
at the first Edit, which clears the Reviewed mark like any re-measure. A point hidden, saved and reopened is not kept
(the record holds it not visible), so it is placed again.
Completing and removing an endplate
- The chips of a placed body or C2 list every point of its kind, the missing ones with a hollow dot. Clicking a hollow
chip, or the row's Place…, resumes the placement for that endplate: the bar readsPLACING C7 · 3 OF 4, the
placed points are filled in, and the next clicks complete the level. UNDO reaches only the new clicks; CANCEL or
Escape leaves the level as it was. - Delete or Backspace with a point of a body or C2 focused removes that point's endplate (C2's centroid, its
centroid), committed through the measure queue like a drag. It is refused for the level's last part (CLEAR it or
uncheck it) and for T1, S1, T4 and the heads, and does nothing while a level is being placed, while the window /
level panel is open or while the study's run is in flight. - Outside edit mode a click on a lumbar body's endplate line selects it only for a body with no quadrilateral.
The label record
cornersof a body and of C2 are nullable by endplate:iaandipare null for a C7 placed from its superior
endplate,saandspnull together for one placed from its inferior; C2'scornersis null with acentroid, or
the reverse. At least one part is present and every key is written;model_cornershas the same shape.edited_pointsof a manual entry lists the keys it holds a point for (["sa", "sp"]), of an edited entry the keys
that differ from the model's, a removed endplate's included. A C2 placed from its centroid alone writes only
c2_centroidinto the projection and is left out ofvertebrae.- The schema id is unchanged,
spinecontour.segmentation-label/1, with a dated amendment (2026-10-21).
A second example,label-record.partial.example.json, is a cervical film with
C7's superior endplate alone and C2's centroid alone. - The backend's lumbar validator (
POST /measure) accepts a body with one endplate, so a lumbar or full-spine film
with a partial body measures instead of failing with a 422.
Fixes
- A level hidden in the editor now stays hidden on the stage. Entering edit mode and Save edits re-apply the levels the
editor holds hidden or unplaced to the stored geometry when they disagree, for example after a re-measure that
failed, and the reverse: a level the record holds placed and visible that the study lacks, such as a T1 or T4 placed
before 1.4.0, lands on the first Edit. Like any other re-measure, this clears the film's Reviewed mark. - The mask overlay outside edit mode no longer colours a level the study no longer holds, so an unchecked level stops
looking segmented. - A femoral head cut off at the film's edge no longer blocks every edit of a full-spine film. The editor fits such a
head to a centre beyond the edge, and the full-spine measure path refused any femoral centre outside the image, so
the whole measure failed and nothing hand-placed on that film could land (the lumbar path never had that rule). A
centre now needs finite values only on both paths; the anchors and the vertebral points stay bounded.
Verification
1,252 desktop tests (1,161 in 1.3.1; ninety-one across the level model, the projection and store validator, the
handles, the canvas, plates and hit test, the record, the wiring, the C7 centroid, the measure queue, the rows and
columns and the CSV exports). The levels smoke suite, smoke-levels (phase dom), read 195/195 on a fresh scratch
profile with synthetic films (154 in 1.3.1). Its section 22 holds 21 checks, 16 for the partial endplates (one pins the
Delete suffix on a whole C7's chips) and 5 for the C7 centroid; section 23, the heal, holds 5 (uncheck, Save edits, a
simulated lost /measure, Edit healing it and dropping the Reviewed mark, no unsaved change on entry, DONE without a
prompt); section 24 holds 13 for the T1 slope and the T4 pelvic angle (both heads, T1 and T4 placed by hand on the
full-spine film; the study gaining t1_superior and t4_centroid and finite T1S and T4PA, T1S equal to 11.31
degrees for the placed line; the panel's two rows reading a number outside edit mode; unchecking T4 naming T4PA,
clearing the field and the value and turning the row to a dash; checking it again in the same session returning them;
placing it again after a save; DONE and a reopen keeping both fields; an editor reading them back; the reverse heal), and section 11's T1
toggle check now reads t1_superior null on the study after the commit. smoke-seeding read 36/36 and
smoke-parameters 58/58 with the new export columns. The viewer's overlay cache behind the mask filter has no automated
coverage; its effect is checked by eye at the gate. The partial-endplate checks: a C2 placed from its centroid and
FINISH, a C7 placed from SA and SP with FINISH disabled after one corner and enabled after two, the row reading Manual
with Place… still offered, the chips SA SP filled and IA IP hollow, the study measured as cervical with C2–C7 SVA
finite and Cobb null, the record with null corners and edited_points ["sa", "sp"] and ["centroid"] validating
against the amended schema, Edit again reading it back, the hollow IA chip resuming at 3 OF 4 and two clicks
completing C7 with Cobb still null, Delete on the focused SA removing the superior endplate and nulling SVA, and a
second Delete refused. The centroid checks: the hollow CENTROID chip and one click placing it with C7 still partial,
Place… S1 turning the film full spine with GLOBAL_SVA_PX read from the placed centroid, Save edits writing
levels.C7.centroid with edited_points listing it, and Edit again reading it back. The backend unit suite, pytest backend/tests/unit, read 657 passed and 2 skipped (the new thoracic_measurements file holds the T1 slope and the T4
pelvic angle: values against hand-computed angles, T4PA equal to L1PA when the T4 centroid is L1's centre, every null
case, a malformed value rejected; the global-SVA file gains a femoral centre beyond the film's edge; the
partial-measurements file has 147 tests, 139 before: a body with its superior endplate alone keeps its lordosis, one
with its inferior alone gives none and a partial L1 no L1PA, five rejected shapes, and a full-spine film passing a
partial lumbar body through).
Known limitation: the levels dom suite hung intermittently on the development laptop, twice in five runs, once after
section 18 and once after section 16, both around waits that depend on the backend. It never reproduced on demand and
every fresh relaunch passed (169/169 before the C7 centroid, 176/176 with it, 182/182 before the T1 slope, 195/195 on
the final tree). The suite bounds each call into the page at 90 s and carries a dom-phase watchdog (120 s without an
answer from the page fails the run, cleans up and exits); run it as a bounded PowerShell job (Start-Job with Wait-Job -Timeout 420). The other suites and the models are unchanged from 1.3.1 and were not re-run. These are software checks,
not clinical validation. The release workflow builds and tests the Windows and macOS installers before publication;
merging the release PR to main publishes v1.4.0.
Compatibility
The label record keeps its schema id: a record saved before 1.4.0 validates and reads unchanged, and a 1.4.0 record
with a partial level read by a 1.3.x build shows that level as Not placed, nothing else changing. A study whose
geometry holds a partial lumbar body is shown unsegmented, with a console warning, by a 1.3.x build, which is a
degradation and not a corruption. The installer carries the backend with the relaxed lumbar validator. There is no
store version bump, and the bundles are unchanged. A study may now carry geometry.t1_superior and
geometry.t4_centroid and the measurements T1S and T4PA; a 1.3.x build ignores the two fields and the two
measurements (its validator does not check unknown keys; a lumbar film's next commit drops them (its backend rebuilds the geometry from known keys), a cervical or full-spine film's carries them along unread). The CSV exports gain two
columns, T4PA after L1PA and T1 slope (deg) in the cervical group, so a script reading the columns by position
must move; a script reading them by name is unaffected. The macOS build remains unsigned.
Source: 62f88ccc100896eeb0b1d37b38d68a3da9df385c on main.