{
  "file": "field.f32",
  "dtype": "float32, little-endian",
  "shape": [
    144,
    37,
    42,
    3
  ],
  "layout": "C order [nz][ny][nx][3]: node (k, j, i) = (z, y, x index); the last axis is the displacement (dx, dy, dz)",
  "origin_xyz": [
    931.0000,
    655.0000,
    1568.3900
  ],
  "spacing": 104.0000,
  "node_position": "node (k, j, i) sits at fixed level-0 voxel (x, y, z) = origin_xyz + spacing * (i, j, k)",
  "frame": "fixed volume 20250521151225-8.640um-1.2m-116keV-masked, level-0 voxels, x y z",
  "units": "fixed level-0 voxels",
  "interpolation": "trilinear between nodes; outside the grid the edge nodes are used (clamped)",
  "max_abs_displacement": 30.9513,
  "direction": "D is defined on the fixed grid and pulls back to the moving scan: for a fixed point p, the moving point is m = T^-1 (p + D(p)), T = transform.json transformation_matrix (moving -> fixed)",
  "compose": {
    "fixed_to_moving": "m = T^-1 (p + D(p))",
    "moving_to_fixed": "p = T(m) - D(p): iterate p_0 = T(m), p_{k+1} = T(m) - D(p_k) (|grad D| << 1: converges in a few steps)",
    "affine_only": "p ~ T(m); error up to max_abs_displacement"
  },
  "worked_example": {
    "fixed_p": [
      3185.50,
      1246.50,
      2023.55
    ],
    "D(p)": [
      8.049514796955009,
      20.642723064121128,
      -8.879761658848565
    ],
    "p + D(p)": [
      3193.549514796955,
      1267.1427230641211,
      2014.6702383411514
    ],
    "moving_m": [
      9107.2252,
      15197.0406,
      6313.7901
    ],
    "check": "T(moving_m) = p + D(p); ufsm reg map reg.json x,y,z gives moving_m, ufsm reg map reg.json --f2c mx,my,mz gives p back"
  },
  "tool": "ufsm reg map reg.json [--f2c] x,y,z (github.com/SuperOptimizer/ufsm, src/reg.h)"
}
