Skip to content

Morphology Reconstruction

abdellah edited this page Apr 9, 2020 · 94 revisions

Table of Contents

Morphology Reconstruction & Visualization

This panel gives access to the parameters of the Morphology Reconstruction Toolbox. By reconstruction in the context, we mean drawing a three-dimensional skeleton from a morphology file that was originally reconstructed from an optical microscopy stack.

What is a Morphology Skeletion?

Neuronal morphologies are reconstructed from imaging stacks obtained from different microscopes. These morphologies can be digitized either with semi-automated or fully automated tracing methods. The digitization data can be stored in multiple file formats such as SWC and the Neurolucida proprietary formats. For convenience, the digitized data are loaded, converted and stored as a tree data structure (a data structure representing the dendrogram).

Morphology Components

The skeletal tree of a neuron is defined by the following components: a cell body (or soma), sample points, segments, sections, and branches. The soma, which is the root of the tree, is usually described by a point, a radius and a two-dimensional contour of its projection onto a plane or a three-dimensional one extracted from a series of parallel cross sections. Each sample represents a point in the morphology having a certain position and the radius of the corresponding cross section at this point. Two consecutive samples define a connected segment, whereas a section is identified by a series of non-bifurcating segments and a branch is defined by a linear concatenation of sections.

Neuronal branches are, in general, classified based on their types into

  • axons,
  • apical dendrites and
  • basal dendrites.


A schematic view of a neuronal morphology skeleton.

Note that the three-dimensional profile of the soma that is reconstructed in this skeleton - if requested - is based on the parameters set in the Soma Toolbox panel.

Why this Toolbox?

There are various packages that have been developed to analyze and visualize different formats of neuronal morphology skeletons. Free and open source packags are quite limited in their functionality and some of them require installing multiple software dependencies that might make them cumbersome and hard to use. Non-free or proprietary solutions might not be affordable in certain cases and they are only focused on morphology visualizatin. NeuroMorphoVis close the gap and presents a free framework for advanced visualiztion of the morphologies, visual analysis, mesh generation of neuronal membranes and high quality rendering for scientific publications, all integrated in a single tool.

For the record, we list other packages that are used to analyze and visualize morphology skeletons.

Morphology Analysis Tools

Morphology Visualization Tools

User Interface

Opening the Morphology Reconstruction Toolbox

When you toggle (or click on) the Morphology Toolbox tab highlighted above, the following panel, or a similar one depending on the version of NeuroMorphoVis, will appear.

Morphology Reconstruction Method

NeuroMorphoVis has support to reconstruct (or draw) neuronal morphologies using various methods including:

  • Disconnected Sections
  • Disconnected Segments
  • Connected Sections
  • Articulated Sections
  • Progressive
  • Samples
  • Dendrogram


We implemented in NeuroMorphoVis different algorithms for visualizing neuronal morphologies. The skeleton is visualized as a set of disconnected segments shaded in alternating colors (black and white) in (A) and using the same colors for each component in (B), where each segment is represented by a tapered cylinder along its two samples. (C) The skeleton is visualized as a set of disconnected sections, where each is drawn as a single polyline. (D) For comparative studies, we implemented a similar method to neuroConstruct where the different sections are joint using uniform spheres (in yellow) (Gleeson et al., 2007). (E) The skeleton is visualized as a set of connected sections, where all the sections that belong to the same branch are drawn as a single polyline object. (F) The skeleton is visualized as a joint object where all the neurites are connected to the soma that is represented by a uniform sphere whose radius is set to the mean of the soma. (G) The soma is reconstructed on a physically plausible basis and connected to all the arbors, and the entire morphological skeleton is integrated into a single object. In (B–G), the soma, basal dendrites and axon are colored in orange, red and light blue, respectively.

The method can be selected in GUI from the Method drop down list under the reconstruction options as shown below.

The morphology reconstruction method can also be set in the configuration file as follows:

## Morphology reconstruction method   
MORPHOLOGY_RECONSTRUCTION_ALGORITHM=disconnected-sections

