Convert 2D image into 3D (to get the x y z coordinates of the image)
4 次查看(过去 30 天)
显示 更早的评论
I know there have been similar articles related to this but I am not sure if those articles can help me with what I am trying to do.
So I have a regular png 2D image which I want to convert into 3D image so that I can get the x y and z coordinates. Basically, I need those coordinates in order to calculate some volume.
What should be the appraoch to start this?
2 个评论
Athul Prakash
2020-10-30
编辑:Athul Prakash
2020-10-30
I couldn't understand your question clearly. What do you mean by 3D image to 2D? Are you talking about the number of channels, i.e. converting from greyscale to color perhaps?
jahnavi s
2021-3-28
@Kajimusugura Hoshino, Sir i did u got answer for converting 2D image to 3D, canu please share how to do it if u have done it
回答(1 个)
drummer
2020-10-30
Tecnically, with only one single 2D image, you cannot obtain a tridimensional image.
As you might know, a 2D image has [x, y] dimensions. You can see it by calling
size(yourPNGimageFile) % It will return a vector of two values (x and y)
The z dimension (that represents real data) come from a volumetric (3D) image.
>>size(brainScan) %example of volumetric image of x = 128, y = 128, z 256
ans =
128 128 256
if you pick
brainScan(:, :, 45) % It means you're taking all x, all y and a single slice of the volume (the 45th).
So the way around is possible: to get a 2D image out of a stack of slices in a 3D-image volume.
YOU CAN make a stack of your png 2D images. But it would not make sense, as it will be a stack of repeated images.
yourStack(:, :, 1) = yourPNGfile;
yourStack(:, :, 2) = yourPNGfile; % Then, you have your x, y and z coordinates.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!