How can I change voxel size in a volume?

15 次查看(过去 30 天)
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 个评论
Bjorn Gustavsson
Bjorn Gustavsson 2022-5-25
What do you intend to reveal with this rather large up-sampling? Almost a factor of 40 in the third dimension?

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2022-5-25
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 个评论
Walter Roberson
Walter Roberson 2022-5-26
编辑:Walter Roberson 2022-5-26
imshow3d does not know anything about reference objects.
See also volumeviewer()

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by