How to resize a 4D Matrix

19 visualizzazioni (ultimi 30 giorni)
Sriparna Sen
Sriparna Sen il 24 Set 2019
Commentato: Sriparna Sen il 24 Set 2019
I want to resize a 4D matrix with the following dimensions (238,87,60,69) to a 4D matrix with the following dimensions (238,58,40,46).
I tried using the function 'imresizen' as follows:
vtc = xff('DX.vtc');
vtc1 = vtc.VTCData; %vtc.VTCData has the following dimensions (238,87,60,69)
vtc2 = imresizen(vtc1,[238,58,40,46]);
However, I get the following error message:
Error using griddedInterpolant/subsref
Requested 56644x5046x2400x3174 (8111094.2GB) array exceeds maximum array size preference. Creation of arrays greater
than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference
panel for more information.
Error in imresizen (line 71)
Y=reshape(F(yvec),szy);
Is there a way to resize the 4D matrix using another method? Or am I using 'imresizen' incorrectly?
Thank you so much in advance!!!!

Risposta accettata

Rik
Rik il 24 Set 2019
Modificato: Rik il 24 Set 2019
You misunderstood the syntax of the FEX submission imresizen. The second input is a scaling factor, meaning your syntax should look like this:
img4D=rand(238,87,60,69);
wanted_size=[238,58,40,46];
out=imresizen(img4D,wanted_size./size(img4D));
clc,size(out)
  1 Commento
Sriparna Sen
Sriparna Sen il 24 Set 2019
Oh, thank you so much!!! Make perfect sense now! Cheers

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Read, Write, and Modify Image in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by