How to take a 2d slice image and convert it to a 3d image.

22 次查看(过去 30 天)
It has a 360-degree sliced image of a lamp image placed on a tabletop. ( .tiff, Color IMAGE )
I want to concatenate these images into a 3d image. I confirmed that volumeViewer exists.
Can i make a 3d image out of this? Or is there another way?
The image has images in sequence from 1-360 degrees. ( 0degree.tiff, 1degree.tiff ~~ 360degree.tiff )
Even simple code is fine. Please share information.
  • There are only left and right images. Vertical rotation is not taken into account.

回答(1 个)

Image Analyst
Image Analyst 2023-2-8
编辑:Image Analyst 2023-2-8
for k = 1 : 360
fileName = sprintf('%ddegree.tiff', k)
sliceImage = imread(fileName);
if k == 1
[rows, columns, numColors] = size(sliceImage)
% Allocate the whole array (for speed).
image3d = zeros(rows, columns, 360, class(sliceImage));
end
image3d(:, :, k) = sliceImage; % Put this slice into plane k of the 3-D image.
end
  2 个评论
윤석 이
윤석 이 2023-2-8
thanks for the answer.
If that code is done to convert to 3d image, how to view it in 3d form?
Image Analyst
Image Analyst 2023-2-9
Try the volViewer app.
help volumeViewer
volumeViewer View volumetric image. volumeViewer opens a volume visualization app. The app can be used to view 2-D slices of a volume and do volume rendering, maximum intensity projection, and isosurface visualizations of volume data. volumeViewer(V) loads the volume V into a volume visualization app. volumeViewer(V, L) loads the volume V and labeled volume L into a volume visualization app. volumeViewer(____, Name, Value) loads the app using the Name/Value pairs volumeViewer CLOSE closes all open volume viewer apps. Parameters include: 'VolumeType' String or character array defining the type of volume being loaded, specified as one of the following values: 'Volume' - intensity volume 'Labels' - labeled volume When the volume is categorical, default VolumeType is 'Labels', otherwise the default VolumeType is 'Volume'. This NV pair is ignored when the second syntax of two volume is used. 'ScaleFactors' Scale factors used to rescale volume(s), specified as a [1x3] positive numeric array. The values in the array correspond to the scale factor applied in the x, y, and z direction. Default value is [1 1 1]. This NV pair is ignored when 'VolumeType' is 'Labels' Class Support ------------- Volume V is a scalar valued MxNxP image of class logical, uint8, uint16, uint32, int8, int16, int32, single, or double. Labeled Volume L is a scalar valued MxNxP image of class categorical, uint8, uint16, uint32, int8, int16, int32, single, or double. See also volshow, isosurface, slice Documentation for volumeViewer doc volumeViewer

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Import, Export, and Conversion 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by