image.registration.matrix.compute_rank(mat)[source]

Compute the rank of a matrix

image.registration.matrix.identity(target_res=None, source_res=None)[source]
image.registration.matrix.inverse_matrix(numpy_matrix)[source]
image.registration.matrix.matrix_real2voxels(matrix, target_res, source_res)[source]

Converts a transform matrix (M) expressed in real coordinates (a transform from space_r to space_r) into a matrix M' from space_1 to space_2 where space_s is the voxel space from which M comes from and space_t the one where it will end, and space_r is the real common space.

Parameters:
  • matrix : a 4x4 numpy.array.
  • target_res : a 3-uple of unit vectors for the space_2 (eg: (1.,2.,1)
  • source_res : a 3-uple of unit vectors for the space_1 (eg: (2.,1.,3)
Returns:
  • The matrix in "voxel" coordinates (M' mapping space_1 to space_2 ,

instead of space_r to space_r).

image.registration.matrix.matrix_voxels2real(matrix, target_res, source_res)[source]

Converts a transform matrix (M') expressed in voxel coordinates (from space_s to space_t) into a matrix M from space_r to space_r where space_s is the voxel space from which M' comes from and space_t the one where it will end, and space_r is the real common space.

Parameters:
  • matrix : a 4x4 numpy.array.
  • target_res : a 3-uple of unit vectors for the space_t (eg: (1.,2.,1)
  • source_res : a 3-uple of unit vectors for the space_s (eg: (2.,1.,3)
Returns:
  • The matrix in "real" coordinates (M mapping space_r to space_r ,

instead of space_r to space_r).

image.registration.matrix.numpy_4x4_mat_to_c_array(numpy_matrix)[source]
image.registration.matrix.read_matrix(filename)[source]

Reads 4x4 matrices either written by numpy or Baladin matrices

This Page