<< mesh_2 cglab

cglab >> cglab > surface_mesher

surface_mesher

Meshes a surface defined as a grey level in a 3D image

Calling Sequence

[connect,coord]=surface_mesher(image,iso_value,bounded_sphere,mesh_criteria)

Parameters

image
: is a string telling the path of the 3D image. This function supports several types of 3D images: INRIMAGE (extension .inr), GIS (extension .dim, of .ima), and ANALYZE (extension .hdr, or .img).
iso_value
: is a scalar telling the level of the grey we are interested in.
bounded_sphere
: = [x_sphere_centre,y_sphere_centre,z_sphere_centre,squared radius]. the sphere center must be inside the surface defined by 'image' and the radius must be high enough so that the sphere actually bounds the whole image.
mesh_criteria
: = [angle_bound, radius_bound, distance_bound] as bounds for the minimum facet angle in degrees, the radius of the surface Delaunay balls and the center-center distances respectively.
connect
: is (nbtriangles,3) array, Each row of connect defines one triangle. nbtriangles is the number of triangles of the obtained mesh.
coord
: is (nbpoints,3) array defining (x,y,z) coordinates of vertices of the obtained mesh.

Description

The function surface_mesher builds a two dimensional mesh approximating surfaces defined as grey level of 3D images.

Examples

p = cglab_getrootpath();
image_1 = p+"/demos/skull_2.9.inr";
bounded_sphere = [122.0 102.0 117.0 200.0*200.0*2.0];
mesh_criteria = [30 5 5];
[tri,coord] = surface_mesher(image_1,2.9,bounded_sphere,mesh_criteria);

xx = matrix(coord(tri,1),-1,3)';
yy = matrix(coord(tri,2),-1,3)';
zz = matrix(coord(tri,3),-1,3)';

h = plot3d(xx,yy,zz)
h.color_mode=8
h.hiddencolor = -1;
a=gca();
a.isoview="on";
a.rotation_angles=[75,-75];

Authors


Report an issue
<< mesh_2 cglab