spinecontour Research use only Guide Download

Guide · Editing

Editing segmentations

When the model misplaces a corner or misses a level, you can fix it on the film. The measurements update as you go, and saving writes a JSON label record for that film: the corrected annotation, ready to use for retraining the models. Added in version 1.1.0.

Entering edit mode

Open a study and click the pencil, Edit segmentation, in the toolbar above the film. The right panel becomes the Vertebral levels panel. Leave with Done, the pencil again, Escape or Back. If you have unsaved changes, you are asked to Save edits, Discard or Keep editing.

  • Re-running is paused while you edit. Run segmentation, Region and Orientation are disabled until you leave edit mode, because each would replace the levels you are editing.
  • Films with no result can be annotated too. A film that failed or was never segmented opens straight in edit mode, and every level can be placed by hand.

The levels panel

Sixteen levels in five groups: C2–C7, T1 and T4, L1–L5, the S1 endplate, and two femoral heads. Each row has a checkbox for whether the level is on the film, a badge showing its state, and Place… or Clear.

BadgeMeaningFor training
SegmentedThe model's result, unchanged.A confirmed label.
EditedThe model's result, moved by you.A label, plus the model's original to learn from its error.
ManualPlaced by you where the model found nothing.A label for a level the model missed.
Not placedChecked as visible, but nothing placed yet.Ignored. The film is incomplete.
Not visibleCheckbox off: you looked and the level is not on the film.Teaches the model the level is absent.

Not visible is not the same as not placed

Uncheck a level only when you have looked and it is genuinely not on the film. A level left Not placed tells the model nothing; one marked Not visible tells it the level is absent. The panel footer reads Training label · Complete once every level is either placed or marked not visible.

Levels start checked or unchecked to suit the film type: a lumbar film shows the lumbar, sacral and femoral head groups; a cervical film shows the cervical group and T1; a full-spine film shows all five. Unchecking a level notes which measurements it will leave blank.

Placing a level

Click Place… on the row, then click each point on the film. The bar above the film shows which point comes next, for example Placing L3 · 1 of 4.

LevelClicks
C3–C7, L1–L54 corners: superior-anterior, superior-posterior, inferior-anterior, inferior-posterior
C23: the two inferior corners, then the centre of the body
T1, S12: the anterior then posterior corner of the superior endplate
T41: the centre of the body
Femoral head2 to 4 points on the rim. Click Fit after two or three; a fourth finishes it
  • Any order. Click a step chip in the bar to choose which point the next click sets. Clicking a chip that is already placed, then the film, moves that point.
  • Undo removes the most recent point; Cancel abandons the placement.
  • Clear removes a level you placed by hand.

Adjusting what the model found

Select a level in the panel to show its handles, then drag a handle to move that point. When you select an edited level, the model's original is shown dashed beneath it for comparison. Measurements and the study are updated on every drag.

  • Arrow keys nudge the selected handle 1 pixel, or 10 with Shift. Tab steps through the handles.
  • Zoom to 800% for fine placement. Pan with the middle button, or by holding both buttons.
  • Discard returns to your last save. Reset to prediction returns every level to the model's output.

Window and level

The window/level button in the toolbar opens Width and Level sliders, in or out of edit mode. A right-button drag on the film does the same without the panel: left–right sets the width, up–down the level. Double right-click resets it. DICOM files open with their own window settings.

This is for viewing only. It changes no measurement and is never saved, either with the study or in the label record.

The label record

Each film gets one JSON file, named after the film: editing lateral_lumbar_001.dcm writes lateral_lumbar_001.label.json. It is written in two ways:

  • Save edits in edit mode, with or without changes. Saving with nothing changed records that you accept the model's result.
  • Mark reviewed on a film with no record yet. This saves the film as it stands, so an accepted prediction becomes a label without entering edit mode. It never overwrites an existing record, and unmarking deletes nothing.

The files are kept in a labels folder in SpineContour's data folder. On Windows, type %APPDATA%\spine-contour\labels into File Explorer's address bar. A record is deleted along with its study.

Each record holds:

  • The film: its file name, size, a SHA-256 hash of the image, the region and the view.
  • The model and app versions that produced it.
  • Every level's state and who set it (the model, you, or the film type), with its points in image pixels from the top left. Edited levels keep the model's original points too, and each level lists which of its points you changed.
  • A summary counting levels in each state, points moved and points placed, plus whether the label is complete.
"L2": {
  "state": "edited", "source": "annotator",
  "edited_points": ["ia", "ip"],
  "corners":       { "sa": [921, 718], "sp": [1301, 738], "ia": [900, 954], "ip": [1308, 981] },
  "model_corners": { "sa": [921, 718], "sp": [1301, 738], "ia": [909, 942], "ip": [1289, 962] }
}

The full format is described by the JSON schema, with a complete example record. Records hold coordinates and file names, not pixels, but a file name can identify a patient: follow the naming guide before sharing them.