How do I convert a PCL Polygonmesh to a CGAL CGAL::Tetrahedral_remeshing::Remeshing_triangulation_3<K>? - mesh

I am currently using PCL to obtain a mesh from a point cloud, but I would like to use CGAL tetrahedral_isotropic_remeshing() method to improve the quality of my mesh in certain areas. I am having some difficulties in transforming my pcl::Polygonmesh into the CGAL::Tetrahedral_remeshing::Remeshing_triangulation_3 object required to use the isotropic remeshing method.
Thanks,

Related

c++: CGAL Periodic 2D regular triangulation: How to implement or alternatives?

I recently got started with CGAL for implementing some models which required 2D and 3D periodic regular triangulations (weighted Delaunay or power diagram). I have made some progress with the 3D periodic regular triangulations with this class.
But I couldn't any similar class from CGAL for the 2D case and since I am new to the CGAL package, I am quite unsure on how to adapt the existing code database to help me with my case. Any help with adapting the code or pointers to the packages which can help me with implementing 2D Periodic regular triangulations will be appreciated!
There is currently no Periodic_2_regular_triangulation_2 class, and it is not straightforward to adapt Periodic_2_triangulation_2 to add weights. It is incidentally being done in https://github.com/CGAL/cgal/pull/4914 because that pull request completely rewrites Periodic_2_triangulation_2 in a way that will make it easy to add a weighted version, but this is WIP and without any ETA (I am missing time to finish it).
A possible way to go around that limitation would be to add a "fake" third dimension (z = 0) to your 2D data and use a weighted, periodic 3D triangulation?

Using Pyradiomics to calculate shape features on meshes instead of matrices?

I am trying to compute some mesh features for 3D models that I created using numpy-stl. I would like to compute all of the features given within pyradiomics, but I am not sure how to use them on just the meshes without them having all of the extra binary image, and matrix information? Unless there is a better program t use for shape feature extraction? Also, in the documentation, it says that there are some features you need to enable C extensions for. How can you do that in your python script?
C extensions are enabled by default. As of PyRadiomics 2.0, the python equivalents for those functions have been remove (horrible performance).
As to your meshes. PyRadiomics is build to extract features from images and binary labelmaps. To use meshes you would have to first convert them.
What features do you want to extract? PyRadiomics does use a sort of on-the-fly built mesh to calculate surface area and volume, which are also used in the calculation of several other shape features.
If you want to take a look at how volume and SA are calculated, the source code for that is in C (radiomics/src/cshape.c). The calculation of the derived features (e.g. sphericity) is in shape.py

CGAL mesh voxelization

Does CGAL provide a method of surface mesh voxelization, like iso2mesh for
matlab?
Also does CGAL provides image processing methods - imerode, imdilate,
imclose - like matlabs image processing toolbox?
CGAL does not provide what you want. We only offer functions to extract iso-surfaces from voxel data, or to tetrahedrize the volumes between such surfaces.

Does CGAL support 3D meshing of multiple objects?

I would like to mesh multiple (about 25) objects all at once using CGAL.
However, only one or two objects are output.
Is this a bug in CGAL?
I use Gray_level_image to mesh.
The range is from 1.0 to 3.0 and I use float as number type.
Also, 1.0 to 2.0 is set to be in the spatial domain, 2.0 to 3.0 is the object domain, and I set 2.0 as isovalue.
In the upcoming CGAL version, there is a new example in the documentation, documented in the manual at 3.4.1 Domains From Segmented 3D Images, with a Custom Initialization. You can find the code in our Github page. That new example explains how to detect all connected components of the domain coded by the 3D image, and use a custom initialization to ensure that the initial mesh will have vertices on all connected components before the mesh refinement algorithm is launched.
That example is about a 3D segmented image (values at each voxels are integers) whereas you have a 3D gray-level image, but the method would be the same.

Creating a 3D mesh in VTK

I am trying to create a 3D mesh using VTK. VTK appears to provide a number of ways to create a mesh representing the surface of a 3D object. Filling in the object appears to be more difficult. The reason I want to do this is to pass the output to a FEM tool as a solid, not a balloon.
At the moment, I am playing with spheres and there seems to be a number of ways to create a mesh for the surface of a 3D object. What I can't seem to do is create a sphere with points inside the volume. The vtkUnstructuredGrid class allows me to represent such an object, but I can't seem to mesh this in the same way I can a vtkPolyData.
Is this a fundamental limitation of VTK or am I just not seeing the right tool?
As you said:
I want to do this is to pass the output to an FEM tool as a solid not a balloon
I asume you have your FEM mesh in your own format and you want to visualize it. To do so, you can turn your FEM mesh into a vtkUnstructuredGrid modifiying the code described here:
How to convert a mesh to VTK format?