Disconnected Sections

The morphology skeleton is drawn as a list of sections, where each section is an independent object that is disconnected from the neighboring sections. The section object is a polyline composed of a list of samples. Note how each section is assigned a different color in the following image.

This mode can be set in the configuration file as follows:

# Morphology reconstruction method
MORPHOLOGY_RECONSTRUCTION_ALGORITHM=disconnected-sections

Disconnected Segments

Each segment in the morphology is drawn as an independent object that is disconnected from the neighboring segments. The segment is a simplified polyline reconstructed from connecting two samples only along the section. This drawing scheme is very useful to visualize and debug the sampling of every section. Note how the segments in the morphology are assigned alternating black and white colors in the following image.

This mode can be set in the configuration file as follows:

# Morphology reconstruction method
MORPHOLOGY_RECONSTRUCTION_ALGORITHM=disconnected-sections

Connected Sections

This method draws the morphology as a series of connected sections like a stream from the root section to the leaf on every arbor.

This mode can be set in the configuration file as follows:

# Morphology reconstruction method
MORPHOLOGY_RECONSTRUCTION_ALGORITHM=connected-sections

Articulated Sections

This mode is similar to the Disconnected Sections method, but between every two sections a sphere is inserted as an articulation.

This mode can be set in the configuration file as follows:

# Morphology reconstruction method
MORPHOLOGY_RECONSTRUCTION_ALGORITHM=articulated-sections

Progressive

This mode visualizes the progressive generation of the arbors from the soma.

To visualize the progressive reconstruction of the neuron, select the Progressive mode from the Methods menu, and then click on the Play button as shown below.

This mode is only allowed from the GUI. It cannot be set in the configuration file. Nevertheless, a progressive reconstruction sequence can be generated from the configuration file by setting the following rendering parameter to yes:

# Render a sequence of frames reflecting the progressive skeleton reconstruction 
RENDER_NEURON_MORPHOLOGY_PROGRESSIVE=yes

Samples

The morphology is drawn as a list of spheres, where every sphere represents a sample in the morphology. This mode is useful to visualize the distributions of the samples along the arbors, but it might take several seconds to draw all the spheres for a relatively large morphology (with more than 5000 samples).

This mode can be set in the configuration file as follows:

# Morphology reconstruction method
MORPHOLOGY_RECONSTRUCTION_ALGORITHM=samples

Dendrogram

This mode draw a three-dimensional dendrogram of the morphology. Note that the subtrees are color-coded by the same colors in the morphology and dendrogram plots. These colors can be selected by the user from the Morphology Colors section in the panel before rendering the images.

# Morphology reconstruction method
MORPHOLOGY_RECONSTRUCTION_ALGORITHM=dendrogram

Morphology Reconstruction Parameters

Skeleton Style

  • Original
  • Tapered
  • Zigzag
  • Tapered Zigzag
  • Straight


Left: Original. Top-left: Tapered. Top-right: Zigzag. Bottom-left: Tapered-zigzag. Bottom-right: Straight.

Original

The morphology skeleton is drawn as loaded from the original file and no changes will be applied to it.

This option can be set in the configuration file as follows:

# Skeleton
SKELETON=original

Tapered

Create tapered arbors where each arbor will be starting with the largest sample and terminating with the smallest sample. This mode is merely used for artistic purposes as the drawn morphology is modified from the original one.

This option can be set in the configuration file as follows:

# Skeleton
SKELETON=tapered

Zigzag

Create a zigzagged skeleton (to simulate the way the neurons look under the microscope when the intracellular space if filled with some stain). This style is recommended to create meshes that can be used for machine learning applications.

This option can be set in the configuration file as follows:

# Skeleton
SKELETON=zigzag

Tapered Zigzag

Create a skeleton with a tapered and zigzag style. Again, this option is only meant for artistic purposes as it changes the structure of the morphology.

This option can be set in the configuration file as follows:

# Skeleton
SKELETON=tapered-zigzag

Straight

Create a simplified morphology skeleton by drawing the first and last samples along each section and ignore the others.

