How to export morphological reconstruction traces with scale bars in SNT?

Hi! I am learning ImageJ - SNT for my project where I am looking for the morphologies of olfactory bulb interneurons. I finished my morphological reconstractions and saved the traces. Now I want to create a graph for my report to show the reconstructed traces. I was playing around with the SNT utilities however, I could not manage to retrieve traces with a scale bar. Does anyone know how to create traces with scalebars? I have 6 neurons per 2 groups, I want to illustrate all traces in one image. Thank you for your help!

1 Like

Welcome to the forum, @marymer

Is something of this nature what you seek?

This figure was produced directly from a demo script template located in the Scripts menu of the main SNT dialog, which can be found at:

Scripts > Full List > Render Cell Collection (MultiPanel Figure).groovy
(N.B., holding down SHIFT while selecting the script will open the source code in an instance of Fiji’s Script Editor, which may be modified and extended at your discretion). Here is the script on SNT’s Github

This particular example was written with the Groovy programming language. If you have experience in another language, e.g., Python, please let us know and we can demonstrate how to accomplish the same analysis. One of the benefits of scripting with SNT and Fiji in general is that the core SNT API is common between programming languages.

If you run the script, it will produce the following prompt, allowing you to specify a directory of reconstruction files (either .TRACES, .SWC, or .JSON) to render as well as the look-up table used in the morphometric color mapping. Note that by default, cable length is used as the mapping metric, but this may be changed within the script to any of the metrics supported by MultiTreeColorMapper


The axes are displayed in spatially calibrated units and the color legend on the right is based on the range of values computed during metric-based color mapping

It is also possible to generate comparison plots and statistics for multiple groups of cells using the GUI command found at Utilities > Compare Reconstructions…
The Analysis section of the SNT Wiki details how to use this feature.

Lastly, I’d like to mention the Utilities > Reconstruction Plotter… command, which can be used to generate plots of single reconstructions. The benefit of this command is the ability to interactively adjust the orientation of the reconstruction within the canvas, as well as the option to render a static colorized plot (it will use the current color-coding of the reconstruction, which can be applied through Analyze > Color Coding via the Path Manager or through scripting)
image image

Please let us (@tferr and I) know if this is what you had in mind, and we can work from there! :slight_smile:


Hi! I find this information very useful thank you!

I already added the multipanel figure of my neurons to the results section and I think that looks nice. I also personally still could not understand the bars at the left and right properly. Does any of them represent the distance from soma? I was thinking something more basic where I could have my traces as png format with a scale bar in µm to illustrate my reconstructions.

Kind regards,

The X and Y axis depict the actual X,Y coordinates of the cell (imagine a linear XY plot, where each node of the reconstruction gets plotted). The values on the hue ramp, depict the values mapped to the LUT, depending on the metric you choose. In the example above posted by @arshadic, they map cable length: take e.g., cell #3: it is rendered as magenta, thus it’s cable length is between 10,000 and 11,500 um).

Have a look at Scripts > Full List > Take Snapshot and Take Snapshot (traces Only):
Both create a WYSIWYG version of the traced image: The former with an offset so that traces do not occlude the traced structure, the latter omits the original signal. Both set a scale bar. Here is how it looks:

NB: The Take Snapshot (traces Only) script requires SNT 3.1.109 released today, so you will likely have to run the updater to see it.



I manage to create my graph, it means a lot. Thank you very much for your help.

1 Like