wisamreid / Neuronalyzer_Dendrite_Tracing_Matlab

Neuron tracing and analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neuronalyzer - User Manual

The software is compatible with MATLAB R2023a or newer.
To get started, download the latest Neuronalyzer version from the GitHub repository. Then open the file index.m in MATLAB and run it.

Please cite this paper:
Yuval, O., Iosilevskii, Y., Meledin, A., Podbilewicz, B., & Shemesh, T. (2021). Neuron tracing and quantitative analyses of dendritic architecture reveal symmetrical three-way-junctions and phenotypes of git-1 in C. elegans. PLoS computational biology, 17(7), e1009185.

Required toolboxes: Computer Vision, Navigation, Robotics System, Image Processing, Curve Fitting, Signal Processing, Parallel Computing Toolbox, Statistics and Machine Learning, Phased Array System.

New features and announcements

  • It is now possible to annotate and train a custom neural network from within the GUI.
  • Users can access the full data, meta data and parameters of their project via the Project variable in the MATLAB Workspace.
  • To export tabular data to csv, users can use the following example code in the command line (after analyzing an image dataset or loading an existing project into the GUI):
    writetable(struct2table(Project.Data(i).Points),['Project_',num2str(i),'_',Project.Data(i).Info.Experiment(1).Identifier,'.csv'],'Delimiter',',')
    where i is the image index in the dataset. This code exports the traced elements into a csv file.

1. Load an image or an existing project
Use the “Load Data” button to load an image(s), or the “Load Project” button to load an existing project file(s). Then, use the “Project” menu to navigate between the different images/projects. You can load multiple image/project files at once, or load a project file that contains multiple projects.

Use the tables at the bottom-right corner to add meta-data. The second column contains the values, and the third column contains the units. The first table allows you to enter experimental information such as scale-bar, temperature and strain name (the third column is used for units). The second table allows you to enter analysis information for reproducibility. This includes the version and commit id of the code used for the analysis, as well as the date and the name of the person that performed the analysis. You can find the commit id on the GitHub repository (for example: 357b6ac). The scale-bar is set to 1 as default. Make sure to set it to the correct value for each loaded image/project.

Screenshot_Start


2. Denoising
Next, you can use the “Denoise Image” button to apply a denoising neural network that will classify pixels into neuron and non-neuron. To display the denoised image, in the “Reconstructions” menu, choose CNN CNN Image - RGB.

Screenshot_CNN


3. Manual annotation
Once the image is denoised, you can display it as a binary image, and make corrections if necessary “Reconstructions” menu (Binary Image ​ ​ Binary Image - RGB).

To filter out small objects, set the threshold value in the top-right spinner (here set to 50), then click "Apply Changed".

In this image a colormap is used for visual and annotation purposes (see below), where “White” (1) and “Black” (0) are displayed using their intensities in the original grayscale image.

You can use the drawing or annotation modes to manually edit the binary image. First, zoom in to magnify a certain image region and choose a marker size. Then, choose “Drawing Mode” or “Annotation Mode” to start editing the image. In drawing mode, a left-click initiates drawing, and a right-click initiates erasing. Click once on the image, release, and then left-click and hold to start drawing. Annotation mode works in a similar way but with individual clicks that add or remove pixels around the clicked position. Switch back to “Default Mode” once finished, or in order to use the zoom function. The result is automatically saved.

You can save your work at any time using the “Save Project” button.

Screenshot_Annotation


Following manual correction, you can display a combined image showing both the CNN-derived image and the corrections labeled in different colors.

Screenshot_CNN+Annotation


Use the skeleton view (Reconstructions → Skeleton) to check for gaps in the binary image. In this view, each connected component appears in a different color. It is absolutely fine to have separated components, but if you see components that should be connected but are not, then you should go back to the binary image and fix this.

Screenshot_Skeleton


4. Neuron tracing
To obtain the trace of the neurons, click the “Trace Neuron” button. Once finished, the resulting trace is displayed. You can use the “Project” menu to navigate between the different traced images.

Screenshot_Trace


5. Feature extraction and neuron axes
Once the tracing is done, click the "Extract Features" button to extract various morphological features from the trace. In particular, the neuron axes are mapped (Reconstructions ​ ​ Axes). To tweak the axes positions manually, change to annotation mode and click the "Apply Changes" button. You can use the spinner to specify the number of interactive points (here set to 25 points), then click the "Apply Changes" button. To move the image around in this mode, use the arrow keys on your keyboard. Once finished, click again the "Extract Features" button, as other computations depend on these axes.

Screenshot_Axes


6. Validation
Once the images have been traced, you can use the “Reconstructions” menu to visualize various morphological features. The examples below show the azimuthal position (top), and the classification of neuronal elements into four morphological classes (bottom).

Screenshot_Azimuthal_Position

Screenshot_Classes


7. Analysis
Finally, use the “Plots” menu to display quantifications of the extracted features. Use the control panel to specify plot parameters, then click “Apply Changes”. Plot parameters include bin-size, normalization, statistics and plot types. The examples below show the density of neuronal elements along the neuron’s midline, averaged across wild-type animals (top), and the mean and standard deviation of neuronal length per morphological class for each group of animals (bottom).

Screenshot_Plots_Gradient

Screenshot_Plots_Length

About

Neuron tracing and analysis

License:GNU General Public License v3.0


Languages

Language:MATLAB 99.5%Language:M 0.5%