MATLAB: How to rotate a spherical image without changing the size and origin

imrotatexyz

Hi
I have a 3 dimensional array containing a spherical image that I would like to rotate from 0 to 359 degrees. At the moment I am using the imrotate function but it seems like the size and origin of the image are changing? Here is my code:
F has dimensions of (256,256,256)
imagesc(F(:,:,100));
b =imrotate(F(:,:,100),25); figure; imagesc(b);
The first image is the spherical object but image b is smaller and the origin is shifted.
Can someone please tell me how to correct this and also which interpolation is the best to use?
Thank you

Best Answer

Be sure to use
set(gca, 'DataAspectMode', [1 1 1])
Also, remember that when you do not specify 'crop', you get out a larger image; when drawn into an axes of constant size, that implies that the elements are going to be drawn smaller.
If you are wanting to rotate an image, you should consider creating a hgtransform and parent the image it it, and setting the transformation matrix as needed using makehgtform()