How can I change voxel size in a volume?
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Simone Cotta Ramusino
le 25 Mai 2022
Commenté : Simone Cotta Ramusino
le 26 Mai 2022
Hi everyone,
I have a 3D matrix with size 100x100x41, (obtained by uploading a DICOM file, but that's not the point). From the header, I know that voxels have size 0.723x0.723x1 mm; I'd like to get them 0.08x0.04x0.027 mm, how can I do? I was thinking about imresize and imresize3, using for each the respective scaling factor, but it does not convince me at all, since in no way Matlab has a pixel/voxel size reference, it reads them only as elements of a matrix. Moreover, memory "explodes" using imresize3, because it increases the number of slices a lot.
DCM=rand(100,100,41); % here I create a similar volume, but it can be any
DCM_resize=imresize(DCM,'Scale',[9.0375 18.0832],'method','bicubic');
Last think, I'd like the image not to be stretched, keeping its aspect ratio. Thanks for your help.
1 commentaire
Bjorn Gustavsson
le 25 Mai 2022
What do you intend to reveal with this rather large up-sampling? Almost a factor of 40 in the third dimension?
Réponse acceptée
Walter Roberson
le 25 Mai 2022
In order to keep the aspect ratio, all dimensions must be interpolated by the same factor, which would be max() of the requested factors.
You want your Z to be about 39 times finer (1/0.027) so that is the factor you would have to use for each dimension to avoid changing the aspect ratio.
This refers to keeping the aspect ratio within the matrix. If you are just concerned with keeping the aspect ratio for display purposes, rather than for computation, then there may be additional options.
13 commentaires
Walter Roberson
le 26 Mai 2022
Modifié(e) : Walter Roberson
le 26 Mai 2022
imshow3d does not know anything about reference objects.
See also volumeviewer()
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Explore and Edit Images with Image Viewer App 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!