How do I retrieve full image after 3D voume rotation
1 view (last 30 days)
Show older comments
Dear all,
I have a problem with retrieving the full 3D volume(I'm using MRI Data) after I do rotation. I'm rotating and shifting a volume with a rotation matrix and interp3 with zero filling the NaN.
If I want to shift it back with the same angles, I do not retrieve the original image back. So I tried padding the image using padarray(volume,[40 40 40]) but this still gives me black areas. I'm rotating between -10 and 10 degrees so padding with 40 is enough for a volume 256x152x20.
Does anyone knows the solution for this?
2 Comments
Matt J
on 10 Oct 2013
You mean the padded array does successfully contain the whole forward transformed object, but the reverse transformed object is cropped at the edges?
If so, we need to see how you are computing the inverse rototranslation.
Accepted Answer
Matt J
on 10 Oct 2013
What I do is the following, I run this code first and then run it again with input Rotated_image with the opposite angles (-5 8 -5) to retrieve the original image
No, you cannot obtain the inverse rotation this way. This is something you can directly verify. With (5,-8, 5) the rotation matrix is
>> R1 =
0.9999 0.0125 0.0070
-0.0118 0.9962 -0.0860
-0.0080 0.0859 0.9963
Negating the angles gives
>> R2
R2 =
0.9999 0.0118 0.0080
-0.0125 0.9962 0.0859
-0.0070 -0.0860 0.9963
It is straightforward to verify that they are not inverses
>> R2-inv(R1)
ans =
0.0000 0.0236 0.0161
-0.0249 -0.0000 -0.0000
-0.0140 0.0000 0
Bottom line. Compute and store the complete forward rotation matrix. Then you can apply its inverse linear algebraically.
More Answers (0)
See Also
Categories
Find more on 3-D Volumetric Image Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!