From: RG on
Well, I just wanted to post that I've figured out one way to do this. I got the idea from Doug's December 2009 post on <a href="http://blogs.mathworks.com/videos/2009/12/07/basics-volume-visualization-99-unifying-example/">Volume Visualization</a>.

First, I generate a grid of 3D spatial coordinates (x, y, and z) using meshgrid (multiplying each axis by the appropriate spatial resolution, of course). Then, I treat the 3D volumetric data as a volume (V) and plot orthogonal slices using the "slice" function. Then, to overlay a mesh, I simply generate a filled 3D polygon from the f-v mesh using the "patch" function and display it on the same set of axes.

The code goes something like this (for a 3D image volume stored in variable V):

res = [1 1 2]; % Spatial resolution of the image (in mm, in my case)
%% Generate a mesh
[x, y, z] = meshgrid(res(1)*(0.5:1:(size(V,1)- 0.5)), ...
res(2)*(0.5:1:(size(V,2)- 0.5)), ...
res(3)*(0.5:1:(size(V,3)- 0.5)));

%% Set up axis with 3D view and proper axis scale
a = axis;
daspect([1 1 1]) % Adjust these values for different aspect ratio
view(3) % Switch to 3D view
axis([0 size(V,1)*res(1), 0 size(V,2)*res(2), 0 size(V,3)*res(3)])

%% Display orthogonal planes
hSlice = slice(x, y, z, V, xmax/2, ymax/2, zmax/2);
set(hSlice, 'EdgeColor', 'none', 'FaceColor', 'interp')
colormap(a, gray)

%% Overlay orthogonal planes with fv mesh
hPatch = patch(fv);
set(hPatch, 'CData', 0.1, 'FaceColor', [0 0.8 0], 'EdgeColor', 'none', 'FaceAlpha', 0.5);

Note that this will display the mesh in green with some transparency (adjust the 'FaceAlpha' parameter to make it more or less transparent). The 'FaceColor' parameter controls the color. You can play around with lighting as Doug demonstrates in his tutorial...I found this to be the best option:

%% Add some lighting
camlight headlight;
lighting phong

"RG " wrote in message <hbkhc6$mm$1(a)fred.mathworks.com>...
> Hi,
>
> I have a 3D triangulated mesh with N points and F faces defined by two variables:
> *vertices (a 3 x N set of spatial coordinates)
> *faces (a 3 x F set containing the indices of vertices which, when connected, will form the 3D mesh)
>
> Since the mesh was generated to outline a volume of interest in a 3D image, I'd like to be able to overlay that mesh onto the original 3D CT image (Mayo ANALYZE format) in MATLAB (for visualization purposes). For starters, I calculated spatial coordinates for the center of each voxel in the 3D image using the spatial resolution stored in the header file. However, I can't quite wrap my head around how to display the image and mesh together. If anyone has any suggestions, I'd appreciate it.
>
> Thanks!