This option can be set in the configuration file as follows:

# Skeleton
SKELETON=straight

Branching Method

When the Connected Sections method is used to draw the skeleton, a parent section will get connected one of the child sections starting from the root section till the leaf one. The selection of this child section can be done based on the angles between the parent and the children or the their radii.

The following branchig methods are implements:

  • Angles
  • Radii


Left: Radius-based branching. Right: Angle-based branching. Note that this is only available for the ConnectedSections method.

Angles

Make the branching based on the angles at branching points. The parent is connected to the child with the largest angle to yield a smooth connection.

Radii

Make the branching based on the radii of the children at the branching points. The parent is connected to the child whose first sample radius is comparable.

Arbors to Soma

This option defines how the arbors of the morphology will be connected to the soma when drawin the morphology.

  • Connect Connected
  • All Connected
  • All Disconnected

Note: This option is only implemented in the GUI and cannot be set in the configuration file.

Connect Connected

The connected arbors will be extended to the origin of the soma.

All Connected

All the arbors of morphology will be extended to the origin of the soma.

All Disconnected

All the arbors of the morphology will only be drawn starting from their the first sample of their initial segments.

Resampling

  • None
  • Adaptive Relaxed
  • Adaptive Packed
  • Fixed Step

The resampling method can be set in the configuration file in the MORPHOLOGY/SOMA SKELETON PARAMETERS as follows:

# Skeleton Resampling
# Use ['none'] to ignore, this is the default option.
# Use ['adaptive-relaxed'] to apply adaptive resampling with relaxed distancing.
# Use ['adaptive-packed'] to apply adaptive resampling while packing each section in the morphology.
# Use ['fixed-step'] to resample the skeleton at a fixed sample step.    
MORPHOLOGY_SKELETON_RESAMPLING=none

None

If None is selected, the sections of the morphology will not be resampled at all and will be drawn as loaded from the morphology file.

This option can be set in the configuration file as follows:

# Skeleton resampling method 
MORPHOLOGY_SKELETON_RESAMPLING=none

Adaptive Relaxed

Use adaptive resampling to resample each section in the morphology and remove the unwanted samples while preserving the spatial features of the section. The new samples will not be touching each other, that is why it is called relaxed.

This option can be set in the configuration file as follows:

# Skeleton resampling method
MORPHOLOGY_SKELETON_RESAMPLING=none

Adaptive Packed

Use adaptive resampling to resample each section in the morphology and remove the unwanted samples while preserving the spatial features of the section. The new samples will overlap as if they pack the section to fill it entirely, and that is why it is called packed.

This option can be set in the configuration file as follows:

# Skeleton resampling method
MORPHOLOGY_SKELETON_RESAMPLING=adaptive-packed

Fixed Step

Use fixed resampling step to resample the section. With high resampling steps, some of the spatial features of the sections could be gone. If this option is selected, the user can set the step value by the Resampling Step slider which will appear following to selecting the Fixed Step option in the Resampling menu.

Resampling the skeleton at a fixed step of 1.0 will result in

If we change the fixed step to 5.0, the result will be

This option can be set in the configuration file as follows:

# Skeleton resampling method   
MORPHOLOGY_SKELETON_RESAMPLING=fixed-step

# Resampling step
MORPHOLOGY_RESAMPLING_SETP=1.0

Arbor Quality

Radii

  • Original
  • Unified
  • Type Unified
  • Scaled

Original

The radii of samples of the drawn skeleton will be the same as those loaded from the original morphology file.

Unified

The radii of all the samples in the entire morphology are set to a unified value given by the user. If this option is selected, the slider Fixed Radius Value will appear in the GUI to set the unified radius.

Type Unified

The radii of all the samples in the different branches (axon, apical dendrite and basal dendrites) will be set to unified values specific to axon, apical dendrite and basal dendrites.

Scaled

Scale the radii of all the samples in the morphology with a scale factor given by the user.

Soma

  • Ignore
  • Sphere
  • MetaBalls
  • SoftBody

