How to produce isosurfaces

19 views (last 30 days)
Mikael
Mikael on 25 Sep 2012
Hi there!
My problem is simple enough, but somehow I just can't get it working. I have a 129 x 256 x 256 double 3D-image of a brain with only 1s and 0s in it (it is not a logical though, I have just segmented the white matter). Now I want to produce an isosurface of this image (I have to use the isosurface fnction, not any other contour function). What I did is simply type
isosurface(image,1)
but the only thing I get is a 3D-coordinate system with 0:1-axes (shouldn't they be 0:129 and 0:256, if I understood the help isosurface text correctly?) but no surface. I also tried to insert my image array in place of the image array used in the help browser's Example 1, but that didn't work either. What is it that I do wrong?
Best regards,
Mikael

Accepted Answer

Sven
Sven on 26 Sep 2012
Hi Mikael, you're almost there. Isosurface cuts the data above the isovalue you provide. You need to change your value to, say, 0.5.
bw = zeros(50,50,50); bw(25,25,25) = 1;
D1 = bwdist(bw);
image = double(D1<15)
figure, patch(isosurface(image,1),'faceColor','b')
figure, patch(isosurface(image,0.5),'faceColor','b')
Did this sort the problem out?
  2 Comments
Mikael
Mikael on 26 Sep 2012
Hi Sven, and thank you for your answer! I will not have access to Matlab until tomorrow, but I'll try it out then and let you know how it goes.
Mikael
Mikael on 27 Sep 2012
Tried it and it did work! Again, thank you so much for your help!

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!