Prev: indexing
Next: Cell arrays containing cell arrays
From: Ali on 3 Jun 2010 00:56 i used this command: out_image = imrotate(in_image,angle,'nearest','crop'); the input image is a 3D brain image(MRI) 600 by 600,and the result image is 486 by 492. without 'crop' the same, output image continue smaller then the input one.
From: ImageAnalyst on 3 Jun 2010 07:36 On Jun 3, 4:56 am, Ali <za_ali...(a)hotmail.com> wrote: > i used this command: > > out_image = imrotate(in_image,angle,'nearest','crop'); > the input image is a 3D brain image(MRI) 600 by 600,and the result image is 486 by 492. > without 'crop' the same, output image continue smaller then the input one.. --------------------------------------------------------------------------------------------------------------------- You're doing something wrong (like your explanation) because I just ran this and it worked fine: originalImage = uint8(255 * rand(600,600)); originalSize = size(originalImage) subplot(2, 1, 1); imshow(originalImage, []); title('Original Grayscale Image'); set(gcf, 'Position', get(0,'Screensize')); % Enlarge figure to full screen. rotatedImage = imrotate(originalImage, 30, 'crop'); rotatedSize = size(rotatedImage) subplot(2, 1, 2); imshow(rotatedImage, []); title('Rotated Grayscale Image'); Results: originalSize = 600 600 rotatedSize = 600 600 In your explanation, you say a 3D MRI image but then you give dimensions for a 2D image so something's wrong in your explanation. But even when I replace the 2D image with a color image, which is 3D, it rotates it in the plane and keeps the lateral dimensions the same. imrotate will not rotate a volumetric image about an arbitrary angle in 3D.
From: Steve Eddins on 3 Jun 2010 12:33 On 6/3/2010 4:56 AM, Ali wrote: > i used this command: > > out_image = imrotate(in_image,angle,'nearest','crop'); > > the input image is a 3D brain image(MRI) 600 by 600,and the result image is 486 by 492. > > without 'crop' the same, output image continue smaller then the input one. Can you show us the output from the following: size(in_image) which -all imrotate version ver images --- Steve Eddins http://blogs.mathworks.com/steve/
From: Ali on 3 Jun 2010 10:35 yeah i did it wrong because the output image had the same size, but i save that as .bmp and i looked the size of the .bmp compressed. sorry
From: Ali on 3 Jun 2010 11:11
i wan to apply a bidimentional translation to the image for example [-40 -60] respectively in X and Y axis with imtransform can i do anything ?? if yes how can i define the TFORM?? |