---
title: "Spatial Transforms"
description: "The stored-data contract for registrations in vxData."
image: "https://docs.virdx.dev/img/virdx-social-card.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.virdx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spatial Transforms

A `SpatialTransform` stores a registration between `reference_fixed` and
`reference_moving`. It maps coordinates in the fixed resource to coordinates in the
moving resource, in millimetres.

- `matrix` holds a 4×4 affine as 16 row-major values. For deformable registrations,
  `path_nii_warp` points to a displacement field on the fixed grid, applied before
  the matrix.
- `parent_identifier` is the fixed resource; `derived_from` lists both resources.
- `generation_method`, `generation_version` and `generation_parameters` record how
  the registration was produced. Updates keep the resource's previous versions.

For slides, transforms use the catalog's `HistoScan.resolution` (µm per pixel,
[x, y]). Set it from image metadata before storing transforms and keep it unchanged
while those transforms refer to it.

See [vxreg](https://github.com/virdx/mono/blob/main/packages/vxreg/README.md) for
coordinate conventions, tool conversions, and examples of writing, chaining and
applying transforms.

Source: https://docs.virdx.dev/vxdata-api/explainers/spatial-transforms/index.mdx
