Geometric Reconstruction¶
Introduction¶
In this section the surface representation of the tissue of interest (.stl) is used to construct the geometric representation of that tissue. The STL file is the output of the segmentation procedure in raw and unfiltered state. First a brief introduction to the software and tools that you will be using is proposed. Next, in the Tissue Specific Procedure a guideline is presented for reconstruction of each tissue of interest.
Prerequisite¶
MeshLab: MeshLab is a free and open source software for processing and editing 3D triangular meshes. It provides a set of tools for editing, cleaning, inspecting, texturing and rendering of unstructured large 3D triangular meshes. It offers features for processing raw data produced by 3D digitization tools/devices (e.g. 3D Slicer) and for preparing 3D models https://www..meshlab.net/ .
Loading Data into MeshLab¶
Input: Triangulated Surface representation of the tissue of interest in stl format (.stl).
- Click
File > Import Mesh
- Select the desired .stl file. You can select multiple non-contiguous files by holding
Ctrl
or selecting contiguous ones by holdingShift
. - Click
Open
.
Notes¶
1. There is no Undo
in MeshLab. Please save your work frequently and after every successful step, before losing it during program crashes (which unfortunately occurs a lot!) or applying a
wrong filter!
2. In the toolbar panel on top of the MeshLab main interface, click on the Show Layer Dialog
button, a layer dialog will pop up on the right side of the window. You can get plenty of
information about the project from this dialog.
- On the upper part you have a list of all files/meshes you have already loaded into MeshLab, the highlighted one in this section is the current layer. This is important since some of the operations of the MeshLab work only on the current layer. You can change the visibility of a layer by clicking on the eye icon next to each layer. If you keep
Ctrl
button and then select the visibilty of a layer, all other layers will be switched off and the only visible one is the one you selected.- In the middle part you can handle visualization and rendering modes of meshes. You can manage color, size and shading/lighting of points, edges and faces in each layer or you can apply your desired settings to all visible layers by checking the
apply to all visible layers
box on bottom of this section.- The lower section is the feedback dialog. You can read there about all the things you have done, loaded and unloaded and also errors you have been encountered diring an operation.
Smoothing Procedure¶
In this section a couple of smoothing procedures will be described in detail and later, in the Tissue Specific Procedure section a guideline will be provided for each specific tissue.
Laplacian Smoothing¶
- Select desired mesh from the layer dialog panel.
- Go to
Filters > Smoothing, Fairing and Deformation > Laplacian Smooth
. - Set
Smoothing Steps
to whatever value is recommended in the Tissue Specific Procedure section for your desired tissue. - Make sure the
Affect only selected faces
box is unchecked. - Click
Apply
.- Before hitting the
Apply
button you can check thePreview
box to see how the smoothing will affect the mesh.
- Before hitting the
Surface Reconstruction¶
- Select desired mesh from the layer dialog panel.
- Go to
Filters > Remeshing, Simplification and Reconstruction > Surface Reconstruction: VCG
. - Alter
Voxel Side
,world unit
. Try different values, smaller number means less smoothing. It is recommended to setworld unit
value to a meaningful one relative to the original image resolution (e.g. for cartilage specific images with a resolution of 0.35 x 0.35 x 0.7 mm, use a world unit between 0.35 and 0.7 mm). - Select
Post Merge Simplification
. - Click
Apply
.
Taubin Smoothing¶
Taubin Smoothing procedure is very useful for smoothing vertices/nodes at sharply curved model edges.
- Select desired mesh from the layer dialog panel (It is better to select parts of the mesh with sharped edges, guideline for selection is provided in Selecting Procedure section).
- Go to
Filters > Smoothing, Fairing and Deformation > Taubin Smoothing
. - Select
Preview
to interactively display current smoothing parameters. - It is suggested to set
Lambda
andmu
to their default values (0.5 and -0.53 respectively). Alter them to get the best result.``Lambda`` should usually be between 0.3 to 1.2 to prevent having jagged meshes. - Click
Apply
.
Iso Parametrization¶
- Before starting the
Iso Parametrization
procedure make sure that you have saved your work up to this point. - Select desired mesh from the layer dialog panel.
- Go to
Filters > Remeshing, Simplification and Reconstruction > Iso Parameterization
. - Use the default settings and click
Apply
.
- Note: Sometimes, the Iso Parametrization will fail and cause Meshlab to crash. If this occurs:
- Deselect
Double Step
box in theIso Parametrization
window and clickApply
. - Or try an increased amount of smoothing (using Laplacian Smoothing or Surface Reconstruction) and/or Downsizing.
- Deselect
- After successfully applying the
Iso Parametrization
, navigate toFilters > Remeshing, Simplification and Reconstruction > Iso Parameterization Remeshing
. - Try default
Sampling Rate
= 10. Alter theSampling Rate
if it is needed (a higher number of sampling rate creates a higher density triangular surface mesh). - Click
Apply
.
Selecting Procedure¶
To select a specific portion of surface there are different tools you can use:
- Click on
Select Faces in a rectangular region
icon in the toolbar panel on top of the MeshLab main interface. With this tool you can select faces in a rectangular region. This tool select visible and invisible faces in this rectangular region (if you turn your model you will see that it has also selected all the faces on the other side of the model in this rectangular region). it takes a little bit of exercise to make the right selection of faces. You have to play with navigation to put the model in the proper position to make the right selection.- If during the selection process you wanted to move the model to a more suitable position to see other sides of the model, press
Esc
button to switch to navigation mode. Now you can rotate the model. To switch back to selecting tool, pressEsc
button again. If you want to exit from the selecting tool permanently you have to click again on its icon in the toolbar panel. - If you press
Ctrl
key, a plus sign will apear next to the mouse cursor. Now you can add new selection to the one that has been previously made. - If you press the
Shift
key, a minus sign will apear next to the mouse cursor. Now you can subtract part of already selected region.
- If during the selection process you wanted to move the model to a more suitable position to see other sides of the model, press
- Click on
Z-painting
tool in the toolbar panel. A window will pop up. On the left side of the window click on the red head brush and click on the surface of the geometry you want to paint. you can adjust brush size using theSize
widget. Paint tool only select visible surfaces and also you don not need to hitCtrl
key to select multiple regions. It automatically adds new selection to previous one. - Under
Filters
menu there is a submenu devoted only to selections. There are several ways to select desired regions in a mesh processing style rather than directly interacting with the model and manually tuning it. Their names usually explains their action so they are easy to implement. For example, if you have small disconnected fragments of stl in your model, go toFilters > Selection > Select small disconnected component
.
Downsizing¶
In order to simplify the mesh by reducing number of faces:
- Go to
Filters > Remeshing, Simplification and Reconstruction > Quadric Edge Collapse Decimation
. - It is suggested to change the visualization mode to flat lines (click on
Wireframe
icon in the toolbar panel) to see the density change of the triangles. - Change the
Quality threshold
. The higher the value is, your original model’s shape will be preserved. Suggest value is 0.4. - Click
Apply
.
Cleaning and Repairing¶
After performing all the smoothing process, we have to make sure that the model is manifold (all edges have exactly two incident triangles. All vertices have exactly one cycle of incident triangles. All triangles in the mesh are consistently oriented).
In the visualization and rendering modes section (middle part of layer dialog), click on the Edge decorators
icon (last icon from the right). A list of On
and Off
switches will appear. Switch on the No-Manif Verts
and
Boundary Edges
. A box will pop up in the top left corner showing how many of each of these exist in the model. If the numbers are zero skip to step 7 otherwise:
1. Switch on
No-Manif Edges
as well.2. Area relating to these vertices and edges will be highlighted in the model. if you can not see the highlighted area, go to
Filters > Selection > Dilate Selection
, it will expand the current set of selected faces.3. Use your preferred selection tool from the Selecting Procedure section and select all the highlighted regions.
4. Select
Delete the current set of selected faces and all the vertices surrounded by that faces
.5. Again, check the number of
No-Manif Verts
. If it is zero go to the next step to close the holes, otherwise:
- The remaining
No-Manif Verts
are the orphan nodes, to delete them go toFilters > Cleaning and Repairing > Remove Unreferenced Vertices
.6. Go to
Filters > Remeshing, Simplification and Reconstruction > Close Holes
. Leave default options and clickApply
.7. Go to
Filters > Cleaning and Repairing > Merge Close Vertices
. Change theworld unit
for theMerging distance
based on how close the model’s vertices should be. Use very small values (suggested value is 0.001). ClickApply
.8. Go to
Filter > Normals, Curvatures and Orientation > Re-Orient all faces coherently
. This modification is beneficial to the 3D meshing procedure. To see normals of faces navigate toRender > Show Normal
Exporting Data from MeshLab¶
To save your work:
- Select your desired layer from the layer dialog panel and go to
File > Export Mesh As
. - Navigate to the desired directory for saving the mesh. Change the file type to
stl
format and hitSave
. - A window will pop up. Leave the default settings and click
OK
.
Tissue Specific Procedure¶
In the table below the specific order of smoothing procedures for each tissue and also the parameters related to each of these smoothing steps has been provided. It is required to perform the Cleaning and Repairing procedure after doing all the smoothing steps below.
Tissue Name | 1. Laplacian Smoothing | 2. Surface Reconstruction | 3. Taubin Smoothing | 4. Iso Parametrization |
---|---|---|---|---|
Tibia Femur | 20 | 0.7 | 0.5; -0.53 | 10 |
Patella | 20 | 0.5 | 0.5; -0.53 | 7 |
Fibula | 20 | 0.5 | 0.5; -0.53 | 5 |
Tibial Cartilage | 20 | 0.35 | 0.5; -0.53 | 10 |
Femoral Cartilage | 20 | 0.35 | 0.5; -0.53 | 15 |
Patellar Cartilage | 20 | 0.35 | 0.5; -0.53 | 10 |
Meniscus | 20 | not needed | not needed | 8 |