Skip to content

Instantly share code, notes, and snippets.

@alisterburt
Created August 8, 2022 14:58
Show Gist options
  • Select an option

  • Save alisterburt/706cbdff00e7011064dbf09589bbe972 to your computer and use it in GitHub Desktop.

Select an option

Save alisterburt/706cbdff00e7011064dbf09589bbe972 to your computer and use it in GitHub Desktop.
ribosome tilt-series simulation
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@inter1965

inter1965 commented Aug 24, 2022

Copy link
Copy Markdown

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...

  • transformations are the (4, 4) projection matrices which related 3D position to 2D position in tilt-image
  • model_orientations is 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment