3D isosurface color in a binary image

4 views (last 30 days)
Marisol
Marisol on 15 Nov 2014
Edited: Marisol on 15 Nov 2014
Hi everyone,
I have a volumen (x,y,z) where z is the number of a slice. The image is binary. And I am displaying it in a 3D graph. My problem is that the parts that are in black, I want them white, and the white ones, I want them black.
I tried to do a mask with an xor, but still showing the same results. How could I exchange the colors?
This is the code that I am using:
MaskMatrix = ones(size(h.imagen3d,1),size(h.imagen3d,2),size(h.imagen3d,3));
im = xor(h.imagen3d,MaskMatrix);
im = smooth3(im);
figure;
p = patch(isosurface(im,0.2),'FaceColor','black', 'EdgeColor', 'none');
isonormals(im,p);
And this is the image that I get:
Thank you very much in advance!

Answers (0)

Community Treasure Hunt

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

Start Hunting!