Skip to main content

Mesh

Introduction

NiiVue can simultaneously show voxels and meshes. It can view three different classes of meshes: triangulated meshes, connecotmes and streamlines. These different classes have different properties and are stored in different formats. This page describes these classes.

alt tag

The image above is from a NiiVue live demo. It shows a grayscale voxel-based image with a red voxel-based overlay. It also shows all three classes of meshes: the green cortical surface is a triangulated mesh, with a statistical overlay shown in orange. The ball and stick connectome is also visible. Finally, a blue streamline tract is visible. These three classes are illustrated in the figure below

alt tag

Triangulated Meshes
  • Triangulated meshes are based on vertex locations as well as indices that group the vertices into discrete triangles. Vertices are often reused by multiple triangles: in the figure above v1 and v2 are each used by two triangles.
  • NiiVue never adjusts the position of triangulated mesh vertices.
  • The winding order of the indices discriminates the front from the back face. Therefore, the front face of the triangle 0,1,2 is the back face for 0,2,1. NiiVue assumes a counter clockwise winding order.
  • Triangulated mesh color can be influenced by overlays, which specify the scalar intensity (e.g. statistical map) or red/green/blue color of each vertex. The NiiVue mesh atlas live demo allows the user to interactively adjust the transparency of two overlays on a single mesh: an atlas as well as a statistical map.
  • Supported mesh-based formats: GIfTI, ASC, BYU/GEO/G, BrainSuite DFS, ICO/TRI, PLY, BrainNet NV, BrainVoyager SRF, FreeSurfer, MZ3, OFF, Wavefront OBJ, STL, Legacy VTK, X3D.
  • Supported mesh overlay formats: GIfTI, CIfTI-2, MZ3, SMP, STC, FreeSurfer (CURV/ANNOT).
Connectomes
  • Connectomes are ball and stick figures that represent nodes (spheres) and the edges (cylinders) that connect them.
  • NiiVue extrudes the node location and edge weights to triangulated spheres and cylinders - the diameter of these structures can interactively adjusted. The sliders for the connectome live demo demonstrates how NiiVue will dynamically scale these features.
  • The color and size of connectome nodes and edges can be based on scalar values, for example statistical test scores. In the image above, the edge color is determined by edge strength, and node color by overlay color. Note the edge strength is shown as a matrix that maps the link weight between each node and all others using the upper triangle.
  • The pointset live demo shows how connectome features can be added and removed.
  • NiiVue uses a simple JSON format to represent connectomes.
Streamlines
  • Streamlines are used for tractography data.
  • Streamlines can either be drawn as single-pixel lines, or extruded to triangulated cylinders. The radius slider of the tract live demo shows how NiiVue dynamically scales the diameter.
  • Each vertex of a streamline can be assigned a color based on the global direction, local direction, group, per-vertex or per-streamline properties. The tract group live demo showcases these properties.
  • The TrackVis TRK format is popular. However, it uses voxel corner to specify coordinates, rather that the typical voxel center or world space coordinates. While nibabel, Surfice and NiiVue follow this convention, be aware that other tools (included DSI Studio) use voxel centers. This means that TRK files created by one tool can appear shifted by half a voxel in other tools. A validation dataset is available.
  • Supported streamline-based formats: TCK, TRK, TRX, TT, VTK, AFNI .niml.tract
  • Overlay properties are commonly embedded inside TRX and TRK format streamlines, but can also be loaded from separate TSF files.