Warp engine (warp/)

Headless manual warp correction used by the WarpDrive plugin. The package imports neither Qt nor VTK — the Qt shell drives a WarpSession; numerics live here.

Modules

Module

Role

session.py

WarpSession — correction set, grid, rebuild field on demand

corrections.py

Point-set of source/target displacements

rbf.py

Solve / evaluate radial basis functions

field.py

Dense DeformationField (displacement + affine)

apply.py

Apply a field to volumes

io.py

Persist fields / sessions

modifiable.py

Editable field helpers

The correction field is always rebuilt from the full active point set (no incremental accumulation). That keeps undo/edit trivial: drop a point, re-solve.

Critical path: apply a warp

WarpDrive widget
      │  edit points / undo
      ▼
WarpSession ──solve_weights──► rbf
      │
      │  evaluate_on_grid
      ▼
DeformationField
      │
      │  apply.py
      ▼
warped volume / overlay ──► viewer layers

Quality assurance

  • Golden tests: tests/test_warp_compose_golden.py

  • Helper script: scripts/warp_golden.py

  • Plugin shell (discovery, capture, teardown): tests/test_warp_plugin.py

See also