https://github.com/azazellochg/3dem-conventions
Conventions for 3DEM software packages
https://github.com/azazellochg/3dem-conventions
conventions conversion cryo-em euler-angles
Last synced: 7 months ago
JSON representation
Conventions for 3DEM software packages
- Host: GitHub
- URL: https://github.com/azazellochg/3dem-conventions
- Owner: azazellochg
- License: gpl-3.0
- Created: 2015-04-22T09:29:32.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-02-22T11:36:47.000Z (over 4 years ago)
- Last Synced: 2025-02-02T03:23:57.396Z (over 1 year ago)
- Topics: conventions, conversion, cryo-em, euler-angles
- Language: Python
- Size: 57.6 KB
- Stars: 19
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
3DEM-conventions
################
Here you can find a description of standard 3DEM conventions (as proposed by
`Heymann et al. JSB 151(2), 2005, p. 196-207 `_
with `corrections `_)
and conventions used by popular software packages if different.
.. contents:: Content
:depth: 3
3DEM standard conventions
=========================
Coordinate and rotation convention
----------------------------------
Coordinate convention is right-handed Cartesian coordinate system.
Display convention is for x-axis to increase from left to right, y-axis to increase from bottom to top,
and z-axis to increase from back to front (pointing at viewer) as shown:
.. image:: https://cloud.githubusercontent.com/assets/6952870/7271722/ab97fcf6-e8e5-11e4-8ff6-c23e85810ea9.jpg
:width: 200px
.. image:: https://cloud.githubusercontent.com/assets/6952870/7271801/46dda0a8-e8e6-11e4-8a2d-b2441cf5af78.png
:width: 400px
A positive rotation is defined as clockwise for the object.
A positive rotation is defined as anti-clockwise for the coordinate system when viewed with
the axis of rotation pointing at the viewer. For example, a rotation from the x-axis to the
y-axis (about the z-axis) is positive. Note that the object will rotate clockwise when the
coordinate system rotates anti-clockwise.
Euler angles
------------
Traditionally in EM the direction of propagation of the electron beam is thought to coincide
with z axis, which in addition uniquely specifies xy as the plane in which the data is collected.
Thus, it is convenient to express the rotations with respect to the z axis.
By using a ZYZ convention (rotation around the z axis, followed by a rotation around y, and
another around z), one benefits from the fact that the description bears a simple relation
to the description of a point on a sphere; that is to say, we can think of the decomposition
as the description of a point on the sphere (the first two Eulerian angles YZ) and a final
in-plane rotation (the final Z-Eulerian angle). We denote three respective Euler angles as
phi (φ), theta (θ), psi (ψ) and the corresponding rotation in matrix notation as a product of three matrices:
**RZ(ψ) RY(θ) RZ(φ)**
Euler angles are three successive axial rotations:
#) phi, a rotation about the z-axis;
#) theta, a rotation about the y'-axis; and
#) psi, a rotation about the z''-axis.
Rotations of coordinate system (anti-clockwise):
.. image:: https://cloud.githubusercontent.com/assets/6952870/7271849/a9c70b28-e8e6-11e4-852c-52cfd4a8cd6a.jpg
:width: 300px
Recall that it is the matrix at the rightmost end that is applied first. So one might write a
3DEM rotation as (φ, θ, ψ), where φ is applied first, θ second and ψ lastly.
Projection direction
--------------------
Based on definition of Euler angles above, it is easy to see that first two Eulerian angles
(φ, θ) define projection direction, while ψ defines rotation of projection in-plane of projection.
Thus, as far as projections are concerned ψ is a trivial angle, as its change does not change
the 'information content' of the projection.
Degeneracy of Euler angles
--------------------------
The range of possible Eulerian angles for an asymmetric structure is 0≤φ≤360, 0≤θ≤180, 0≤ψ≤360).
However, for each projection whose direction is (φ, θ, ψ) there exists a projection that is
related to it by an in-plane mirror operation along x-axis and whose direction is (180+φ, 180-θ, -ψ).
Note the projection direction of the mirrored projection is also in the same range of
Eulerian angles as all angles are given modulo 360 degrees (i.e., if say φ > 360, then φ = φ - 360,
also if φ < 0, then φ = φ + 360.
Conversion between packages
===========================
Euler angles conversion
-----------------------
Relion <-> FReAlign
.. image:: https://user-images.githubusercontent.com/6952870/47355821-4da94480-d6ba-11e8-92f2-796a5c8432f3.png
:width: 250px
CTF parameters conversion
-------------------------
* `CTFFIND3 to IMAGIC `_
.. code-block:: bash
DEFOCUS1=DFMID1
DEFOCUS2=DFMID2
DEFANGLE=90-ANGAST
* CTFFIND3 to SPIDER (now CTFFIND3 is `available `_ from inside SPIDER)
.. code-block:: bash
defocus = (DFMID1 + DFMID2)/2;
astig = (DFMID2 - DFMID1);
angle_astig = ANGAST - 45;
if (astig < 0) {
astig = -astig;
angle_astig = angle_astig + 90;
}
* Relion to EMAN2 (use e2reliontoeman.py)
.. code-block:: bash
defocus=(rlnDefocusU+rlnDefocusV)/20000.0
dfang=rlnDefocusAngle
dfdiff=(rlnDefocusU-rlnDefocusV)/10000.0
* EMAN2 to Relion
See `e2refinetorelion2d `_ and
`e2refinetorelion3d `_
* SPIDER to FReAlign
.. code-block:: bash
df1 = spider.defocus - spider.magastig/2
df2 = spider.defocus + spider.magastig/2
angast = spider.angast + 45
Coordinate conversion
---------------------
* `EMAN1/2 boxer to XMIPP 2.4 Mark `_
* `SPIDER Web to XMIPP 2.4 `_
File format conversion
----------------------
* `e2proc2d `_ / `e2proc3d `_
* `em2em `_
* `dm3 to other formats `_
* `Various IMOD commands `_
* `relion_convert_to_tiff `_
References
==========
* `3DEM conventions `_
* `Few info about Euler angles `_
* `The Transform Class in SPARX and EMAN2 `_
* `Transform Python class in EMAN2 `_
* `Convert Euler angles for projections `_
* https://github.com/alisterburt/eulerangles