I want to generate DRR from a CT image. I want the CT image to rotate in the order of the X, Y, Z axis. However, SetComputeZYX( ) only set the order ZYX/ZXY. How can I can set the order XYZ?
You could compose two transforms, one ZXY with z angle of zero, and the another with x and y angles of zero.
Thank you for your sincere reply! And I try to compose two transformations. However, the latter transform always works and the first transform seems to be not applied. I have found one of your replies before that may also be suitable for my question. Could you please introduce “computing internal data” in detail? “@pierrectl is trying to compose two
Euler3DTransform s, if I understood correctly. Those are two transformations in the global domain. Computing internal data (matrix, center, translation) is probably easier with versor than affine. ”
If you share your code, there is a chance of receiving more help.
What you are asking for is just a different way of specifying the rotation matrix from that supported by the ITK API. If you want the rotation order to be XYZ then you can compute the matrix yourself and then use the transforms
Computing the XYZ matrix is easy to do, Python code below (translating to other lanaguges is pretty much a copy paste and adding some semicolons if relevant):
import numpy as np ax = 0 ay = 0 az = np.deg2rad(90) cx = np.cos(ax) cy = np.cos(ay) cz = np.cos(az) sx = np.sin(ax) sy = np.sin(ay) sz = np.sin(az) rotation = np.ndarray([3, 3]) rotation = cz * cy rotation = cz * sy * sx - sz * cx rotation = cz * sy * cx + sz * sx rotation = sz * cy rotation = sz * sy * sx + cz * cx rotation = sz * sy * cx - cz * sx rotation = -sy rotation = cy * sx rotation = cy * cx
Thank you very much! I will try it!