Mesh Editor Plugin

From user's Wiki!
Jump to: navigation, search

For users

Mesh creation

Description: Generates a volumetric mesh from 2D ROIs.

Author: Chiara Riccobene


This tool can be accessed through the menu Tools->Basic Surface Editing->Mesh Creation.

  • Draw two ROIs on two non adjacent slices
  • Choose Tools->Basic Surface Editing->Mesh creation
  • Choose the method Delauneay Mesh or Marching Cubes
  • Press Apply
Mesh creation

Extract Surface

Description: Extract the main surface of a geometry. It is based on vtk filter vtkPolyDataConnectivityFilter and extracts the largest connected region in the dataset.

Author: Xavi Planes


This tool can be accessed through the menu Tools->Basic Surface Editing->Extract Surface.

  • Select the surface from which you want to extract the main surface
  • On the Top Menu open Tools->Basic Surface Editing->Extract Surface
  • The Tools widget is automatically opened in the right panel
  • Press ’Extract Surface’
  • The main surface is extracted and rendered. The new DataEntity containing the Extracted Surface is listed in the Selection panel as a child of the entire surface.
Extract Main Surface

Ring Cut

Description: Cut a tubular geometry in two parts, in a point selected by the user

Author: Xavi Planes


This tool can be accessed through the menu Tools->Advanced Surface Editing->Ring Cut.

  • Select the geometry that you want to cut
  • From the Top menu select Tools->Advanced Surface Editing->RingCut.
  • The Tools widget is automatically opened in the right panel
  • Press “NewCut”
  • Select a point (SHIFT+CLICK) on the surface of the geometry: a preview ring will be drawn around the surface in the selected point
  • If the point is correctly placed in the desired position, press “Split using ring cut”, otherwise select a different point or press “Cancel” to discard
  • The geometry will be split into two parts colored in orange and cyan respectively; to keep one of them, select the corresponding color from the drop down menu and press “Keep surface”
Ring Cut: select point
Ring Cut: split surfaces

An improvement has been added in GIMIAS 1.5, in the last version of ring cut the cut is done on a plane perpendicular to the vessel direction, now It is possible to define two points, thus user can make oblicuous cuts.An oblique cut of vessel is shown in the next figure.

Ring Cut: split surfaces

Tetra Generation

Description: Generate a tetrahedral mesh from a surface mesh.

Author: Chiara Riccobene


This tool can be accessed through the menu Tools->Advanced Surface Editing->Tetra Generation. The options that are available come from two open source softwares Tetgen and Netgen: it follows a description of both.

Tetgen and Netgen


TetGen is a program to generate tetrahedral meshes of any 3D polyhedral domains. TetGen generates exact constrained Delaunay tetrahedralizations, boundary conforming Delaunay meshes, and Voronoi partitions

How is Tetgen implemented in Gimias? The input mesh is saved to disk as tetgeninput.stl and the filter calls the following command line:

tetgen -pa#MaxVolume#q#AspectRatio#V tetgeninput.stl

where MaxVolume and AspectRatio are values introduced by the user from the GUI (defaults are 0.5 and 0.0, where 0.0 means that the option is not used). The output is saved to disk as tetgenoutput.node tetgenoutput.ele and tetgenoutput.face and then transformed into a vtkUnstructuredGrid. the switches that we use are the following:

  • -p Tetrahedralizes a piecewise linear complex (.stl file). The -p switch reads a piecewise linear complex (PLC) stored in file .stl and generate a constrained Delaunay

tetrahedralization (CDT) of the PLC. In combination with the -q or -a switch, TetGen will generate a quality tetrahedral mesh of the PLC.

  • -q Quality mesh generation. A minimum radius-edge ratio maybe specified (default 2.0). The -q switch performs quality mesh generation by Shewchuk’s Delaunay refinement algorithm [27]. It adds vertices to the CDT (used together with -p) or a previously generated mesh (used together with -r) to ensure that no tetrahedra have radius-edge ratio greater than 2.0. An alternative minimum radius-edge ratio may be specified after the q. For a too small ratio, e.g.,smaller than 1.0, TetGen may not terminate. (AspectRatio in our case)
  • -a Applies a maximum tetrahedron volume constraint. The -a switch imposes a maximum volume constraint on all tetrahedra. If a number follows the ’a’ , no tetrahedra is

