Tetrahedral Mesh Generation for Medical Imaging ⋆

. We describe the open source implementation of an adaptive tetrahedral mesh generator particularly targeted for non-rigid FEM registration of MR images. While many medical imaging applications require robust mesh generation, there are few codes available. Moreover, most of the practical implementations are commercial. The algorithm we have implemented has been previously evaluated for simulations of highly deformable objects, and the preliminary results show its applicability to the targeted application. The implementation we describe is open source and will be available within Insight Toolkit.


Introduction
Finite Element Method (FEM) representations are widely used in medical imaging to enable intraoperative registration [1,2] and biomechanical modeling of the tissue.The quality of geometric discretization is crucial for the effectiveness of these applications.Although numerous mesh generation methods have been described to date, there are few which can deal with medical data input.Even fewer algorithms have been implemented and evaluated.Software packages that can produce high quality meshes are usually commercial [3,4].
In this paper we describe the on-going collaborative effort to produce open source mesh generation code within Insight Toolkit (ITK) [5].Our motivating application is non-rigid image registration for preoperative planning and intraoperative navigation during neurosurgical procedures.
The paper is structured as follows.In Section 2 we discuss existing approaches to mesh generation.Section 3 describes the algorithm we have implemented.In Section 4 we present our implementation.Finally, we evaluate the implementation in Section 5 and conclude in Section 6.

Related work
The target application for our implementation is FEM-based non-rigid registration of intraoperative MRI images for brain tumor resection procedures [2] and biomechanical simulation of the brain tissue deformation.The algorithm we choose has to satisfy the following requirements: (1) it should work directly with medical data (segmentations or greyscale images); (2) meshes must conform to the region of interest and have good quality (e.g., we can use minimal dihedral angle and aspect ratio [6] of a tetrahedron to evaluate its quality); (3) the algorithm should be capable of producing adaptive meshes; (4) intraoperative procedures require the algorithm to be very fast.
Both the bad quality and the large number of the mesh elements can negatively affect the execution time of an FEM simulation [1,6].Coarse discretization and poor shape of the elements can also introduce incorrect results and numerical errors.Hence, it is desired to have adaptive meshes which which provide guaranteed quality discretizations.Only Delaunay-based tetrahedralizations can produce meshes of guaranteed quality [7].Unfortunately, Delaunay meshes may contain slivers (nearly flat tetrahedra with well-separated points).Advancing front techniques (AF) start from the boundary triangulation advancing the front inside the object.Bad quality tetrahedra may be introduced at the point where the fronts collide.AF methods are also highly dependent on the quality of surface discretization.Most of the practical techniques combine benefits of the Delaunay and advancing front approaches [3].
We observe, that there is no well-established methodology for mesh generation in the medical community.The reader is referred to [1,6,8] for surveys of existing approaches to mesh generation and their applicability to clinical applications.Implementations that produce high quality meshes are usually in the commercial domain [3,4].

Algorithm
The baseline algorithm which we have implemented was developed by Molino for simulations of highly deformable objects [9].The algorithm starts with building a uniform body-centric cubic lattice (BCC) enclosing the object, and applies iterative adaptive refinement procedure to create the mesh.The mesh obtained as the result of the adaptive refinement has guaranteed quality.Once the refinement procedure is complete, the topology of the candidate mesh is finalized.The tetrahedra which are guaranteed to be completely outside the object are discarded, as well as the tetrahedra which do not contain "enveloped" vertices.The resulting mesh does not conform to the object surface.Physics based FEM compression of the candidate mesh is used to align the mesh boundary.Both the refinement and compression procedures are using a level set definition of the object.At any point of space a scalar function φ(x) is defined as the signed distance function with negative values for the interior and positive -for the exterior of the object.For the details of the algorithm the reader is referred to the original
paper describing the method [9].Although the algorithm we have selected does not provide guarantees about the final mesh quality, Molino reports superior quality of the mesh in presence of high deformations.

