Plotting images in plot3 fashion

I'd like to visualize an image sequence in a plot3 fashion (that is, enabling the user to rotate the plot and use other plot3 functionality).
I currently have an (m x n x d) matrix where I'd like to plot an (m x n) image for each integer (1,...,d). Is there any way I can do this using image/imagesc within the plot3 environment?
I've easily been able to plot every point using plot3 with a square marker colored according to the intensity value. This is really suboptimal since (1) the borders of the square markers aren't touching and (2) the size of the square marker will change based on m & n.
Any suggestions?

Answers (2)

Image Analyst
Image Analyst on 26 Aug 2013
Do you mean the surf function? See the clown demo in the help.
Or maybe you might want one of these: meshcanopy, or sc

2 Comments

Amanda
Amanda on 3 Sep 2013
Edited: Amanda on 3 Sep 2013
I appreciate the help, but I don't believe these provide the functionality I am trying to achieve. All three of these methods are for 3D data, correct?
What I am trying to do is visualize 4D data by plotting 3D data (x/y coordinates + intensity value represented as an image) in successive slices. That is, have an "image" (a [m x n] matrix with "intensity" values) which is indexed by x/y coordinates at each z coordinate.
I've done this by using plot3 and individually plotting intensity colored points, but what I do not like about this approach is that when I rotate, points get occluded almost regardless of the roll/pitch/yaw rotation.
Why don't you just show them as images, which you say they kind of are? Use image(), imshow(), or slice().
By the way, you have a volumetric image with x, y, z (or time), and a value. That is 3D data, NOT 4D data. The value is not, repeat not, an independent dimension.

Sign in to comment.

Walter Roberson
Walter Roberson on 3 Sep 2013
image() and imshow() are not suitable for plots that may be rotated around something other than the Z axis, as the images produced are represented as completely 2D and will pretty much vanish when there is any tilt. Likewise, image() and imshow() images literally do not have a Z axis so they cannot be stacked.
In order to draw an image that is rotatable or stackable in 3D you need to use texture mapping, either by using a surface graph (e.g., surf) or by using patch().
There is a volume (voxel) rendering program in the File Exchange.

Asked:

on 26 Aug 2013

Community Treasure Hunt

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

Start Hunting!