{"id":16610006,"url":"https://github.com/azazellochg/3dem-conventions","last_synced_at":"2025-10-29T17:30:45.528Z","repository":{"id":30824130,"uuid":"34381457","full_name":"azazellochg/3DEM-conventions","owner":"azazellochg","description":"Conventions for 3DEM software packages","archived":false,"fork":false,"pushed_at":"2022-02-22T11:36:47.000Z","size":59,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T03:23:57.396Z","etag":null,"topics":["conventions","conversion","cryo-em","euler-angles"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"auchter/haaska","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azazellochg.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-22T09:29:32.000Z","updated_at":"2024-05-10T05:48:53.000Z","dependencies_parsed_at":"2022-08-24T14:20:37.652Z","dependency_job_id":null,"html_url":"https://github.com/azazellochg/3DEM-conventions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azazellochg%2F3DEM-conventions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azazellochg%2F3DEM-conventions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azazellochg%2F3DEM-conventions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azazellochg%2F3DEM-conventions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azazellochg","download_url":"https://codeload.github.com/azazellochg/3DEM-conventions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238856067,"owners_count":19542139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conventions","conversion","cryo-em","euler-angles"],"created_at":"2024-10-12T01:29:24.235Z","updated_at":"2025-10-29T17:30:45.174Z","avatar_url":"https://github.com/azazellochg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"3DEM-conventions\n################\n\nHere you can find a description of standard 3DEM conventions (as proposed by\n`Heymann et al. JSB 151(2), 2005, p. 196-207 \u003chttp://dx.doi.org/10.1016/j.jsb.2005.06.001\u003e`_\nwith `corrections \u003chttp://dx.doi.org/10.1016/j.jsb.2005.11.012\u003e`_)\nand conventions used by popular software packages if different.\n\n.. contents:: Content\n    :depth: 3\n\n3DEM standard conventions\n=========================\n\nCoordinate and rotation convention\n----------------------------------\n\nCoordinate convention is right-handed Cartesian coordinate system. \nDisplay convention is for x-axis to increase from left to right, y-axis to increase from bottom to top, \nand z-axis to increase from back to front (pointing at viewer) as shown:\n\n .. image:: https://cloud.githubusercontent.com/assets/6952870/7271722/ab97fcf6-e8e5-11e4-8ff6-c23e85810ea9.jpg\n    :width: 200px\n\n .. image:: https://cloud.githubusercontent.com/assets/6952870/7271801/46dda0a8-e8e6-11e4-8a2d-b2441cf5af78.png\n    :width: 400px\n\nA positive rotation is defined as clockwise for the object.\nA positive rotation is defined as anti-clockwise for the coordinate system when viewed with \nthe axis of rotation pointing at the viewer. For example, a rotation from the x-axis to the\ny-axis (about the z-axis) is positive. Note that the object will rotate clockwise when the \ncoordinate system rotates anti-clockwise.\n\nEuler angles\n------------\n\nTraditionally in EM the direction of propagation of the electron beam is thought to coincide \nwith z axis, which in addition uniquely specifies xy as the plane in which the data is collected. \nThus, it is convenient to express the rotations with respect to the z axis. \nBy using a ZYZ convention (rotation around the z axis, followed by a rotation around y, and \nanother around z), one benefits from the fact that the description bears a simple relation \nto the description of a point on a sphere; that is to say, we can think of the decomposition \nas the description of a point on the sphere (the first two Eulerian angles YZ) and a final \nin-plane rotation (the final Z-Eulerian angle). We denote three respective Euler angles as \nphi (φ), theta (θ), psi (ψ) and the corresponding rotation in matrix notation as a product of three matrices:\n\n**RZ(ψ) RY(θ) RZ(φ)**\n\nEuler angles are three successive axial rotations: \n\n#) phi, a rotation about the z-axis;\n#) theta, a rotation about the y'-axis; and\n#) psi, a rotation about the z''-axis.\n\nRotations of coordinate system (anti-clockwise):\n\n .. image:: https://cloud.githubusercontent.com/assets/6952870/7271849/a9c70b28-e8e6-11e4-852c-52cfd4a8cd6a.jpg\n    :width: 300px\n\nRecall that it is the matrix at the rightmost end that is applied first. So one might write a\n3DEM rotation as (φ, θ, ψ), where φ is applied first, θ second and ψ lastly.\n\nProjection direction\n--------------------\n\nBased on definition of Euler angles above, it is easy to see that first two Eulerian angles\n(φ, θ) define projection direction, while ψ defines rotation of projection in-plane of projection. \nThus, as far as projections are concerned ψ is a trivial angle, as its change does not change \nthe 'information content' of the projection.\n\nDegeneracy of Euler angles\n--------------------------\n\nThe range of possible Eulerian angles for an asymmetric structure is 0≤φ≤360, 0≤θ≤180, 0≤ψ≤360). \nHowever, for each projection whose direction is (φ, θ, ψ) there exists a projection that is \nrelated to it by an in-plane mirror operation along x-axis and whose direction is (180+φ, 180-θ, -ψ). \nNote the projection direction of the mirrored projection is also in the same range of \nEulerian angles as all angles are given modulo 360 degrees (i.e., if say φ \u003e 360, then φ = φ - 360, \nalso if φ \u003c 0, then φ = φ + 360. \n\nConversion between packages\n===========================\n\nEuler angles conversion\n-----------------------\n\nRelion \u003c-\u003e FReAlign\n\n .. image:: https://user-images.githubusercontent.com/6952870/47355821-4da94480-d6ba-11e8-92f2-796a5c8432f3.png\n    :width: 250px\n\nCTF parameters conversion\n-------------------------\n\n* `CTFFIND3 to IMAGIC \u003chttps://grigoriefflab.umassmed.edu/forum/software/ctffind_ctftilt/ctf_correction\u003e`_\n\n.. code-block:: bash\n\n    DEFOCUS1=DFMID1\n    DEFOCUS2=DFMID2\n    DEFANGLE=90-ANGAST\n\n* CTFFIND3 to SPIDER (now CTFFIND3 is `available \u003chttps://spider.wadsworth.org/spider_doc/spider/docs/man/ctffind.html\u003e`_ from inside SPIDER)\n\n.. code-block:: bash\n\n    defocus = (DFMID1 + DFMID2)/2;\n    astig = (DFMID2 - DFMID1);\n    angle_astig = ANGAST - 45;\n    if (astig \u003c 0) {\n        astig = -astig;\n        angle_astig = angle_astig + 90;\n    }\n\n* Relion to EMAN2 (use e2reliontoeman.py)\n\n.. code-block:: bash\n\n    defocus=(rlnDefocusU+rlnDefocusV)/20000.0\n    dfang=rlnDefocusAngle\n    dfdiff=(rlnDefocusU-rlnDefocusV)/10000.0\n\n* EMAN2 to Relion\n\n    See `e2refinetorelion2d \u003chttps://blake.bcm.edu/emanwiki/EMAN2/Programs/e2refinetorelion2d\u003e`_ and\n    `e2refinetorelion3d \u003chttps://blake.bcm.edu/emanwiki/EMAN2/Programs/e2refinetorelion3d\u003e`_\n\n* SPIDER to FReAlign\n\n.. code-block:: bash\n\n    df1 = spider.defocus - spider.magastig/2\n    df2 = spider.defocus + spider.magastig/2\n    angast = spider.angast + 45\n\nCoordinate conversion\n---------------------\n\n* `EMAN1/2 boxer to XMIPP 2.4 Mark \u003chttp://web.archive.org/web/20130613235909/http://xmipp.cnb.csic.es/twiki/bin/view/Xmipp/BoxerToXmippMark\u003e`_\n* `SPIDER Web to XMIPP 2.4 \u003chttp://web.archive.org/web/20130715191432/http://xmipp.cnb.csic.es/twiki/bin/view/Xmipp/WebToXmippMark\u003e`_\n\nFile format conversion\n----------------------\n\n* `e2proc2d \u003chttp://blake.bcm.edu/emanwiki/EMAN2/Programs/e2proc2d\u003e`_ / `e2proc3d \u003chttp://blake.bcm.edu/emanwiki/EMAN2/Programs/e2proc3d\u003e`_\n* `em2em \u003chttps://www.imagescience.de/em2em.html\u003e`_\n* `dm3 to other formats \u003chttp://web.archive.org/web/20150711065905/http://sites.bio.indiana.edu/~cryo/conversionFromDm3.html\u003e`_\n* `Various IMOD commands \u003chttps://bio3d.colorado.edu/imod/doc/program_listing.html\u003e`_\n* `relion_convert_to_tiff \u003chttps://relion.readthedocs.io/en/latest/Reference/MovieCompression.html#relion-convert-to-tiff\u003e`_\n\nReferences\n==========\n\n* `3DEM conventions \u003chttps://www.emdataresource.org/conventions.html\u003e`_\n* `Few info about Euler angles \u003chttps://web.archive.org/web/20200214125323/http://sparx-em.org/sparxwiki/Euler_angles\u003e`_\n* `The Transform Class in SPARX and EMAN2 \u003chttp://www.sciencedirect.com/science/article/pii/S1047847706002024\u003e`_\n* `Transform Python class in EMAN2 \u003chttp://blake.bcm.edu/emanwiki/Eman2TransformInPython\u003e`_\n* `Convert Euler angles for projections \u003chttp://blake.bcm.edu/emanwiki/EMAN2/FAQ/SpiderEuler\u003e`_\n* https://github.com/alisterburt/eulerangles\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazazellochg%2F3dem-conventions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazazellochg%2F3dem-conventions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazazellochg%2F3dem-conventions/lists"}