[node,elem]=binsurface(img,nface)
fast (triangular/rectangular) isosurface extraction for 3D binary images, by Qianqian Fang, <fangq at nmr.mgh.harvard.edu>
the outputs of this subroutine can be easily plotted using
patch('Vertices',node,'faces',elem,'FaceVertexCData',node(:,3),'FaceColor','interp');if the surface mesh has triangular faces, one can plot it with
trisurf(elem,node(:,1),node(:,2),node(:,3))
dim=64; [xi,yi,zi]=meshgrid(1:dim,1:dim,1:dim); dist=(xi-32).^2+(yi-32).^2+(zi-32).^2; v=zeros(size(xi)); v(dist<256)=1; % triangular surface [node,elem]=binsurface(v); subplot(121); trisurf(elem,node(:,1),node(:,2),node(:,3)); axis equal; % cubical surface [node,elem]=binsurface(v,4); subplot(122); trisurf(elem,node(:,1),node(:,2),node(:,3)); axis equal;
This function is not included in iso2mesh 0.5.1. You can get it at our CVS. It will be included in the next release of this toolbox. One can download this function alone from Matlab File Exchange.
This function is Octave compatible.