Implementation
The implementation is structured as two ITK [5] classes, and we take advantage of a number of algorithms and tools implemented within ITK.We also use PETSc [10] (linear solver), and robust geometric primitives implemented by Shewchuk [11] (orientation test).Both of these codes are in the public domain.
The two main steps of the algorithm are (1) creation of the candidate mesh (Mesher ), and (2) compression of the mesh surface to the object boundary (Smoother ).We implemented these two stages as two separate ITK classes, as shown in Figure 1.The Mesher class is inherited from ITK ImageToMeshFilter.The input image is resampled to unit voxels, and then the distance and curvature maps are computed on the resulting image.Starting from the initial BCC lattice, at each resolution level all of the tetrahedra in the mesh are passed through the set of subdivision tests.The subdivision tests implemented within the Mesher filter check if a tetrahedron is crossing the object boundary, or is located in a region of high surface curvature.These tests are facilitated by the image distance and curvature maps.The API also allows to specify custom subdivision tests.
Once the tetrahedra which require subdivision are marked, we need to ensure that the mesh conforms to the object boundary.The mesh conformancy checks are repeated iteratively until we do not have new edges split.We use an edge-based data structure for mesh representation: each tetrahedra contains six pointers to its edges, so that we can identify the subdivision configuration in the constant time.After the specified number of refinement levels is reached, we discard tetrahedra which are guaranteed to lie outside the object of interest or which are not sufficiently interior to the object surface [9].
The Smoother filter is implemented as ITK MeshToMeshFilter.It accepts the binary mask and the mesh which approximates that mask.The "candidate" mesh is modeled as a physical body using FEM.We define the displacements of the boundary vertices toward the object surface using the distance map, and solve for displacements of the mesh vertices.The compression stage is performed using either ITK FEM module, or PETSc linear solver.We show some example cross-sections of the produced meshes in Figure 2. The code is being developed within NAMIC SandBox SVN repository, and can be checked out using the following command: svn checkout http://www.na-mic.org:8000/svn/NAMICSandBox/TetrahedralMeshGeneration.

Experimental results
There are at least three important requirements the application imposes: (1) the resulting mesh should be of high quality; (2) the algorithm should be fast; (3) the mesh should precisely approximate the meshed object.Therefore, we evaluate the implementation along these lines.
The experiments were performed on an Intel Xeon workstation equipped with two hyperthreaded 3.06GHz CPUs, cache size 512Kb, 3.31Gb physical memory.The evaluation was done on three brain tissue segmentations from the retrospective neurosurgery cases.The datasets were selected from those used in [2], so that for each of the segmentations we had a tetrahedral mesh produced with the commercial software GHS3D [12].We have also obtained an evaluation version of the Amira software [4] and did a similar comparison (we used Amira to generate constrained mesh when reconstructing the surface).
Most of the running time is spent in data preparation: image resampling, distance transform and curvature calculation take approximately 5 minutes, while the refinement and boundary compression is complete in 10-25 seconds depending on the mesh size.In order to evaluate the quality of the resulting meshes we used tetrahedron aspect ratio and minimal dihedral angle [6].The quality of the surface approximation was evaluated using the symmetrical Hausdorff distance [13] 4 between the mesh surfaces produced by our implementation and those extracted from the meshes generated by GHS3D and Amira.The results of the evaluation are summarized in Table 1.
The average Hausdorff distance is around 2 mm in all three cases.However, the maximum distance value reaches 7 mm, which is not acceptable (we consider the commercial meshes to be the "golden standard" for this comparison).There is a significant mismatch between the surface extracted from the meshes produced by our implementation and those extracted from the volumetric meshes generated by GHS3D and Amira.This can be explained for the GHS3D software by the fact that the volumetric mesh is constructed from the decimated mesh obtained by applying the Marching cubes algorithm to the input data [14].At the same time, our implementation uses distance map of the binary image to align the surface vertices to the segmentation boundary.We failed to obtain detailed information about the algorithms used in Amira.
The meshes produced by our implementation have significantly better geometric properties in most cases.It is also important to note that the process of generating the mesh with GHS3D or Amira involves multiple steps, as described in [2].Our implementation allows to intuitively control the mesh size, operates directly on the medical data and does not use any commercial components.We presented an implementation of the mesh generation algorithm based on adaptive refinement and FEM physics deformation.Our implementation is under development within NAMIC SandBox and will be available as a package within ITK.Preliminary evaluation shows applicability of the implementation for the targeted clinical application.We will continue our work on this method in order to obtain more experimental data, improve the surface approximation quality, and evaluate its applicability on other clinical applications.The presented implementation is the "pilot" code to analyze the viability of the approach.
The surface representation accuracy has to be improved, and we believe we can achieve 1-2 mm accuracy of the segmentation approximation with our implementation.Although our mesher is very fast, we also plan to work on parallel distributed and shared memory implementations of the mesher [15] to facilitate parallel biomechanical simulations.Advanced biomechanical models may require significantly larger meshes than those we used for our evaluation.

Fig. 2 .
Fig. 2. Cross-sections of the adaptive meshes produced by the implementation.

Fig. 3 .
Fig.3.Tetrahedral mesh generated with INRIA GHS3D (left) and the presented mesher (right) for case 2; the color-coding displays Hausdorff symmetrical distance between the two mesh surfaces.

Table 1 .
Quantitative comparison of the generated meshes (Red Green Mesher, RGM ) with the meshes produced by the INRIA GHS3D and Mercury Computer Systems Amira software.