# Resizing a 3D image without using imresize3

12 vues (au cours des 30 derniers jours)
Matlab_Student le 23 Sep 2017
Modifié(e) : Matt J le 29 Juil 2022
I do not have the image processing toolbox on my MatLab 2016b so I cannot use the imresize3() function. Is there other ways to resize an image of (x,y,z) to (a,b,c)?
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (4)

Matt J le 23 Sep 2017
Modifié(e) : Matt J le 29 Juil 2022
This FEX file is a generalization of imresize to any array dimension, and doesn't use any toolboxes.
However, it only handles grayscale images, and doesn't do any anti-aliasing. All new values are based purely on interpolation.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

Walter Roberson le 23 Sep 2017
ifftn( fftn(YourImage), [a, b, c] )
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Bogdan Dzyubak le 28 Déc 2017
Modifié(e) : Bogdan Dzyubak le 28 Déc 2017
Transforming the image this way forward and back produces tons of ringing. There's also a warping artifact (perhaps fftshift is needed). With imresize, the forward and back transform gives a blurrier original image which is more desirable.

Connectez-vous pour commenter.

Ahmadi Anis le 8 Avr 2020
I have an MRI image with this size (140,192,192), so this script will insert my image in the center of an output matrix with this size (X,Y,Z) by adding zero
this script works ;)
clear;
clc;
X=256;
Y=256;
Z=256;
matrice=[zeros(floor(X-size(matrice,1))/2,size(matrice,2),size(matrice,3));...
matrice;...
zeros(floor(X-size(matrice,1))/2,size(matrice,2),size(matrice,3))];%%reglage de x
matrice=[zeros(X,floor(Y-size(matrice,2))/2,size(matrice,3)),...
matrice...
,zeros(X,floor(Y-size(matrice,2))/2,size(matrice,3))];%%reglage de y
matrice=cat(3,zeros(X,Y,floor(Z-size(matrice,3))/2),...
matrice...
,zeros(X,Y,floor(Z-size(matrice,3))/2));%%reglage de z
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Radhika Gupta le 24 Avr 2022
Modifié(e) : Radhika Gupta le 24 Avr 2022
Hey!
is there any way to resize .nii file and save in same format istead of a matrix?

Connectez-vous pour commenter.

Shivam le 29 Juil 2022
You can use "for" loop for each 2D image, and than use imresize():
Im=zeros(N,N,N);
I=zeros(n,n,n);
for i=1:N
I(:,:,i)=imresize(squeeze(Im(:,:,i)),[n n]);
end;
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by