Skip to main content

Transform

Trait Transform 

Source
pub trait Transform<B, const D: usize>: Sized
where B: Backend,
{ // Required method fn transform_points(&self, points: Tensor<f32, B>) -> Tensor<f32, B>; // Provided method fn inverse(&self) -> Option<Self> { ... } }
Expand description

Transform trait for spatial coordinate transformations.

Maps points from one physical space to another. All transforms must implement this trait to be used in registration. Trainability is a separate concern, so pure and trainable transforms can implement the same spatial contract.

§Type Parameters

  • B - The Coeus compute backend
  • D - The spatial dimensionality (2 or 3)

Required Methods§

Source

fn transform_points(&self, points: Tensor<f32, B>) -> Tensor<f32, B>

Apply transform to a batch of points.

§Arguments
  • points - Tensor of shape [Batch, D] containing the input points
§Returns

Tensor of shape [Batch, D] containing the transformed points

Provided Methods§

Source

fn inverse(&self) -> Option<Self>

Get the inverse transform (if available).

Not all transforms are easily invertible, so this returns an Option. The return type uses Option<Self> (not Option<Box<dyn ...>>) because only one concrete transform type is invertible to itself.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§