How to make great videos for biomedical microscopy data

Part 02 — Rendering beautiful animations with 3D meshes

Albane le Tournoulx de la Villegeorges
WEBKNOSSOS
3 min readDec 6, 2021

--

For this kind of animation (see below), you will need to download Blender, an open-source 3D animation and rendering software. You also need a good neuron reconstruction. Check out our automated segmentation services if you need help to reconstruct neurons from EM data.

Animation of a few reconstructed neurons with Blender.

Here is what you have to do:

Import meshes and adjust scene and materials

  1. Once you have the dense neuron reconstruction in webKnossos, your first goal is to download the 3D meshes you like as STL files. For this, open your reconstruction in webKnossos and go to the “Segments” tab in the right sidebar. Click on the three dots near the segment’s name. Alternatively, you can right-click on an annotation in one of the viewports, which will open the context menu. From there you can either compute or load the mesh. Once the mesh is loaded, it appears as a child under the segment. You can then download it as an STL.
  2. Import the STLs into Blender. In the import dialog, change the scale to .0001.
  3. Add a texture/material to the 3D model. Choose a color and reflectiveness for your material.
  4. Next, add a light source for shadows and highlights. Place a “sun” light into your Blender scene.
  5. Place the camera into the scene and arrange it to look at your objects. From the “Render” menu bar, select “Render image” to get a first idea of the result.
  6. Maybe change the background color, or some materials, and render images again until you are satisfied.

View the instructions step by step on YouTube:

Explanatory video: how to import STL files and adjust the scene and materials in Blender.

Set up animation and output settings

  1. Choose your first camera position. Check all the keyframes to lock the camera position & rotation at this frame (frame 0) and save them in the animation timeline.
  2. Move the time slider to change the current frame.
  3. Arrange the camera position at the next position
  4. Again, add all the keyframes for that new position to the animation timeline. Repeat as often as needed for different locations and angles.
  5. In Blender’s “Output Properties” tab, choose a name and location for your file. Set the file format to “FFmpeg Video” and select “MPEG-4” video encoding.
  6. From the “Render” menu, choose “Render Animation” to start the rendering of the video. Grab a cup of coffee and wait for it to finish. This may take a while depending on your computer, the amount of 3D models in the scene, and the video resolution. In the Blender “Render Properties”, select “Evee” as the rendering engine on Blender to save time. Enjoy the result!

For this part as well, instructions are available on YouTube:

Explanatory video: how to set up the animation and prepare the output settings.

Use your creativity for interesting animation ideas! For instance, here we chose a pair of neurons and zoomed in on their synaptic connections:

3D animation of 2 reconstructed neurons in Blender, zooming on two synapses.

In this example, we put the focus on an axon by giving it another color and followed it until a spine-head synapse:

3D animation of a few reconstructed neurons. The camera follows the red axon until a spine-head synapse.

Try these tips out and share your results with us on Twitter or Image.sc! Stay tuned for the next video tips, coming out in a few weeks: scripting camera movement in webKnossos.

--

--