Expand description
Backend-independent composite transform serialization.
§Design
The Transform<B, D> trait is generic over a Coeus
tensor backend B, which makes direct serialization of live transform objects
backend-dependent. This module provides a parameter-only representation
(TransformDescription) that captures each supported transform type as plain
f64 vectors, and a composite container (CompositeTransform) that holds
an ordered sequence of such descriptions.
Both types derive serde::Serialize and serde::Deserialize, enabling
round-trip JSON persistence that is independent of any particular Coeus backend.
§Supported transform types
| Variant | Parameters |
|---|---|
Translation | offset vector [D] |
Rigid | rotation matrix D×D (row-major) + translation [D] |
Affine | homogeneous matrix (D+1)×(D+1) (row-major) |
DisplacementField | grid dims, origin, spacing, per-component displacement |
BSpline | grid dims, origin, spacing, per-component ctrl-pt displ. |
§Composition order
Transforms are applied left-to-right (first-to-last):
a point p is mapped through T[0], then T[1], … , then T[n-1].
Mathematically this corresponds to T_{n-1} ∘ … ∘ T_1 ∘ T_0.
§Dependencies
This module requires serde_json = "1.0" in [dependencies] of
crates/ritk-core/Cargo.toml. The crate already depends on serde.
Structs§
- Composite
Transform - Ordered composite transform: applied first-to-last.
Enums§
- Transform
Description - Backend-independent description of a single transform’s parameters.