Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL Problem when generating mesh (make_mesh_3) from segmented 3d image

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL Problem when generating mesh (make_mesh_3) from segmented 3d image


Chronological Thread 
  • From: Pádraig Ó Conbhuí <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL Problem when generating mesh (make_mesh_3) from segmented 3d image
  • Date: Mon, 23 Nov 2015 15:07:16 +0000
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:RVpXehX55ZDNHoR4q8XQGX2W9SjV8LGtZVwlr6E/grcLSJyIuqrYZh2At8tkgFKBZ4jH8fUM07OQ6PC9HzNYqsvf+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8CVPF0D2WT1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu2pN5k+VqFSWTQ6L3gutoqsrgjGVQLJ530GU2xQnAAPGBnA9Bi9X5H/tWzxueN5nSWbJsbrVqtnZTP35KhiTFrkiTwMKiUi2GDRkM15yqxB8zy7oBkq+wfYeoiUO7LFNojae9kaWO8JCt5WXCtHCIOhbqMACuMAOaBTqIyr9AhGlge3GQT5XLCn8TRPnHKjhaA=

Hi gori23,

One approach I took for this was to iterate through the facets, find the cell it belonged to (facet_handle->first), and the subdomain id (cell_handle->subdomain_id() maybe or c3t3.subdomain_id(cell_handle)) then find the adjacent cell tr3.mirror_facet(facet_handle).first) and again the subdomain id. Check the subdomain index of the two cells, and if they differ, the facet is on an interface.

I was just doing this to get stats on the surface meshes, so I wasn't worried about connectivity etc, so I have no idea about that.

Regards,
Paddy

On Mon, Nov 23, 2015 at 2:02 PM, gori23 <> wrote:
Hi all,

I hope somebody can help me with my problem(s)

I am trying to extract the surfaces of the domains from a segmented 3d
image. So my input is a 3d voxel image (e.g. the liver_gallbladder inr
image). Then my plan was to run make_mesh_3 and to extract the surfaces.

I've ran into the following problems:
Somehow it only works when I open the inr file from a folder, like in the
examples on the CGAL manual pages:
  // Loads image
  CGAL::Image_3 image;
  image.read("data/liver.inr.gz");

I tried to generate the Image_3 by myself using sth like this
_image* im = ::_initImage();
im->vectMode = VM_SCALAR;
im->xdim = xdim;
im->ydim = ydim;
im->zdim = zdim;
im->vdim = 1;
im->vx = vxSize.x();
im->vy = vxSize.y();
im->vz = vxSize.z();
im->endianness = ::_getEndianness();
im->wdim = sizeof(uint8_t);
im->wordKind = WK_FIXED;
im->sign = SGN_SIGNED;
im->data = "volumearray;
(volumearray a pointer to the data array)
However, using my code the program gets stuck in make_mesh_3 without further
output or termination.

The second problem occurs later at the stage where I want to extract the
surface of the domains. So my aim is to get the CGAL tetrahedrization, to
throw away the tetrahedra and to keep only the surface triangles.
I tried different approaches (e.g. to loop through all facets, getting the
facets surface patch index (C3t3::Surface_patch_index sp =
c3t3.surface_patch_index(f);) and generating my surface mesh from these
vertices/triangles.
However, the result seems wrong/incomplete. In general it seems ok (as in it
resembles the surface of a domain), but there are holes in the mesh, missing
walls between domains and different domains have vertices/triangles that
dont match their neighbours (intersecting triangles).

Maybe somebody can give me a hint here on how to extract the information.
If something is not clear or you need more of my code, let me know.

Cheers,
gori23





--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/CGAL-Problem-when-generating-mesh-make-mesh-3-from-segmented-3d-image-tp4661387.html
Sent from the cgal-discuss mailing list archive at Nabble.com.

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss






Archive powered by MHonArc 2.6.18.

Top of Page