Skip to content

Mesh Reconstruction

marwan-abdellah edited this page Oct 1, 2021 · 10 revisions

Mesh Reconstruction Panel

This panel gives access to the parameters of the Meshing toolbox. This toolbox is used to reconstruct polygonal mesh models - a collection of vertices, edges and faces that represent the shape of a polyhedral object in the three-dimensional space - that reflect the membrane surface of the neurons from their morphological skeletons.

Panel Description

When all the meshing parameters are set, a neuronal mesh can be reconstructed by clicking on the button Reconstruct Mesh. Once the mesh is reconstructed, it will appear in the principal three-dimensional view port of Blender. The mesh can be then rendered to image by clicking on the different views buttons: Front, Side, or Top. We can also render a 360 movie of the reconstructed mesh by clicking on the 360 button. Finally, the mesh can be exported to different file formats such as .obj, .ply, .stl and .blend files.

User Interface

Reconstruction Methods

The current version of VessMorphoVis implements the following meshing algorithms:

  1. Piecewise Watertight Meshing
  2. MetaBalls Meshing

Piecewise Watertight Meshing

The piecewise wateright meshing is proposed by Abdellah et al, 2017. This method reconstructs a single mesh object that is composed of a set of watertight meshes, each corresponding to an individual component in the original morphology skeleton. For example, breadth-first traversal is used to connect and construct primary sections along each arbor in the form of tubes. These tubes are converted into watertight meshes that by definition have non-manifold edges or vertices. The grouping of the reconstructed meshes results in the final mesh object that is not watertight per se, but rather piecewise-watertight.


A vascular mesh created with the piecewise-watertight-based meshing algorithm.

MetaBalls Meshing

In general, Meta objects are implicit surfaces, meaning that they are not explicitly defined by vertices (as meshes are) or control points (as surfaces are): they exist procedurally. The fundamental feature that makes meta objects significant is their ability to blend, i.e. when two independent meta objects are getting closer to each other, they start to interact and blend together into a single object. This algorithm is capable of handling highly complex branching scenarios avoiding to create intersecting geometry that is common in other meshing algorithms, for example skinning with skin modifiers. In this algorithm, we build a meta object of the neuron morphology using meta balls and convert it to a mesh in the final stage. The resulting mesh is guaranteed to be two-manifold, but it might contain self intersections based on the meta resolution used to convert the meta object into a mesh.


A vascular mesh created with the meta-balls-based meshing algorithm.

This technique can be set in the configuration file as follows:

# Meshing technique
MESHING_TECHNIQUE=meta-balls

Normally, meshes created with the MetaBalls algorithm have high polygon counts and bumpy effects. Therefore, it is advisable to use the tessellation option to reduce the number of polygons in the final mesh and remove these bumps.

Tessellation

We added an option to allow controlling the tessellation level of the mesh in case the mesh has too many polygons. If checked, this option will apply a tessellation modifier on the mesh to reduce the number of polygons in the mesh. To contro the tessellation, you can select the tessellation factor from the Factor slider. The acceptable range of this parameter is 0.99 and 0.1.

Rendering Resolution

VessMorphoVis has support to set the resolution of the rendered images either to a fixed resolution or based on the dimensions of the morphology skeleton. The later option is mandatory for images required for scientific articles. It allows users to render images to scale and overlay a scale bar on the top of the image.

Fixed

The resolution of the image is defined by two parameters (width and height) in pixels, however, VessMorphoVis forces the users to define the resolution of the image using a single parameter to avoid rendering an image with distrorted aspect ratio.

This option can be set in the configuration file as follows:

# Renders a frame to scale 
RENDER_TO_SCALE=no


# Frame resolution, only used if RENDER_TO_SCALE is set to no 
FRAME_RESOLUTION=4000

To Scale

