New coordinates after image rotation

Hi,
I'm trying to rotate a 3d image and to get the new coordinates of specific point after the rotation.
For instance, you can see the code below. I rotated the image, but how can I get the new coordinates of the point (20, 20, 20)?
What are the new coordinates (xR, yR, zR) which fRotated(xR, yR, zR) is equal to f(20, 20, 20)?
[x,y,z] = meshgrid(1:100, 1:100, 1:100);
f = x + y + z;
xslice = [1,50,100];
yslice = 100;
zslice = [1, 100];
figure;
slice(x, y, z, f, xslice, yslice, zslice)
colormap hsv
axis equal
angle = 30;
rotAx = [40 0 60];
fRotated = imrotate3(f, angle, rotAx);
val = f(20, 20, 20);
Thanks!

 採用された回答

Matt J
Matt J 2017 年 11 月 15 日

1 投票

You can obtain that using Syntax 3 of this FEX submission.

2 件のコメント

Gilad Book
Gilad Book 2017 年 11 月 15 日
Thanks, It seems to be doing exactly what I want, but I'm sure there's a simpler and more elegant way.
Matt J
Matt J 2017 年 11 月 15 日
The routine should be doing what you want in one line of code. Don't see how you're going to get simpler than that...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2017 年 11 月 15 日

コメント済み:

2017 年 11 月 15 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by