iso2mesh: A Beginner’s Guide to Surface and Volume Meshing

Converting Scans to Finite Element Meshes Using iso2mesh

Overview

Converting medical or industrial scans (CT, MRI, micro-CT, or other volumetric images) into finite element (FE) meshes enables simulation, analysis, and visualization. iso2mesh is an open-source MATLAB/Octave toolbox that streamlines this pipeline: image segmentation → surface extraction → volume meshing → mesh quality improvement. This article explains a practical, step-by-step workflow and key tips to produce simulation-ready FE meshes.

1. Input data and prerequisites

  • Data types: DICOM series, NIfTI, raw 3D arrays, or stacked 2D images.
  • Software: MATLAB or Octave with iso2mesh installed.
  • Dependencies: TetGen (optional but recommended for tetrahedral meshing), CGAL (for advanced surface operations) — iso2mesh can use internal routines if external tools are unavailable.

2. Typical workflow (step-by-step)

  1. Load and preprocess scans

    • Import DICOM/NIfTI into a 3D array.
    • Apply intensity normalization and simple denoising (median or Gaussian) to reduce artifacts.
    • If needed, resample to isotropic voxel size for better mesh quality.
  2. Segment regions of interest

    • Use thresholding, region growing, or external segmentation tools to label structures (bone, soft tissue, voids).
    • Produce binary masks for each target structure. Clean masks with morphological operations (fill holes, remove small islands).
  3. Extract surfaces

    • Use marching cubes or iso2mesh’s surfacing functions (e.g., surfacing from a binary volume) to extract triangular surface meshes for each label.
    • Simplify and smooth surfaces to remove staircase artifacts while preserving critical geometry.
  4. Repair and combine surfaces

    • Ensure surfaces are closed and free of self-intersections. Use iso2mesh utilities to repair non-manifold edges and small defects.
    • If multiple regions exist, create nested surfaces (e.g., skin, skull, brain) and ensure correct containment relationships.
  5. Generate tetrahedral volume mesh

    • Call iso2mesh’s tetmesh generation (it interfaces with TetGen) to convert closed surfaces into tetrahedral elements.
    • Set element size and quality controls: max volume, radius-edge ratio, or target edge length.
    • For multi-material models, generate conforming interfaces or use constrained meshing to preserve boundaries.
  6. Post-process and optimize

    • Check mesh quality metrics: minimum dihedral angle, aspect ratio, element volume distribution.
    • Apply local refinement or smoothing where elements are poor or high gradients exist.
    • Export mesh in formats compatible with FE solvers (e.g., .msh, .vtk, .inp).

3. Practical iso2mesh commands (MATLAB/Octave)

  • Load volume and create a binary mask:
matlab
vol = load_nii(‘scan.nii’); % using NIfTI toolboximg = vol.img;mask = img > threshold; % simple thresholding
  • Surface extraction:
matlab
[surf_nodes, surf_faces] = smoothpatch(isosurface(mask,0.5), 1, 1);
  • Generate tetrahedral mesh (TetGen via iso2mesh):
matlab
[node,face,elem] = surf2mesh(surf_nodes, surf_faces, maxnode, hmin, hmax);

(Adjust parameters: maxnode: max number of nodes; hmin/hmax: min/max allowed edge length.)

4. Tips for better FE meshes

  • Resample to isotropic voxels before extracting surfaces.
  • Use conservative smoothing; over-smoothing alters geometry and simulation results.
  • Control element size

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *