Skip to content

Making and Exporting Meshes

Philipp Schlegel edited this page Sep 20, 2017 · 3 revisions

CATMAID-to-Blender - Making Meshes in Blender and Exporting to CATMAID

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

In this tutorial you will learn step-by-step how to generate and export meshes to CATMAID. As typical example, we will generate a mesh for a single glomerulus of the antennal lobe from a set of projection neurons.

If you haven't yet, I strongly recommend checking out the Basics tutorial first.

Prerequisites

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

1. Importing neuron(s)

First, import the neurons you wish to make meshes from. In our case, we will use the projection neurons of the DA1 glomerulus.

screen shot 2017-03-13 at 11 51 25

2. Merging neurons

If making meshes based on multiple neurons, you will first have to merge them into a single object. To do so, select all neurons (excluding their somas) by hitting B and drawing a selection rectangle or by shift-clicking them individually. Then either go to Objects-->Join or use the shortcut CTRL-J.

screen shot 2017-03-13 at 11 51 25

3. Trimming the neuron(s)

Next, we have to trim the neuron(s) down to the bits that we want to make a mesh of. In our case, we want to keep the dendrites:

First, go to Edit Mode or hit TAB while having the neuron(s) selected.

screen shot 2017-03-13 at 11 51 25

Now we have to select the nodes that we want to cut off. Either use the B key which we have previously used to draw a selection rectangle or use the C key to "paint" a selection.

screen shot 2017-03-13 at 11 51 25

To delete the selected nodes just hit X or DEL and confirm that you want to delete the vertices.

4. Converting from curve to mesh

Neurons are created as curve objects but we need meshes. To convert, simply click Objects-->Convert to-->Mesh from Curve/Meta/Surf/Text or press ALT-C.

screenshot

Pro-Tip: for big/complex neurons, we can reduces the number of vertices by reducing surface- and bevel-resolution in the Object data panel prior to conversion.

5. Generating the mesh

Next, we will generate a mesh that to fit around our glomerulus. Go to Add-->Mesh-->Ico Sphere.

screenshot

Move the sphere such that it roughly centres on the glomerulus and scale it such that it is slightly bigger than the glomeruli (shortcut: S).

screenshot

Tip: You should use a mesh with a shape that already bears resemblance to your final product. This includes e.g. scaling the mesh along single axis to make it fit better. In those cases, just make sure that the resolution of your mesh (i.e. the vertex density) is homogenous.

6. Fitting the mesh

Now we have to make the mesh fit the glomerulus. Go to the Modifiers panel and add a Shrinkwrap modifier.

screenshot

Select our neuron object as Target.

screenshot

You can play around with the settings to make it fit better. Sometimes its worth it adding a Subdivision modifier to make the mesh fit tighter.

Before we can go on, we have to apply the modifier(s). Be aware that the order in which you apply the modifier matters!

screenshot

7. Uploading the mesh

This is super simple: go to the Blender-CATMAID plugin and click on Export Volume. Choose a name and optionally add a comment and hit OK. You may have to reload the 3D widget in CATMAID for the list of volumes to refresh.

screenshot