GithubHelp home page GithubHelp logo

Broken vector depiction. about blik HOT 7 CLOSED

brisvag avatar brisvag commented on June 10, 2024
Broken vector depiction.

from blik.

Comments (7)

brisvag avatar brisvag commented on June 10, 2024

Apparently this is a general problem, not realted to stacking only.

from blik.

alisterburt avatar alisterburt commented on June 10, 2024

I'm bashing my head against the wall on this one, very frustrating
I ran the following to test outside of peepingtom and it seems like the matrices calculated aren't correct
This goes against the observation that we get correct reconstructions from both dynamo and relion with these eulers

import napari
import numpy as np
import starfile
from eulerangles import euler2matrix

star = starfile.read('example_data/HIV_15apx.star')

# get dataframes individually
dfs = [df for name, df in star.groupby('rlnMicrographName')]

# get first dataframe
df0 = dfs[0]

# get xyz
xyz = df0[['rlnCoordinateX', 'rlnCoordinateY', 'rlnCoordinateZ']].to_numpy()

# get euler angles
eulers = df0[['rlnAngleRot', 'rlnAngleTilt', 'rlnAnglePsi']].to_numpy()

# get rotation matrices
matrices = euler2matrix(eulers, axes='zyz', intrinsic=True, positive_ccw=True)

# Apply rotation matrices on unit vector in z
rotated_unit_z = matrices @ np.array([0, 0, 1]).reshape(3, 1)

# add rotated unit z to xyz for depiction
xyz_z_shifted = xyz + rotated_unit_z.reshape(-1, 3) * 5

# visualise
viewer = napari.Viewer()
with napari.gui_qt():
    viewer.add_points(xyz, face_color='blue', size=5)
    viewer.add_points(xyz_z_shifted, face_color='orange', size=5)

image

from blik.

alisterburt avatar alisterburt commented on June 10, 2024

Inverting the matrix gives the correct depiction but this goes against my understanding of the RELION euler angle convention
image

from blik.

alisterburt avatar alisterburt commented on June 10, 2024

Understood and on it, will PR to #34 with tidier versions of the fixes

from blik.

alisterburt avatar alisterburt commented on June 10, 2024

HIV_vis

from blik.

alisterburt avatar alisterburt commented on June 10, 2024

🎉 🎉 🎉

from blik.

brisvag avatar brisvag commented on June 10, 2024

Closed by #34.

from blik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.