Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about world2vox method #3

Open
fzpr opened this issue Jul 10, 2021 · 1 comment
Open

about world2vox method #3

fzpr opened this issue Jul 10, 2021 · 1 comment

Comments

@fzpr
Copy link

fzpr commented Jul 10, 2021

Hello Dr.mirsky.
I have a problem in world2vox method and this line

world_coord = np.dot(np.linalg.inv(np.dot(orientation, np.diag(spacing))), world_coord - origin)

orientation value is [1. 0. 0. 0. 1. 0.] and spacing value is in format [z , y , x] which after np.diag that value is

[[z 0 0]
 [0 y 0]
 [0 0 x]]

so in np.dot(orientation, np.diag(spacing)) we cannot calculate np.dot because orientation and spacing cannot be multiplied and then throw exception with this message:
ValueError: shapes (6,) and (3,3) not aligned: 6 (dim 0) != 3 (dim 0)
Can you help me about this?

@ymirsky
Copy link
Owner

ymirsky commented Jul 11, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants