Subject: CGAL users discussion list
List archive
- From: "Laurent Rineau (CGAL/GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Problem in 3D meshing on cardiac
- Date: Tue, 05 May 2015 12:38 +0200
- Organization: GeometryFactory
Le Friday 27 March 2015 04:36:27 misterdan a écrit :
> I'm trying to make a 3D mesh from a segmented 3D cardiac image, which is
> very similar to the example shown in the documentation.
> http://doc.cgal.org/latest/Mesh_3/Mesh_3_2mesh_3D_image_8cpp-example.html
> <http://doc.cgal.org/latest/Mesh_3/Mesh_3_2mesh_3D_image_8cpp-example.html>
>
> However, the program could not produce any mesh from my image, it stuck in
> the meshing process for very long time, and I had no choice but to terminate
> the program manually.
> My input image is a binary image, with value 0 or 255.
> I have checked that the program did indeed read my image successfully (it
> shows the correct image dimension)
>
> I have tried different parameters and it still stuck in the meshing process.
> Any useful suggestion ?
> Thank you very much.
> I attach the image below for your reference. (it's in inr.gz format...)
> Mask.gz <http://cgal-discuss.949826.n4.nabble.com/file/n4660606/Mask.gz>
Hi,
The image Mask.gz is labellized, but its data type is `double`. By default,
the class template `CGAL::Labeled_image_mesh_domain_3` only deal with
labellized image whose data type is 8 bits (signed or not, that makes no
difference).
Two options:
- you can recreate the image Mask.gz, so that the data type is 'unsigned
char',
- you can try non-default options of CGAL classes, that honestly have not
been tested for years.
For the second option, see the declaration of that class template:
template<class Image,
class BGT,
class Wrapper = Mesh_3::Image_to_labeled_function_wrapper<Image,
BGT> >
class Labeled_image_mesh_domain_3;
The third parameter is `Wrapper`, and its default argument is:
CGAL:: Mesh_3::Image_to_labeled_function_wrapper<Image, BGT>
See now the declaration of `Image_to_labeled_function_wrapper`, in
<CGAL/Mesh_3/Image_to_labeled_function_wrapper.h>:
template<class Image_,
class BGT,
typename Image_word_type = unsigned char,
typename Return_type = int,
bool use_trilinear_interpolation=true>
class Image_to_labeled_function_wrapper
You can see that, by default, the data type (here named `Image_word_type`) is
`unsigned char`. You can try to modify that. In the example, instead of:
typedef CGAL::Labeled_image_mesh_domain_3<CGAL::Image_3,K> Mesh_domain;
use a different wrapper:
typedef CGAL::Mesh_3::Image_to_labeled_function_wrapper<CGAL::Image_3,
K,
double> Wrapper;
typedef CGAL::Labeled_image_mesh_domain_3<CGAL::Image_3,K,Wrapper>
Mesh_domain;
I have tried on my Linux machine, and I was able to mesh your data set with
that modified .cpp file.
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
- Re: [cgal-discuss] Problem in 3D meshing on cardiac, Laurent Rineau (CGAL/GeometryFactory), 05/05/2015
Archive powered by MHonArc 2.6.18.