Welcome to SyConn’s documentation!

For the API documentation please refer to:

Documentation

Installation

  • Python 3.6/3.7

  • The whole pipeline was designed and tested on Linux systems

  • SyConn functionality is mostly based on the packages elektronn3 and knossos-utils

  • KNOSSOS is used for visualization and annotation of 3D EM data sets.

Before you can set up SyConn, ensure that the conda package manager is installed on your system. Then you can install SyConn and all of its dependencies into a new conda environment named “syco” by running:

git clone https://github.com/StructuralNeurobiologyLab/SyConn
cd SyConn
conda env create -f environment.yml -n syco python=3.7
conda activate syco
pip install --no-deps -v -e .

The last command will install SyConn in editable mode, which is useful for development on SyConn itself. If you want to install it as a regular read-only package instead, replace the last command with:

pip install --no-deps -v .

To update the environment, e.g. if the environment file changed, use:

conda env update --name syco --file environment.yml --prune

Example run

Place the example and model data (provided upon request) in SyConn/examples/, cd to SyConn/examples/ and run

python start.py [--working_dir=..]

The example script analyzes the EM data based on KnossosDatasets (see knossos_utils) of the cell segmentation, probability maps of sub-cellular structures (mitochondria, vesicle clouds and synaptic junctions) and synapse type (inhibitory, excitatory).

On a machine with 20 CPUs (Intel Xeon @ 2.60GHz) and 2 GPUs (GeForce GTX 980 Ti) SyConn finished the following analysis steps for an example cube of shape [2180 2180 1140] after 02h:16min:52s.

[0/8] Preparation 00h:07min:21s 5%

[1/8] SD generation 00h:29min:41s 21%

[2/8] SSD generation 00h:01min:28s 1%

[3/8] Neuron rendering 00h:40min:03s 29%

[4/8] Synapse detection 00h:32min:18s 23%

[5/8] Axon prediction 00h:05min:11s 3%

[6/8] Spine prediction 00h:14min:03s 10%

[7/8] Celltype analysis 00h:06min:06s 4%

[8/8] Matrix export 00h:00min:37s 0%

Example scripts and API usage

An introduction on how to use the example scripts can be found here and API code examples here.

Package structure and data classes

The basic data structures and initialization procedures are explained in the following sections:

  • SyConn operates with a pre-defined working directory and config files

  • Supervoxels (and cellular organelles) are organized as SegmentationObject which are handled by the SegmentationDatasets. For a more detailed description see here).

  • SyConn principally supports different backends for data storage. The current default is a simple shared filesystem (such as lustre, Google Cloud Filestore or AWS Elastic File System).

  • Agglomerated supervoxels (SVs) are implemented as SuperSegmentationObjects (SSO). The collection of super-SVs are usually defined in a region adjacency graph (RAG) which is used to initialize the SuperSegmentationDataset (SSD).

  • Skeletons of (super-) supervoxels, usually computed from variants of the TEASAR algorithm (https://ieeexplore.ieee.org/document/883951) - currently a fall-back to a sampling procedure is in use.

  • Mesh generation and representation of supervoxels

  • Multi-view representation of neurpn reconstructions for glia and neuron analysis (published in Nature Communications)

Flowchart of SyConn

Analysis steps

After initialization of the SDs (cell and sub-cellular structures, step 1 in the example run) and the SSD containing the agglomerated cell SVs (step 3), several analysis steps can be applied:

SyConn KNOSSOS viewer

The following packages have to be available in the system’s python2 interpreter (will differ from the conda environment):

  • numpy

  • lz4

  • requests

In order to inspect the resulting data via the SyConnViewer KNOSSOS-plugin follow these steps:

  • Wait until start.py finished. For starting the server manually run syconn.server --working_dir=<path> which executes syconn/kplugin/server.py and allows to visualize the analysis results of the working directory at (<path>) in KNOSSOS. The server address and port will be printed.

  • Download and run the nightly build of KNOSSOS (https://github.com/knossos-project/knossos/releases/tag/nightly)

  • In KNOSSOS -> File -> Choose Dataset -> browse to your working directory and open knossosdatasets/seg/mag1/knossos.conf with enabled ‘load_segmentation_overlay’ (at the bottom of the dialog).

  • Then go to Scripting (top row) -> Run file -> browse to syconn/kplugin/syconn_knossos_viewer.py, open it and enter the port and address of the syconn server.

  • After the SyConnViewer window has opened, the selection of segmentation fragments in the slice-viewports (exploration mode) or in the list of cell IDs followed by pressing ‘show neurite’ will trigger the rendering of the corresponding cell reconstruction mesh in the 3D viewport. The plugin will display additional information about the selected cell and a list of detected synapses (shown as tuples of cell IDs; clicking the entry will trigger a jump to the synapse location) and their respective properties. In case the window does not pop-up check Scripting->Interpreter for errors.

Indices and tables

Index Module Index Search Page