Table Of Contents

Previous topic

core.reference.slices

Next topic

io.datasource

This Page

core.transforms.affines

Module: core.transforms.affines

Functions working on affine transformation matrices.

Functions

nipy.core.transforms.affines.from_matrix_vector(matrix, vector)

Combine a matrix and vector into a homogeneous transform.

Combine a rotation matrix and translation vector into a transform in homogeneous coordinates.

Parameters:

matrix : ndarray

An NxN array representing the rotation matrix.

vector : ndarray

A 1xN array representing the translation.

Returns:

xform : ndarray

An N+1xN+1 transform matrix.

See also

to_matrix_vector

nipy.core.transforms.affines.to_matrix_vector(transform)

Split a transform into it’s matrix and vector components.

The tranformation must be represented in homogeneous coordinates and is split into it’s rotation matrix and translation vector components.

Parameters:

transform : ndarray

Transform matrix in homogeneous coordinates. Example, a 4x4 transform representing rotations and translations in 3 dimensions.

Returns:

matrix, vector : ndarray

The matrix and vector components of the transform matrix. For an NxN transform, matrix will be N-1xN-1 and vector will be 1xN-1.