Before rendering the reconstructed mesh into an image, the three-dimensional bounding box (width, height and depth) of the mesh is automatically computed and the resolution of the image is defined based on 1) the bounding box of the mesh and 2) the rendering view. For example if the bounding box of the mesh is 100 x 200 x 300 and a front view is rendered, then the resolution of the image will be set automatically set to 100 x 200. If the side view of the mesh is rendered, then the resolution of the image will be set to 200 x 300 and finally if the top view is rendered, then the resolution of the image will be set to 300 x 100. If the user wants to render an image to scale, then option To Scale must be selected. In this case, each pixel will correspond in the image to 1 micron, and the resolution of the image is limited to the dimensions of the morphology. To render higher resolution images, however to scale, we have addedd support to scale the resolution of the image using a scale factor that is defined by the user. When the user select the To Scale option, the Scale Factor slider appears below to give the user the control to select the most approriate scale factor that fits the objective ultimate objectives of the image. By default, the scale factor is set to 1. Note that increasing the scale factor will make the rendering process taking longer O(NXM). A convenient range for the scale factor is 3-5.


Rendering the same vascular mesh to scale with multiple scale factors. From left to right: 1.0, 2.0, 4.0 and 8.0. Users can easily overlay a correct scale bar on top of the image.

This option can be set in the configuration file as follows:

# Renders a frame to scale 
RENDER_TO_SCALE=yes


# Frame resolution scale factor, only used if RENDER_TO_SCALE is set to yes 
RESOLUTION_SCALE_FACTOR=4000

Camera View

Users can render the following camera views of the mesh:

  • Front
  • Side
  • Top

This option can be set in the configuration file as follows:

# Camera view
CAMERA_VIEW=front

Rendering Animation

VessMorphoVis can render 360 sequences for the reconstructed vascular meshes.


A 360 sequence of a reconstructed vascular mesh.

This option can be set in the configuration file as follows:

# Render a 360 sequence of the mesh, default 'no'.
# Use ['yes' or 'no']
RENDER_MESH_360=yes

Mesh Export Options

Users can exploit the native support of Blender to export meshes into different file formats. But since we assumed that end users might not have any Blender experience, we have added explicit support to allow them exporitng the reconstructed meshes into the following common file formats:

  • Wavefront (.obj) The OBJ file format is a simple data-format that represents 3D geometry alone — namely, the position of each vertex, the UV position of each texture coordinate vertex, vertex normals, and the faces that make each polygon defined as a list of vertices, and texture vertices. Further details about this file format can be found here.

  • Stanford (.ply) PLY is a file format known as the Polygon File Format or the Stanford Triangle Format. It was principally designed to store three-dimensional data from 3D scanners. The data storage format supports a relatively simple description of a single object as a list of nominally flat polygons. A variety of properties can be stored, including: color and transparency, surface normals, texture coordinates and data confidence values. The format permits one to have different properties for the front and back of a polygon. Further details about this file format can be found here.

  • Stereolithography CAD (.stl) The STL file describes a raw, unstructured triangulated surface by the unit normal and vertices (ordered by the right-hand rule) of the triangles using a three-dimensional Cartesian coordinate system. Further details about this file format can be found here.

  • Blender Format (.blend) The exported file can be opened only in Blender and can be used for rendereing purposes.

The exported meshes will be generated in the meshes directory underneath the output directory that is set by the user in the Input / Output panel.

Note If this path is not set, the user will get this error message Output directory is not set, update it in the Input / Output Data panel. In this case, the user must toggle the Input / Ouput panel and update the Output Directory by replacing Select Directory in the output options by an existing path on the file system.

References

  1. Abdellah et al. "Interactive visualization and analysis of morphological skeletons of brain vasculature networks with VessMorphoVis." Bioinformatics (2020): In press.

  2. Abdellah et al. "NeuroMorphoVis: a collaborative framework for analysis and visualization of neuronal morphology skeletons reconstructed from microscopy stacks." Bioinformatics 34.13 (2018): i574-i582.

  3. Abdellah et al. "Reconstruction and visualization of large-scale volumetric models of neocortical circuits for physically-plausible in silico optical studies." BMC bioinformatics 18.10 (2017): 402.

  4. Blender documentation, MetaBalls.


Navigation