def swap_affine(axes):
""" Build a correction matrix, from the given orientation of axes to RAS.
Parameters
----------
axes: str (manadtory)
the given orientation of the axes.
Returns
-------
rotation: array (4, 4)
the correction matrix.
"""
rotation = numpy.eye(4)
rotation[:3, 0] = CORRECTION_MATRIX_COLUMNS[axes[0]]
rotation[:3, 1] = CORRECTION_MATRIX_COLUMNS[axes[1]]
rotation[:3, 2] = CORRECTION_MATRIX_COLUMNS[axes[2]]
return rotation
评论列表
文章目录