# Alignment¶

class menpo.transform.base.alignment.Alignment(source, target)[source]

Bases: Targetable, Viewable

Mix-in for Transform that have been constructed from an optimisation aligning a source PointCloud to a target PointCloud.

This is naturally an extension of the Targetable interface - we just augment Targetable with the concept of a source, and related methods to construct alignments between a source and a target.

Note that to inherit from Alignment, you have to be a Transform subclass first.

Parameters: source (PointCloud) – A PointCloud that the alignment will be based from target (PointCloud) – A PointCloud that the alignment is targeted towards
aligned_source()[source]

The result of applying self to source

Type: PointCloud
alignment_error()[source]

The Frobenius Norm of the difference between the target and the aligned source.

Type: float
copy()

Generate an efficient copy of this object.

Note that Numpy arrays and other Copyable objects on self will be deeply copied. Dictionaries and sets will be shallow copied, and everything else will be assigned (no copy will be made).

Classes that store state other than numpy arrays and immutable types should overwrite this method to ensure all state is copied.

Returns: type(self) – A copy of this object
set_target(new_target)

Update this object so that it attempts to recreate the new_target.

Parameters: new_target (PointCloud) – The new target that this object should try and regenerate.
n_dims

The number of dimensions of the target.

Type: int
n_points

The number of points on the target.

Type: int
source

The source PointCloud that is used in the alignment.

The source is not mutable.

Type: PointCloud
target

The current PointCloud that this object produces.

To change the target, use set_target().

Type: PointCloud