Presented is a computational tool that allows simple and direct automatic measurement of orientations of neuronal dendritic branches from 2D fluorescence images.
The structure of neuronal dendritic trees plays a key role in the integration of synaptic inputs in neurons. Therefore, characterization of the morphology of dendrites is essential for a better understanding of neuronal function. However, the complexity of dendritic trees, both when isolated and especially when located within neuronal networks, has not been completely understood. We developed a new computational tool, SOA (Segmentation and Orientation Analysis), which allows automatic measurement of the orientation of dendritic branches from fluorescence images of 2D neuronal cultures. SOA, written in Python, uses segmentation to distinguish dendritic branches from the image background and accumulates a database on the spatial direction of each branch. The database is then used to calculate morphological parameters such as the directional distribution of dendritic branches in a network and the prevalence of parallel dendritic branch growth. The data obtained can be used to detect structural changes in dendrites in response to neuronal activity and to biological and pharmacological stimuli.
Dendritic morphogenesis is a central subject in neuroscience, as the structure of the dendritic tree affects the computational properties of synaptic integration in neurons1,2,3. Moreover, morphological abnormalities and modifications in dendritic branches are implicated in degenerative and neuro-developmental disorders4,5,6. In neuronal cultures where dendritic ramification can be more readily visualized, the interactions between non-sister dendritic branches regulate the sites and extent of synaptic clustering along the branches, a behavior that may affect synaptic coactivity and plasticity7,8,9. Therefore, characterization of the morphological parameters of the dendritic tree using two-dimensional (2D) neuronal cultures is advantageous for understanding dendritic morphogenesis and functionality of single and networks of neurons. Yet, this is a challenging task because dendritic branches form a complex mesh even in "simplified" 2D neuronal cultures.
Several tools have been developed to automatically trace and analyze dendritic structures10,11,12,13. However, most of these tools are designed for 3D neuronal networks and are naturally too complex to use with 2D networks. In contrast, less advanced morphological analysis tools typically involve a significant component of computer-assisted manual labor, which is very time-consuming and susceptible to operator bias14. Existing semi-automatic tools, such as 'ImageJ'15 (an NIH open-source image processing package with a vast collection of community-developed biological image analysis tools), largely reduce user manual labor. However, some manual interventions are still needed during image processing, and the quality of the segmentation can be less than desirable.
This paper presents the SOA, a simple automated tool that allows direct segmentation and orientation analysis of dendritic branches within 2D neuronal networks. The SOA can detect various line-like objects in 2D images and characterize their morphological properties. Here, we used the SOA for segmenting dendritic branches in 2D fluorescence images of dendritic networks in culture. The software identifies the dendritic branches and successfully performs measurements of morphological parameters such as parallelism and spatial distribution. The SOA can be easily adapted for the analysis of cellular processes of other cell types and for studying non-biological networks.
NOTE: The Israeli Ministry of Health approved the use of mice under protocol IL-218-01-21 for the ethical use of experimental animals. SOA is only compatible with Windows 10 and Python 3.9. It is available as an open-source code: https://github.com/inbar2748/DendriteProject. At this link, there is also a README.DM file that has directions for downloading the software, a link to the software's website, and a requirements file containing information on the required versions of all the packages. Additional examples of analysis performed using the software have been provided there as well.
Figure 1: SOA workflow for segmentation and growth direction analysis. Shown are the processing steps of fluorescent images of dendritic networks and data analysis. The 2D image is uploaded, segmented (in two steps: dendritic branches are detected as lines, and then the relevant lines are merged), and the spatial information of each dendritic branch is obtained. The data are collected for all the dendritic branches in the image. Finally, the data are analyzed to give the desired morphological parameters. Abbreviation: SOA = segmentation and orientation analysis. Please click here to view a larger version of this figure.
1. Open the SOA application.
Figure 2: Example of a workflow using the SOA's GUI. Left column: GUI sections of the workflow. Middle column: image of a dendritic network, processed during the workflow (Scale bar: 20 µm). Right column: magnification of the area marked by a red rectangle in the images of the middle column (Scale bar: 4 µm). Step 1: Selection and uploading of an image. Step 2: The first stage of segmentation is the detection of lines that represent the identified dendritic branches. Step 3: The second stage of segmentation is the proximity-based merger of segment lining in individual dendritic branches. The settings of all steps can be modified. Abbreviations: SOA = segmentation and orientation analysis; GUI = graphical user interface. Please click here to view a larger version of this figure.
2. Open an image to analyze.
3. Segmentation optimization
NOTE: In the SOA Viewer Properties menu bar, change the values of the selected parameters to adjust the segmentation process settings. A detailed description of the parameters, such as the Threshold, is given in the Supplemental Material.
4. Create the output files.
5. Navigation toolbar
NOTE: A navigation toolbar is included in all figure windows and can be used to navigate through the data set. Each of the buttons at the bottom of the toolbar is described below.
A representative analysis was performed on images of dendritic networks in culture. Cells were extracted as described by Baranes et al.16,17. Briefly, hippocampal cells were extracted from the brains of postnatal rats and cultivated on 2D glass coverslips for 1-2 weeks. The cultures were then fixed and stained through indirect immunofluorescence using an antibody against the dendritic protein marker, microtubule-associated protein 2 (MAP2). Images of dendritic networks were collected using a fluorescence microscope, and 10 images were processed using SOA.
Figure 1 shows a typical SOA workflow for the analysis of a dendritic network. The input is a 2D fluorescent microscope image. Image segmentation is performed in two stages: the first stage is the identification of dendritic branches as lines, and the second stage is merging of relevant lines according to distance and direction criteria determined by the user. After segmentation, spatial information is collected for each identified dendritic branch. Then, the following information is extracted from the data of all dendritic branches in the image: Parallel/Non-Parallel Classification, average length of parallel vs. non-parallel dendritic branches, distance between parallel dendritic branches, and angular distribution.
Figure 2 illustrates the workflow laid out in Figure 1 applied to a representative 2D image of a dendritic network labeled with a fluorescent anti-MAP2 antibody. A Graphical User Interface (GUI) was developed in which the user can select and upload an image out of a set of files (Step 1). Then, the user can modify the Edges settings (Step 2) and Merge Lines settings (Step 3). Following that, lines representing the identified dendritic branches are detected (Step 2) and then merged, based on the proximity of the segmented lines and their directional differences (Step 3). The GUI enables the comparison of the original image to the segmented image (Step 3) and provides real-time monitoring of the effect of any changes to the segmentation settings. The spatial information collected is then analyzed, and the results are presented as graphs or tables (Figure 3, Figure 4, Figure 5, and Figure 6)
Figure 3 demonstrates how dendritic branches are classified as growing parallel (Figure 3A) and non-parallel (Figure 3B). All segments classified as "non-parallel" are not parallel to any other segment. Because dendritic branches do not actually extend in straight lines, there was a need to provide some degree of freedom for the definition of parallel growth. To achieve that, the orientation of a particular branch was measured, and then a range of angles around the measured orientation was permitted for parallelism. This range is fixed for each image and depends on the number of lines detected; however, it cannot exceed 10° (a detailed description of the parallelism sorting process is given in Supplemental Material/Analysis, section 1). Then, the fitness of the orientation of all other branches to this angle range was examined. Once the analysis was completed, the number of parallel branches within the tested range was extracted and plotted in a frequency graph (Figure 3C).
To understand whether the extent of parallel growth among the dendritic branches is random or directed, the results of the graph in Figure 3C were compared to those extracted from simulation of random growth of lines of the same number as those of the dendritic branches in the cultures (Figure 3D). SOA then measures the distances among the parallel branches (Figure 4) as well as the lengths of parallel and non-parallel dendritic branches. Figure 5 displays bar graphs of the lengths of the non-parallel dendritic branches (Figure 5A) and parallel dendritic branches (Figure 5B) and their average lengths. To determine whether preferential growth directions exist, SOA displays a distribution histogram of the growth angles of the dendritic branches (Figure 6). Such a presentation allows for rapid identification of preferred growth directions and identification of specific dendritic branches in each group (by ID number) (Figure 6A).
Figure 3: Classification of dendritic branch parallel growth vs. random simulation. Dendritic branches of the image in Figure 2B identified by SOA were classified as (A) parallel and (B) non-parallel. (C) The number of parallel dendritic branches in each angle range checked was collected and divided into groups of pairs/triples/quartets as explained in Supplemental Material/Analysis, section 1. The occurrence frequency of each group is shown in the graph. (D) The results of grouping parallel lines extracted from a random line distribution simulation. Abbreviation: SOA = segmentation and orientation analysis. Please click here to view a larger version of this figure.
Figure 4: SOA measurement of the distance among parallel dendritic branches. Shown is an example of how SOA displays the distance among branches grown in parallel. Each dendrite detected receives a unique number (ID number). The SOA measures the minimum distance between each pair of parallel dendrites. A detailed description can be found in Supplemental Material/Analysis, section 1. Examples: 1. Dendritic branch ID=2 is at a distance of 60 µm from another branch. 2. Dendrite ID=17 has two parallel branches at distances of 60 µm and 13.7 µm. Abbreviation: SOA = segmentation and orientation analysis. Please click here to view a larger version of this figure.
Figure 5: SOA's display of the length distribution of parallel vs. non-parallel dendritic branches. Shown is a frequency plot distribution of SOA's comparison of the lengths of (A) non-parallel and (B) parallel dendritic branches, as well as the average lengths. Abbreviation: SOA = segmentation and orientation analysis. Please click here to view a larger version of this figure.
Figure 6: SOA's display of the angular distribution of dendritic branches. (A) A graphical representation of each identified line according to its growth angle. (B) A display of A that allows quick recognition of preferred growth directions. Combining A and B, each dendritic branch can be allocated to a specific growth direction category. This form of representation of the distribution of dendritic growth directions allows rapid identification of preferred growth directions (B: the higher the column, this growth direction is more preferred) and directions in which dendrites do not grow (B: at an angle where there is no column, dendrites do not grow in the same direction). Abbreviation: SOA = segmentation and orientation analysis. Please click here to view a larger version of this figure.
Supplemental Material. Please click here to download this File.
Effective strategies for extracting morphological information from 2D images are urgently required to keep up with biological imaging data. Although imaging data can be generated in hours, in-depth analysis of the images takes a long time. As a result, image processing has clearly become a major obstacle in many fields. This is due in part to the high complexity of the data, especially when dealing with biological samples. Furthermore, as many users lack specialized programming and image processing skills, automated tools that allow image processing to be done in an easy and user-friendly manner are needed. That is why SOA is expected to be useful. The representative results demonstrate the automated segmentation that enables identification of the dendritic branches in the image in a few simple steps, despite the complexity of the dendritic network. The work process is simple and intuitive, and diverse spatial information is obtained immediately and without effort. Several algorithms were employed to detect individual dendritic branches in the fluorescence images and conduct multiple analyses on the results. A detailed description of the algorithms can be found in the Supplemental Material and information on the system requirements. This paper will briefly present the algorithms and their role in the software.
Segmentation
Segmentation was the most challenging part of this project. In segmentation, a digital image is converted into several segments (image objects). The aim of segmentation is to identify objects in the image and thus make them more understandable and available. Here, segmentation was utilized to identify dendritic branches and isolate them from the background. The image segmentation process was split into two stages: the first stage involved the detection of dendritic branches as lines, and the second stage involved merging related lines based on distance and direction criteria set by the user.
Dendritic information and analysis
Information on the location, angle, and length of each line detected was collected. The software performs the following analyses on the data obtained from all the lines identified in the image: 1. Dendritic Branch Classification (Parallel/Non-Parallel) 2. The average length of parallel vs. non-parallel dendritic branches was measured. 3. Angular distribution measurement and display 4. Distance measurement between parallel dendritic branches
The SOA's user interface allows users to upload an image from the computer's files. It also allows for adjustments of segmentation settings. Because each dendritic network image is unique, we suggest "tinkering" with the settings to achieve the best possible segmentation. The user interface allows for comparison of the original and the segmented images and immediate monitoring of the effect of any change in the settings on the segmentation.
After modifying all settings, SOA creates the final figure of the segmentation that shows each of the identified dendritic branches. The SOA generates graphs of the analyses performed and a .xlsx file with all the data.
The output of the SOA can be utilized as a starting point for the input of tools for further analysis. For example, we are now developing software that calculates the average parallelism value for dendrites that have received various treatments using SOA output on a large number of images.
概要
SOA is an automated tool for identification, segmentation, and extraction of important morphological information from images of complex 2D line networks and has a user-friendly and intuitive interface. In this work, the use of SOA was introduced through an example of analysis of dendritic networks. SOA can be used for the analysis of other types of 2D cellular networks, such as networks of different neural and non-neural cells, intracellular complex structures such as those generated by the cytoskeleton and non-biological networks, e.g., nanotubes and more. SOA was developed for a very specific purpose, and it is important to know its advantages and limitations. SOA's limitations include the fact that it is only suitable for 2D image analysis and not for 3D image analysis. SOA can only be used to analyze images with objects that are line-like. Moreover, the information obtained from the software is limited to the spatial information of the identified dendrites and to the specific analyses described here. Additional analyses are not performed by the SOA. The software's key advantages are its simplicity and user-friendliness. The software allows complex images to be analyzed quickly and in a few easy steps. Moreover, SOA is flexible and readily adjustable; hence, its analytic capacity can be expanded beyond morphometry and be beneficial for other applications.
The authors have nothing to disclose.
The authors would like to thank Dr. Orly Weiss for the preparation of the culture images.
Matplotlib | 2002 – 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 – 2021 The Matplotlib development team. | 3.4.2 | a Python 2D plotting library |
matplotlib-scalebar | Philippe Pinard | 0.7.2 | artist for matplotlib to display a scale bar |
NumPy | The NumPy community. | 1.20.3 | fundamental package for scientific computing library |
OpenCV | OpenCV team | 4.5.2.54 | Open Source Computer Vision Library |
PyCharm | JetBrains | 2020.3.1 (Community Edition) version | Build #PC-203.6682.86, built on December 18, 2020. Runtime version: 11.0.9.1+11-b1145.37 amd64. VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0. Memory: 978M, Cores: 4 |
PyQt5 | Riverbank Computing | 5.15.4 | manage the GUI |
python | Python Software Foundation License | 3.9 version | |
Qt Designer | The QT Company Ltd. | 5.11.1 version | |
scipy | Community library project | 1.6.3 | Python-based ecosystem of open-source software for mathematics, science, and engineering |
Seaborn | Michael Waskom. | 0.11.1 | Python's Statistical Data Visualization Library. |
Windows 10 | Microsoft | ||
Xlsxwriter | John McNamara | 1.4.3 | Python module for creating Excel XLSX files |