brain_deer.warp.corrections

The correction data model: control points and sets of them.

A correction is one source -> target correspondence with a radius and an include flag. Slicer’s WarpDrive smuggled the radius into each markup’s description string and the group name into its label because MRML gave it nowhere else to put them; here they are just fields.

The set is the authoritative, replayable state of a refinement session – the dense field is always rebuilt from it, never edited in place. Everything is in RAS millimetres (see brain_deer.warp); the LPS conversion for on-disk Slicer markups lives in brain_deer.warp.io.

Classes

ControlPoint

One source -> target correspondence, in RAS mm.

CorrectionSet

An ordered collection of control points.

Module Contents

class brain_deer.warp.corrections.ControlPoint

One source -> target correspondence, in RAS mm.

class brain_deer.warp.corrections.CorrectionSet

An ordered collection of control points.

remove(index: int) → ControlPoint

Drop the point at index and return it.

update(index: int, *, selected: bool | None = None, radius: float | None = None, name: str | None = None) → ControlPoint

Replace mutable fields of the point at index (frozen dataclass).

active() → list[ControlPoint]

Only the points that are switched on – the ones the solver sees.

with_all_hardened() → CorrectionSet

A copy where every point is a fixed anchor (source == target).

This is what “harden” does: once a correction is baked into the warp, the content already sits at the target, so on reload the point should hold it there rather than move it again.