Storing multiple images in one 4D Array

6 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Bruno Pop-Stefanov
Bruno Pop-Stefanov il 10 Ott 2014
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 Commenti
Kevin
Kevin il 15 Ott 2014
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 il 13 Feb 2015
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...

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Biomedical Imaging in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by