I am still in the process of learning ITK/VTK and struggling for a few days to create a mesh with three types (triangle, tetrahedron, and Simplex) of cells from the binary mask volume. I feel that I am doing some mistakes.
What I did is that
I created the surface by following the procedure in this link using marching cubes and setting the parameters as follows:
double isoValue = 0.5; // threshold value
surface->SetValue(0, isoValue); // second value acts as threshold
and saved the surface in a
- I created the triangle mesh by following the commands in this link.
My question is two-folded:
- The surface created using Marching Cube does not look smooth, and the mesh edges and cells also look the same (see the figures). Is this a usual representation of triangle mesh and marching cube? Or should I change any parameter?
Marching cube surface
and the mesh structure types that I have defined:
#ifndef vtkFloatingPointType #define vtkFloatingPointType double #endif const unsigned int PointDimension = 3; const unsigned int MaxCellDimension = 3; typedef itk::DefaultStaticMeshTraits< vtkFloatingPointType, PointDimension, MaxCellDimension, vtkFloatingPointType, vtkFloatingPointType > MeshTraits; typedef itk::Mesh< vtkFloatingPointType, PointDimension, MeshTraits > floatMeshType;
- What changes can I carry out in this code to have a tetrahedron mesh?