-
-
Save alisterburt/706cbdff00e7011064dbf09589bbe972 to your computer and use it in GitHub Desktop.
something like below? looks like the transpose of the rotation matrix inside the affine transformation matrix.
inverse_transformations = transformations.copy()
for no in range(transformations.shape[0]):
inverse_transformations[no, :3, [2, 0]] = transformations[no, :3, [0, 2]]
inverse_transformations[no, [2, 0], :3] = inverse_transformations[no, [0, 2], :3]
No, rlnTomoProjXYZW are fine, you would need to exchange columns 1 and 3 in the rotation matrices for the particles then exchange rows 1 and 3
I don't think so, here is some guidance...
transformationsare the (4, 4) projection matrices which related 3D position to 2D position in tilt-imagemodel_orientationsis a stack of (3, 3) rotation matrices which rotate the model (ribosome Ca coordinates) around its center
The problem is that I didn't need to keep track of the orientations carefully, I just wrote them out into the file for compatibility. To be sure they are correct you need to track what these matrices are transforming (xyz column vectors? zyx column vectors?) and how that data is placed into 3D/2D (axes of images are ordered zyx, slowest to fastest in memory)
All of these must be consistent and the conversion from rotation matrix to euler angles must follow the RELION convention for your experiment to produce the result you expect :) be careful, active rotation of coordinates is the inverse of the rotation of the coordinates of the fourier slice which is what relion does internally with its euler angles
Thanks for the explanation, hence it should be something below,
inverse_model_orientations = model_orientations.copy()
inverse_model_orientations[:, :, :, [2, 0]] = model_orientations[:, :, :, [0, 2]]
inverse_model_orientations[:, :, [2, 0], :] = inverse_model_orientations[:, :, [0, 2], :]
I don't think so, here is some guidance...
transformationsare the (4, 4) projection matrices which related 3D position to 2D position in tilt-imagemodel_orientationsis a stack of (3, 3) rotation matrices which rotate the model (ribosome Ca coordinates) around its centerThe problem is that I didn't need to keep track of the orientations carefully, I just wrote them out into the file for compatibility. To be sure they are correct you need to track what these matrices are transforming (xyz column vectors? zyx column vectors?) and how that data is placed into 3D/2D (axes of images are ordered zyx, slowest to fastest in memory)
All of these must be consistent and the conversion from rotation matrix to euler angles must follow the RELION convention for your experiment to produce the result you expect :) be careful, active rotation of coordinates is the inverse of the rotation of the coordinates of the fourier slice which is what relion does internally with its euler angles
No, rlnTomoProjXYZW are fine, you would need to exchange columns 1 and 3 in the rotation matrices for the particles then exchange rows 1 and 3