MATLAB: Error in resizing 3d image

imageprocessing

I have a dataset of 3d images containing 30 images of different sizes,I want to resize all images to a paricular size
for example for 2d if we use imresize(I,[25 256]) all images in dataset will be resized
same way i tried for 3d using
J = resize(I,size(I).*[0.3 0.3 1])
but it is not reduced to a particular size,i need all images to have same size
say 256x256x3
please help

Best Answer

If it's a color image (as opposed to a volumetric image, as from CT or MRI), you do it exactly the same way as for a gray scale image. No difference at all in the arguments to imresize.
rgbImage256 = imresize(rgbImage, [256 256]);