generated whose volume is larger than that number. (MaxVolume in our case)

  • -V Verbose: Detailed information, more terminal output.


NETGEN is an automatic 3d tetrahedral mesh generator. It accepts input from constructive solid geometry (CSG) or boundary representation (BRep) from STL file format. NETGEN contains modules for mesh optimization and hierarchical mesh refinement (

How is Netgen implemented in Gimias? A Netgen implementation of the surface data entity is available in gimias (the same as vtkPolyData). when an algorithm that uses netgen is called the implementation of the data entity is automatically switched to the netgen representation. The user can specify the mesh size function by the global parameter maximal mesh size, and can additionally restrict the mesh size in points or cubes. The function NgGenerateVolumeMesh generates the volume mesh starting from the surface and from the parameters:

// maximal mesh size
double maxh;
// safty factor for curvatures (elemetns per radius)
double curvaturesafety;
// minimal number of segments per edge
double segmentsperedge;
Default values are: 3.0, 0.2, 0.2;

Volume Closing

Description: Close/fill the holes in a surface mesh.

Author: Chiara Riccobene,Albert Sanchez


This tool can be accessed through the menu Tools->Basic Surface Editing->Volume Closing. The user has the option to fill every hole in the mesh or to select the hole he wants to fill in (options “Close all” and “Choose Hole”). The output can be the surface mesh + the patches that have been computed or only the patches (option “Patch output only” ). The user can finally choose between different methods of hole filling in order to find the one that fits better his needs (default method SmoothToCenter).

Volume Closing GUI
  • SINGLE CENTERPOINT: A single point is added in the center and then triangles are created to cover the hole (see Figure 4.14a).
  • RADIAL TRIANGLES: A series of points are added in each radius from the center (see Figure 4.14b).
  • LINEAR TO CENTER NONREDUCING TRIANGLES : A series of linearly distributed concentric coronas with the same number of points (see Figure 4.14c).
  • LINEAR TO CENTER: A series of linearly distributed concentric coronas decreasing the number of points towards the center (see Figure 4.14d).
  • SMOOTH TO CENTER: A series of roundedly distributed concentric coronas decreasing the number of points towards the center (default) (see Figure 4.14e).
  • SMOOTH PATCH: Under development, it’s implemented but the result is not always corect as you can see in Figure 4.14f
  • CLOSE REFINER FAIRER: based on the method described in 1 three steps are performed, closing the hole, then refining and fairing the patch (working only with option “close all” and for flat holes) (see Figure 4.14g)
Volume Closing GUI

Surface Selector

Description: Local editing of a surface mesh for smoothing or refinement

Author: Chiara Riccobene


You can enable the surface selector through the corresponding Icon in the Interactors Toolbar or through the menu option Tools->Selection->Surface

Surface Selector GUI and Toolbar direct access

In the Selection Toolbox different options will appear, all of them use the CTRL + Left Mouse Button interaction, you can also choose if you want to select or to unselect:

  1. TriangleSelect: allows the user to select/unselect triangle by triangle (see Figure 4.16a).
  2. SphereSelect: allows the user to select/unselect a circular region, using a sphere that grows dragging the mouse (see Figure 4.16b).
  3. BrushSelect: allows the user to select/unselect a region with a brush of defined radius, by dragging you will create a path with your brush, the size is given in function of the point unit of the mesh, it can be changed with the combobox on the right (see Figure 4.16c).
  4. Combination of different options: allows the user to change the selection type during the selection of a specific region.
Surface selection tools

Once the selection is made, one of the tools listed in the section Select Tools can be applied (a new mesh is created so that it is possible to “undo” the operation).

  • Remove Cells option, it removes the selected cells.
  • Local Refiner option, it refines the selected cells introducing points and new triangles. In figure 4.17b the blue triangles are the new ones.
  • Taubin Smooth option, it smooths the selected cells.
Mesh editing tools applied on selections

Manual Neck Cutting

Description: Cut the neck of an aneurysm using a set of points.

Author: Hector Fernandez


  • Shift + Left mouse button: Select the points
Manual neck cutting

Go back to Users