Storing multiple images in one 4D Array

3 次查看(过去 30 天)
Hello Matlab Users,
I have multiple ultrasound images in a 3D plot. They are all at different angles and irregularly scattered. For computational reasons I constructed a simple surface and used the CData command to place the image inside the surface rather than computing the image pixel per pixel at the right position in 3D.
[I] = imread('picture.png'])
h=surf(xPicture,yPicture,zPicture); %Position of the ultrasound image in 3D
set(h,'CData',I,'FaceColor','texturemap');
set(h,'EdgeColor','none');
Now I want to store all the surfaces in a single 4D Array. But I don't get how I can access the gray scale values of each picture in cartesian coordinates and write them in an array without using countless for-loops.
Your help would be greatly appreciated.
Kevin

采纳的回答

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014-10-10
I am not sure I understand what you would like to achieve exactly, but here are a few suggestions:
If you have p images, each of size n-by-m, why not simply store them in an (n x m x p) matrix?
What do you mean by 4-D array? What does each dimension correspond to? If you want to store, for each pixel, the 3-D position and the intensity at that position, you could have a simple N-by-4 matrix (2-D): the three first columns are for the x, y and z positions and the fourth column is the intensity value.
You won't be able to get the intensity at an xyz position from the 3-D plot directly. To link intensity values with xyz positions, you would have to find the transformation from pixel locations in the image space to the 3-D coordinates, as defined by xPicture, yPicture, and zPicture.
If you have some data we can play with, that would be easier to help you.
  2 个评论
Kevin
Kevin 2014-10-15
Thank you Bruno Pop-Stefanov for your suggestions. I got the 4D array idea from the matlab MRI example, where the 4 dimension were for x,y,z and the intesity value.
Shivang Patel
Shivang Patel 2015-2-13
I have Question for you Mr. Bruno Pop-Stefanov...
Suppose, If i have 72 color(RGB) images with 3 dimension([row column depth]) , Then how to store in array? and how to access for feature use... I don't want to use cell...
Actually, whenever I was tried this thing, error msg was "dimension mismatch..."
Thanks in advanced...

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Biomedical Imaging 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by