Ignore

Ignore the soma object and do not display it when the morphology is drawn.

Sphere

Draw the soma as a symbolic sphere ceneterd at the origin.

MetaBalls

Use the MetaBalls algotirhm to build a three-dimensional profile that approximates the soma shape.

SoftBody

Use the soft body physics to simulate the growth of a soma profile using the physics engine of Blender.

Branching Order (per type)

  • Build Axon
  • Build Apical Dendrite
  • Build Basal Dendrites

Colors and Materials

Morphology Rendering

View

Users can render the following view of the morphology:

  • Wide Shot
  • Mid Shot
  • Close Up

Wide Shot

This option can be set in the configuration file as follows:

# Rendering view 
RENDERING_VIEW=wide-shot

Mid Shot

This option can be set in the configuration file as follows:

# Rendering view 
RENDERING_VIEW=mid-shot

Close Up

This option can be set in the configuration file as follows:

#Rendering view 
RENDERING_VIEW=close-up

# Close up view dimensions (in microns)
CLOSE_UP_VIEW_DIMENSIONS=20

Resolution

  • Fixed Resolution Frame Resolution
  • To Scale Frame Scale

Image Format

Users can export the rendered images in the following file formats:

  • PNG (default)
  • TIFF
  • OpenEXR
  • JPEG
  • BMP

We recommend using TIFF or OpenEXR for high quality scientific figures or post-processing. For quick preview images, users are advised to use PNG, JPEG or BMP formats.

NOTE: This option is not implemented for the configuration file. By default, all the images rendered from running NeuroMorphoVis in the background mode will be PNGs.

Background

Users can select to render morphology images with transparent or opaque backgrounds. If the Transparent Background checkbox is selected, the morphology will be rendered with a transparent background. Otherwise, the option Background Color will appear to set the RGB color of the background.

NOTE: This option is only available from the GUI and cannot be set in the configuration file.

Camera View

Users can render the following camera views of the morphology:

  • Front
  • Side
  • Top

This option can be set in the configuration file as follows:

# Camera view
CAMERA_VIEW=front

Rendering Animation

NeuroMorphoVis has added support to render two types of movies: 360_ and Progressive sequences.

360

The user can render a 360 movie to visualize the morphology from different views.

# Render a 360 of the morphology, default 'no'.
# Use ['yes' or 'no']
RENDER_NEURON_MORPHOLOGY_360=yes

Progressive

The user can render a progressive animation showing the progressive reconstruction (or the growth) of the morphology.

# Render the progressive reconstruction of the skeleton, default 'no'. 
# Use ['yes' or 'no']
RENDER_NEURON_MORPHOLOGY_PROGRESSIVE=yes

Morphology Export Options

Users can export the drawn morphology skeleton into multiple file formats including:

  • SWC (or .swc)

  • Segments (or .segments)

  • Blender Format (or .blend)

SWC

This is the standard file format adopted by the neuroscience community. In this format, the skeleton is represented by a list of samples, where each sample in this list has the following structure:

  • The index of the sample or sample number
  • The type of the sample or structure identifier
  • Sample x-coordinates
  • Sample y-coordinates
  • Sample z-coordinates
  • Sample radius
  • The index of the parent sample

For further details about this format, you can refer to this link.

Segments

The morphology file can be exported into an ASCII text file with .segments extention. This file is a list of segments. Each line in the file is a segment composed of two points between brackets. Each point has the following structure [X Y Z RADIUS]. This file is used to make it easy for other visualization application (for example to render the morphology with signed distance fields) without implementing any specific parsers.

The structure of a .segments file with 100 segments looks like this:

[X0 Y0 Z0 R0][X1 Y1 Z1 R1]
[X1 Y1 Z1 R1][X2 Y2 Z2 R2]
[X2 Y2 Z2 R2][X3 Y3 Z3 R3]
...
...
...
[X99 Y99 Z99 R99][X100 Y100 Z100 R100]

An example of this file is available in this link.

Navigation


Clone this wiki locally