tags:

views:

188

answers:

2

Hi, so the question ist pretty much the title. I have a 3d volume loaded as raw data [256, 256, 256] = size(A). It contains only values of zero's and ones, where the 1's represent the structure and 0's the "air". I want to visualize the structure in matlab and then run an algorithm on it and put an overlay on it, let's say in the color red. So to be more precise:

  1. How do i visualize the 3d volume. 0's transparent, 1's semitransparent?
  2. Plot a line in the 3 d vis as an overlay?

I already read the mathworks tutorials and they didn't help. I tried using the set command, but it fails completly saying for every property i try "invalid root property". I hope someone can help.

+2  A: 

Im not sure I understand the second part of the question, but here's how you visualize a 3D volume using isosurfaces (I'm using the fluid-flow example data)

%# get a sample data with 0 for empty, 1 for solid
[~,~,~,v] = flow;
v = double( v<-3 );

%# visualize the volume
p = patch( isosurface(v,0) );                 %# create isosurface patch
isonormals(v, p)                              %# compute and set normals
set(p, 'FaceColor','r', 'EdgeColor','none')   %# set surface props
daspect([1 1 1])                              %# axes aspect ratio
view(3), axis vis3d tight, box on, grid on    %# set axes props
camproj perspective                           %# use perspective projection
camlight, lighting phong, alpha(.5)           %# enable light, set transparency

alt text

To learn more about volume visualization in MATLAB, refer to this excellent video tutorial series posted on Doug's blog

Amro
A: 

There's an excellent utility called vol3d, by mathworks employee Joe Conti. I think it addresses your visualization needs exactly - give it a try.

Ofek Shilon

related questions