Deleting a a part of a dimension in a 4D array

2 vues (au cours des 30 derniers jours)
Med_Imager
Med_Imager le 8 Fév 2012
Commenté : the cyclist le 24 Mai 2019
Hi,
I have a 4D array of MR images that are 64 x 64 x 128 x 16. side=64 # of images=128 # of slices in one image=16
I want to delete the last 6 of the slices
So basically, I want my array to look like 64 x 64 x 128 x 10
Can someone please help me. Thanks!

Réponse acceptée

the cyclist
the cyclist le 8 Fév 2012
If X is your array, then
X(:,:,:,11:end) = [];
removes the 11th-16th slices in the 4th dimension.
  4 commentaires
Madeleine Dacey
Madeleine Dacey le 22 Mai 2019
How would you remove just one of the volumes? i.e. say you want to remove only the 11th image.
the cyclist
the cyclist le 24 Mai 2019
X(:,:,:,11) = [];

Connectez-vous pour commenter.

Plus de réponses (1)

Sean de Wolski
Sean de Wolski le 8 Fév 2012
V = V(:,:,:,1:10); %all rows, all columns, all pages, 1:10, 4ds

Catégories

En savoir plus sur DICOM Format 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