-
-
Save alisterburt/706cbdff00e7011064dbf09589bbe972 to your computer and use it in GitHub Desktop.
Still something wrong.
Ah, you will need to invert the rotations then Sent from mobile - apologies for brevity
…
On 21 Aug 2022, at 13:42, Xhark @.> wrote: @. commented on this gist. The result of ReconstructParticleTomo doesn't resemble a ribosome structure. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
had a look - model_orientations is multiplying coordinates which are zyx not xyz, that's the source of the error
Does that mean rlnTomoProjX should be row 3 and rlnTomoProjZ should be row 1 of transformations?
had a look -
model_orientationsis multiplying coordinates which are zyx not xyz, that's the source of the error
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
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

Strange in what way?