Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Questions about surface mesh generation: coordinate system, criteria, randomness

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Questions about surface mesh generation: coordinate system, criteria, randomness


Chronological Thread 
  • From: Mariette Yvinec <>
  • To:
  • Subject: Re: [cgal-discuss] Questions about surface mesh generation: coordinate system, criteria, randomness
  • Date: Tue, 12 Jul 2011 10:53:01 +0200



Le 12/07/11 05:56, Nicholas Mario Wardhana a écrit :
Hi Mariette, thank you for your reply!

On 11 July 2011 20:57, Mariette Yvinec  wrote:

Note that the coordinate system of a gray image is encoded in the image
file.
Which of the variables in the header corresponds to it? Are they the
VX, VY, VZ variables? Because I thought they corresponded to the size
of one voxel...
yes, vx,vy,vz gives the scale transform on each axis.
As for the origin, I guess it is assumed to be the bottom, left, back corner
so that the whole image lies in the positive octant.
(I was not sure about that, but just get it
from the code of triliniear_interpolation function in Image_3.h


      
You are  not required to determine the center of the coordinate system.
You are just required  to provide a bounding-sphere whose center
is a point inside the surface you want to mesh and whose radius is big
enough
for the sphere to include the whole image.

My problem is actually in determining the centre point of the bounding
sphere itself, because the point I chose (inside an arbitrary voxel
with value 0) is rejected on the basis of positive sign, so I was
wondering if the coordinate system of the image is different from my
voxelisation.
one easy test is to compute the value of the function
at the point you would like to be the center,
just to test that the value is negative.

As for the radius, as long as the centre is correct, assuming the
dimension of the voxels is x times y times z, I suppose it is always
safe to set the radius to sqrt(x^2 + y^2 + z^2), which is the diagonal
of the dimension?

The radius bound provide an upper bound on the size of the surface mesh
elements.
If you decrease it, you will get a finer mesh with more  and smaller
elements.
So the right value is function of the size (in terms of number of elements)
 of the mesh
you want to generate.
The centre-centre  bound controls the accuracy of the surface approximation.
It will also has an influence on the granularity of the mesh.
Beware that this parameter should not be small
compared to the precision with which
points on the level set are computed
which is be default set to 1E-03 x the bounding sphere radius.
Typically the  centre-centre distance bound should be 10 times the
error bound.
Thanks Mariette for the explanation.

I have been doing experiments with various precision and centre-centre
bound (I prefer coarse mesh, so I have a fix 1000.0f for the radius
bound). My original environment consists of two fat polyhedra:

http://i.imgur.com/MVYqt.jpg ,

but the best result I got so far is like a very thin plate. You can
see it (and the corresponding sampled points) here:

http://i.imgur.com/9eHQg.jpg

The points the algorithm samples seem to be concentrated in a
particular area, so I am wondering whether I made a mistake here? Here
is a piece of my code:

// -------------------------- code starts ------------------------------------
typedef CGAL::Surface_mesh_default_triangulation_3 Tr;
typedef Tr::Geom_traits GT;

Gray_level_image image("data/voxel.inr", 0.9f);
GT::Sphere_3 bounding_sphere(bounding_sphere_center,
bounding_sphere_squared_radius);
Surface_3 surface(image, bounding_sphere, 0.001f);
CGAL::Surface_mesh_default_criteria_3<Tr> criteria(30., 1000.0f, 0.1f);
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Manifold_tag());
// -------------------------- code ends ------------------------------------


Are you sure about the isovalue  " 0.9f " you give
to define the surface?
(I don't know what is "f")

One question more :
It seems that you are creating an image from a set of two polyhedron
and that you are trying to get a surface mesh approximating the polyhedral surfaces.

Note that the Surface mesh generator has also "undocumented features" to mesh polyhedral surfaces
and segmented images that might help you.
I quote below the user manuel:

The Polyhedron demo has a feature that allows to remesh a polyhedral surface, using the 3D Surface Mesh Generator. That has been implemented as a special model of SurfaceMeshTraits_3, for polyhedra. That traits class is not yet documented because its interface and code have not yet been stabilized. It will probably be shipped with next release of Cgal.

The Surface Mesh Generator demo allows to mesh not only gray level images, but also segmented images, when voxels are labelled with a domain index. Such images are for example the result of a segmentation of 3D medical images. This feature is not yet ready to be documented in current release, but will probably be in next release of Cgal.


Another way, if you prefer documented stuff, which I can easily understand
is to get the surface mesh you would like out of the Mesh_3 package.
For this, it suffices to run mesh_3 with trivial criteria for cells.



      
The surface_mesher has a randomized way of computing a few initial points
on the surface : it computes intersections with the surface of random rays
casted from the center of the bounding sphere.
Depending of these initial points, different connected components
of the level set can be discovered and meshed. This might explain
what you observe.
Hope this helps.


I see, that seems to explain the phenomenon.

--
Mariette Yvinec
Geometrica project team
INRIA  Sophia-Antipolis

    

-- 
Mariette Yvinec
Geometrica project team
INRIA  Sophia-Antipolis  





Archive powered by MHonArc 2.6.16.

Top of Page