Introducing 3D meshes for segmentations in webKnossos

Norman Rzepka
WEBKNOSSOS
Published in
3 min readJul 19, 2021

--

We recently added support for pre-computed meshes that load near-instantly to webKnossos. Meshes are a great way to visualize instance segmentations as 3D objects. They are useful for creating expressive figures or navigating the data in 3D space. In this article, I will explain how to work with segmentation meshes in webKnossos.

Visualizing two automatically segmented neurons as 3D meshes in webKnossos.

Visualizing pre-computed meshes

For datasets that already have pre-computed meshes (in a mesh file), you can right-click on any segment and click “Load precomputed mesh” in the context menu. If you don’t have a dataset handy, you can try it with this Mouse Cortex dataset. Alternatively, you can open up the “Meshes” tab on the right and click to load the mesh at the center of the viewports.

The meshes will be loaded in a chunk-based manner and will be visible in the 3D viewport in the lower right. Click the maximize button in the top right of the viewport for a larger view. Alternatively, you can maximize the viewport by hovering your mouse over the viewport and pressing the dot key on your keyboard.

The maximized 3D viewport is great for creating quick pictures of the meshes. Press “Q” on your keyboard to capture the current scene in an image file. There is a settings menu in the top right of the viewport where you can hide the dataset frame or orthogonal viewports.

Maximize the 3D viewport to take quick pictures of your meshes

Export meshes for other rendering software

In the “Meshes” tab, you can find a list of already loaded meshes. From there you can download each mesh in the industry standard STL format. Import these files into your favorite rendering software, such as Blender or Amira. With these tools, you will have more control over the rendering and can combine it with any other graphics that you may have.

Import the meshes into your favorite rendering software

Generate meshes from segmentations

You can also generate a mesh file for an existing segmentation that you have. The mesh file will contain all the segments as pre-computed meshes. The computation is a data-intensive operation that can take a few minutes or a few hours depending on the size of your data. The computation is running in the background on the server, so you don’t need to keep the dataset open the whole time. You can monitor the progress of the operation, by navigation to Admin > Processing Jobs in the top menu. Once the computation is done, you will be able to render your data in beautiful meshes and use all the features as explained above.

The mesh files are stored in a custom optimized format. Offline tools for generating mesh files will be available later.

Create meshfiles from your segmentation with a background job

Create a free account on webknossos.org today and try out the new mesh features. Check out our automated segmentation services, if you need help to create meshes from your raw microscopy data.

Image credits

  • Segmentations and meshes by scalable minds
  • Raw EM data, Mouse Cortex by Motta et al., Science, 2019

--

--