Computational Cardiology · geometry laboratory

Landmarks, correspondence, and ambient flow

Compare two planar curves, decide which differences count, then move the whole coordinate grid. A small landmark mismatch and a valid ambient deformation answer different mathematical questions.

Model contract. These are original analytic curves, in millimetres. The exact smooth flow preserves orientation. Its finite RK4 approximation is checked at sampled points and two time steps; those diagnostics do not certify global numerical injectivity. This laboratory computes neither a geodesic nor an elastic distance.

1. Choose the comparison

Each selected curve is resampled at equal polygonal arclength, preserving its initial point and traversal. Changing the count resamples the current edited polygons; reset restores the analytic dataset.

Rotation and normalization act about the displayed origin. With centering off, they depend on the coordinate origin. Normalization removes size and changes the comparison unit to dimensionless. Reflections are never fitted.

dRMS(X,Y) = √[(1/N) Σj ‖xj − yj‖²]

This is a metric on fixed paired arrays. Alignment changes which differences are removed; cyclic shift and reversal change the correspondence. It is not an intrinsic elastic metric on unparametrized curves.

2. Edit the raw landmarks

The interactive editor appears when JavaScript runs.Use the PDF notes and downloadable Python companion otherwise.

On a narrow screen, scroll this diagram horizontally. Drag only a landmark handle; the coordinate fields below offer the same edits.

SourceTarget

Drag a handle, or focus it and use arrow keys (0.25 mm; Shift: 2.5 mm). The coordinate fields provide the same edit without dragging. Coordinates are bounded to ±30 mm. Editing updates the fit after release.

3. Compare a displacement map with its flow

The fitted field

u(x) = Σ wj φ(‖x−xj‖/ℓ), with φ(r) = (1−r)+4(4r+1). The linear solve enforces u(xj) = yj−xj.

Coordinate interpolation

Ft(x)=x+t u(x). Landmarks follow straight segments and reach their paired target at t=1. The ambient map can fold.

Stationary ambient flow

dΦt/dt=u(Φt), Φ0=id. It integrates velocity at the current position, so its endpoint generally differs from the target.

Preparing the laboratory. If this message remains, use the PDF notes and Python companion below.

0.000

Time is a dimensionless deformation parameter, not physiological time. Scrubbing selects a stored RK4 state. There is no autoplay; reduced-motion preference is respected.

Coordinate map Ft

Integrated flow Φt

Initial source · dottedTarget · dashedMoving curve · solid

On a narrow screen, scroll either plot horizontally to retain readable axis labels.

Paired RMS after chosen alignment—mm
Coordinate-map endpoint mismatch—t=1 · fit residual only
Flow endpoint mismatch—t=1 · not an endpoint optimizer
Sampled numerical diagnostics
DiagnosticValueInterpretation

Jacobian samples cover displayed grid nodes, curve samples, and landmarks. Positive values there cannot rule out a fold between samples. Polygon crossing counts concern the sampled drawing; a zero count does not establish smooth-curve injectivity. A flow preserves an existing self-intersection rather than repairing it.

Guided experiments

  1. Pose and units. Select “Pose only.” Predict the raw RMS, then toggle centering and rotation separately. Which number should vanish when both are enabled? Turn off centering and explain why rotation about the coordinate origin is a different problem.
  2. Size versus shape. Select “Size change.” Predict dRMS from the source RMS radius and scale factor 1.25. Then enable normalization and explain the change of units. State a scientific question for which removing size would discard useful information.
  3. Correspondence can destroy an interpolation. Select the half-turn preset and scrub to t=0.5. Compare landmark-polygon area, minimum sampled determinant, and endpoint mismatch. Explain why the exact flow cannot collapse distinct landmarks to one point in finite time.
  4. Numerical evidence. Change the support radius with source and target fixed. Compare the fit residual, flow endpoint mismatch, and refinement gap. Identify which quantity measures correspondence, which measures endpoint matching, and which tests the ODE computation.
  5. Finite versus continuous shape. Compare 8, 16, and 32 landmarks after reset. Explain why equal arclength is not anatomical correspondence and why landmark refinement alone does not prove segmentation accuracy.

For derivations and additional exercises, read the full mathematical notes. The representation slides and shape-comparison slides supply the lecture context.

Reproduce and extend

Python companion · Curated curve dataset · JavaScript numerical core · LaTeX notes source · Run instructions

Place companion.py and curves.json together. With NumPy installed, run python companion.py --out results.json. To replay a downloaded edit, add --experiment shape-experiment.json. The same alignment, kernel, RK4 and Jacobian equations are used in the browser core. No MATLAB-equivalence claim is made.

Mathematical assumptions and scholarly context

The compact-support kernel is from Holger Wendland, “Piecewise polynomial, positive definite and compactly supported radial functions of minimal degree” (1995), DOI. The distinction between a displacement map and an integrated diffeomorphic flow is developed in Beg, Miller, Trouvé and Younes (2005). This laboratory uses a fixed stationary field; it does not solve their variational registration problem.

Ahmad et al. (2025) study 3D surface morphology using a second-order Sobolev metric, relaxed matching and varifold endpoint discrepancy. That is a different mathematical model from the paired planar RMS and ambient field here. No research figures or patient data are included.