Skip to content
Philipp Schlegel edited this page Sep 20, 2017 · 1 revision

CATMAID-to-Blender - Basic Usage

(written for Blender V2.78 and Plugin V5.6)

In this tutorial you will learn step-by-step how to import neurons, set up a scene and do a first rendering. I will keep it very basic but if you have never used Blender before, I recommend watching a tutorial on how to use Blender first (e.g. here)

A general note before we begin: Hovering over any button or entry field will bring up a (hopefully) helpful tooltip

Prerequisites

Please make sure that you have properly installed and configured the CATMAID-to-Blender plugin. If not, please see here for instructions.

1. Importing neuron(s)

When you start Blender, it should look something like this. You will find the CATMAID-to-Blender plugin in the Scene tab (red arrow) under CATMAID Import.

screen shot

By default, most of the buttons of the plugin's panel are greyed-out - this is because you have to click Connect to CATMAID first.

Once you have done that and the connection was successful, all buttons should have become available. In order to import neurons click on Import Neuron(s). In the pop-up dialog you then specify which neurons you want to import. You can search for neurons' names, annotations or skeleton IDs. For this tutorial, the most relevant import options are: import synapses and resampling. The former sets whether to import synapses or just the neuron(s). The latter down-samples the neurons by the given factor (speeds up rendering when dealing with loads of neurons). In this example, I am importing neuron(s) annotated with "MVP2" without synapses and downsampling by factor of 6.

screen shot 2017-03-13 at 11 40 12

Clicking on OK will start the import:

screen shot 2017-03-13 at 11 51 25 screen shot 2017-03-13 at 11 51 38

Depending on your CATMAID project's setup, the neurons may have been created outside of the default field of view. Use the mouse wheel to zoom out and middle mouse button to rotate and middle mouse + shift to pan to find them!

screen shot 2017-03-13 at 11 57 22

2. Setting up the scene

There are many ways to skin a cat, so the following is just one way to get a nice render for you neuron(s). First, select the light and the cube (not the camera) that came with the default scene by right-clicking and then hit X or DEL to delete them.

Next, we have to center the camera on our neuron(s). That's because later, we will not render the viewport but rather the point of view from the camera. To do so, either select your neurons, hit space and type in Camera Fit Frame to Selected to focus the camera on your neurons (see screenshot). Alternatively, select the camera by right-clicking and move it manually to the desired position (G (= grab) to move the camera, R to rotate).

screen shot 2017-03-13 at 12 06 37

To check if the camera is in the right position, either click on View -> Cameras -> Active Camera or hit 0 on your numpad. This will bring up the camera's perspective.

screen shot 2017-03-13 at 12 10 06

If you hit F12 or go to Render -> Render Image, you will notice that the neuron is all black with a ugly dark grey background. That is mostly because there is no lighting in our scene. Let's fix that! Press escape to return to the 3D view.

screen shot 2017-03-13 at 12 20 31

If you have more than one neuron, you may want to consider properly randomising their colours by clicking Randomize Color in the CATMAID-to-Blender panel.

screen shot 2017-03-13 at 12 29 20

Next, we need to make some changes to the neuron(s)' materials by clicking on Change Materials in the plugin's panel. Please make changes in the pop-up dialog according to the following screenshot:

screen shot 2017-03-13 at 12 35 42

Emit makes the neurons emit light (so that we can see them at all), Thickness increases their diameter, increasing their visibility. Transparency and Alpha are important for another effect, we will bring in next. If you render the scene again (F12 or Render -> Render Image), it should look something like this:

screen shot 2017-03-13 at 12 38 22

Not too impressive yet. The next step assumes that you have some sort of volume for your CATMAID project that we can import. Go to the plugin pane, click on Import Volume, select a volume and hit OK.

screen shot 2017-03-13 at 12 46 38

After a few seconds, the volume should show up. With the volume selected, hit Space and type in Shade Smooth to make the mesh a bit smoother. To further improve it, go to the Modifier tab and add a Subdivision Surface modifier.

screen shot 2017-03-13 at 12 49 52

Next, keep the mesh selected and go to the Materials tab, add a New Material and set the Emit value to 1. Depending on the size of your mesh, you may want to reposition the camera now.

screen shot 2017-03-13 at 12 53 24

A few last tweaks: go to the Render tab. Change the Resolution to 100%. In Shading change Alpha to Transparent - this will give us a transparent background. In Post Processing check Edge and set Threshold to 50 - this will give a schematic look by drawing the outlines of the volume. Depending on your volume, you may have to adjust that value (higher threshold will draw finer details).

Your render should now look somewhat like this. As you can see, our neuron vanishes in the volume of the neuropil. There are two ways to deal with this problem. One is to use layers to render neurons + volume separately and stitch them back together during compositing - this gives you more control on lighting + shadows and is faster during render, but is a bit more complicated to set up. For now, we will take the easy way out.

screen shot 2017-03-13 at 13 02 35

Go back to the material of your mesh. Check Transparency and Raytrace, and set Alpha to 0.1

Your final render should now look something like this. Use F3 to save a PNG. screen shot 2017-03-13 at 13 16 36