Rotate 3D (512*512*512 double) matrix

1 次查看(过去 30 天)
Hi. I have a 3D matrix in double type (512*512*512 double) and I want to rotate 30 degree anticlockwise around central z-axis. Can anyone please give me an idea how to do this? Many thanks,
  1 个评论
Matt J
Matt J 2022-3-1
Where is the "central z-axis" in the coordinates of your 3D grid? Which way does it point?

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2022-2-28
The easiest way is to slice it into panes and rotate each pane and reassemble.
  3 个评论
Walter Roberson
Walter Roberson 2022-3-1
for k=512:-1:1
newimg(k, :, :) = imrotate(squeeze(img(k, :, :), Angle)) ;
end

请先登录,再进行评论。

更多回答(1 个)

Matt J
Matt J 2022-3-1
编辑:Matt J 2022-3-1
order=[3,1,2]; %example
A=permute(yourMatrix,order);
A=imrotate(A,30);
A=ipermute(A,order);

类别

Help CenterFile Exchange 中查找有关 Interactions, Camera Views, and Lighting 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by