MATLAB: How to resize images

digital image processingimageimage acquisitionImage Acquisition Toolboximage analysisimage processingImage Processing Toolboximage segmentation

Hi all,
If i want to resize my image from to 103 to 128, is it correct my coding?
clear all
clc
P = zeros(103, 103, 60);
for K = 1 : 60
K_file=30+10*K;
petname = sprintf('I%d.dcm', K_file);
P(:,:,K) = dicomread(petname);
P(:,:,K) = imresize(P(:,:,K),[128 128])
end
imshow3D(P)

Best Answer

First read the documentation of imresize. Run an example given out there. Understand it and then use the functio. Get the scale and the go by it.
scale = 128/103 ;
Pi = imresize(P,scale) ; % where P is your 103*103 3D matrix