Storing multiple images in one 4D Array

조회 수: 6 (최근 30일)
Kevin
Kevin 2014년 10월 9일
댓글: Shivang Patel 2015년 2월 13일
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