navigate.tools.linear_algebra.affine_shear
- navigate.tools.linear_algebra.affine_shear(dz, dy, dx, dimension='YZ', angle=0)
Calculate the general 3D affine transform for shear.
Returns a shear matrix for a shear about the x, y, and z axes.
Affine Transform for shear has the following form:
[1 hxy hxz, 0, hyx 1 hyz, 0, hzx hzy 1, 0, 0, 0, 0, 1]
- Parameters:
dz (float) – Voxel size in Z.
dy (float) – Voxel size in Y.
dx (float) – Voxel size in X.
dimension (str, optional) – The dimension to shear in. Options are “XY”, “XZ”, and “YZ”.
angle (float, optional) – The angle to shear in degrees.
- Returns:
shear_transform – A 4x4 affine transformation matrix.
- Return type:
numpy.ndarray