Skip to content

Commit b07830f

Browse files
authored
Merge pull request #366 from imagej/snt-fixes
snt: add snippet for external data analysis
2 parents b771107 + 9e98911 commit b07830f

File tree

4 files changed

+46
-11
lines changed

4 files changed

+46
-11
lines changed

_pages/plugins/snt/analysis.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,19 @@ If this becomes an issue, consider fitting paths in situ using the Replace exist
2727
# Statistics
2828
SNT assembles comparison reports and simple statistical reports (two-sample t-test/one-way ANOVA) for up to six groups of cells. This is described in [Comparing Reconstructions](#comparing-reconstructions). In addition, descriptive statistics are commonly reported in histograms from *Frequency/Distribution Analysis* commands.
2929

30-
{% include img align="center" src="/media/plugins/snt/snt-combined-histograms.png"
31-
caption="
32-
**Cell-based Distributions...**
33-
<p>
34-
SNT charts are zoomable, scalable, and rendered using scientific plotting styles to be as publication-ready as possible.
35-
Righ-click on a plot canvas to export it as vector graphics (PDF or SVG), acess customization controls, a light/dark theme toggle, and options to aggregate charts in multi-panel figures.
36-
With histograms, normal distribution curves and quartile marks can be overlaid on frequencies. With simple charts, it is typically enough to double-click on plotted components to edit them.
37-
</p>
38-
"%}
30+
{% include img align="right" src="/media/plugins/snt/snt-combined-histograms.png" caption="Distributions or morphometric traits..."%}
3931

32+
Notes on SNT charts and plots:
33+
34+
- SNT charts are zoomable, scalable, and rendered using scientific plotting styles to be as publication-ready as possible. Righ-click on a plot canvas to export it as vector graphics (PDF or SVG), acess customization controls, a light/dark theme toggle, and options to aggregate charts in multi-panel figures
35+
36+
- With simple charts, it is possible double-click on plotted components to edit them and export data as CSV
37+
38+
- Histogram distributions can be fitted to a [normal distribution](https://en.wikipedia.org/wiki/Normal_distribution) (Gaussian) or a [Gaussian mixture model](https://en.wikipedia.org/wiki/Mixture_model) (see _Components & Curve Fitting_ in the histogram right-click menu). In both cases, curves are scaled so that the [area under the curve](https://en.wikipedia.org/wiki/Integral) of the fitted curve matches that of the histogram. [Quartile](https://en.wikipedia.org/wiki/Quartile) marks can also be overlaid. By default, the [Freedman-Diaconis](https://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule) rule is used to compute the no. of histogram bins.
39+
40+
- Unless specified, all radial plots display angles in [0°-360°[ degrees
41+
42+
- While SNT is not a statistical analysis software, it does offer some basic convenience methods to parse third-party data. See e.g., [this example](./scripting#analysis-of-external-data) for fitting a Gaussian mixture model to CSV data
4043

4144
# Comparing Reconstructions
4245

_pages/plugins/snt/faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ In addition, you should also cite any additional modules that you may use:
3232

3333
### What is the difference between SNT and Simple Neurite Tracer?
3434

35-
Simple Neurite Tracer was the first Fiji plugin dedicated to visualization and reconstruction of neurons, developed by [Mark Longair](/people/mhl) and [published in 2011](https://doi.org/10.1093/bioinformatics/btr390), to become the single most cited open-source software for semi-automated 3D reconstructions. In the wake of ImageJ2 development, a new team of developers lead by [Tiago Ferreira](/people/tferr) took on the effort of modernizing its code base. The project quickly snowballed beyond the re-write of the software, and focused on establishing a complete framework for reconstruction, visualization, quantification and modelling of neuronal morphology. Several name changes were proposed for this "next-gen" Simple Neurite Tracer (*Not so Simple Neurite Tracer*, *Smart Neurite Tracer*, *Super Neurite Tracer* to name a few), but in the end it was decided to adopt the acronym of the original software, as an homage to Mark's outstanding work. You can follow the entire history of the plugin on GitHub: Simple Neurite Tracer's {% include github org='fiji ' repo='Simple_Neurite_Tracer' label='historic ' %} and SNT's {% include github org='morphonets ' repo='SNT ' label='current ' %} repositories.
35+
Simple Neurite Tracer was the first Fiji plugin dedicated to visualization and reconstruction of neurons, developed by [Mark Longair](/people/mhl) and [published in 2011](https://doi.org/10.1093/bioinformatics/btr390), to become the single most cited open-source software for semi-automated 3D reconstructions. In the wake of ImageJ2 development, a new team of developers lead by [Tiago Ferreira](/people/tferr) took on the effort of modernizing its code base. The project quickly snowballed beyond the re-write of the software, and focused on establishing a complete framework for reconstruction, visualization, quantification and modelling of neuronal morphology. Several name changes were proposed for this "next-gen" Simple Neurite Tracer (*Not so Simple Neurite Tracer*, *Smart Neurite Tracer*, *Super Neurite Tracer* to name a few), but in the end it was decided to adopt the acronym of the original software, as an homage to Mark's outstanding work. You can follow the entire history of the plugin on GitHub: Simple Neurite Tracer's {% include github org='fiji' repo='Simple_Neurite_Tracer' label='historic' %} and SNT's {% include github org='morphonets' repo='SNT' label='current' %} repositories.
3636

3737
### How accurate is SNT?
3838

39-
When SNT is compiled, a [suite of tests](https://github.com/morphonets/SNT/tree/-/src/test/java/sc/fiji/snt) is run to detect deficiencies in the code base. Morphometry results are benchmarked against values obtained in [L-Measure](http://cng.gmu.edu:8080/Lm/) and [NeuroM](https://github.com/BlueBrain/NeuroM). However, no test suite is ever perfect. If you detect inaccuracies, please {% include github org='morphonets ' repo='SNT ' label='report ' %} them\!
39+
When SNT is compiled, a [suite of tests](https://github.com/morphonets/SNT/tree/-/src/test/java/sc/fiji/snt) is run to detect deficiencies in the code base. Morphometry results are benchmarked against values obtained in [L-Measure](http://cng.gmu.edu:8080/Lm/) and [NeuroM](https://github.com/BlueBrain/NeuroM). However, no test suite is ever perfect. If you detect inaccuracies, please {% include github org='morphonets' repo='SNT' label='report' %} them\!
4040

4141
### What is a SWC file?
4242
<span id="swc"></span>

_pages/plugins/snt/scripting.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,38 @@ The REPL has access to _all_ of SNT's API. The prompt does not feature auto-comp
7676
demoTreesSWC() -> List
7777
{% endhighlight %}
7878

79+
# Analysis of External Data
80+
While SNT is not a statistical analysis software, it does offer some convenience methods to parse third-party data. E.g., to take a quick peek at a distribution of tabular values, one could use the following snippet to plot a histogram while fitting a Gaussian mixture model to the data. While it is written in Groovy, it would run almost verbatim in any other scripting language because it relies only on the SNT API.
81+
82+
{% highlight groovy %}
83+
import sc.fiji.snt.analysis.*
84+
85+
path = "https://raw.githubusercontent.com/morphonets/misc/master/dataset-demos/csv/demo-trees-coord.csv" // url or path to local file
86+
table = SNTTable.fromFile(path) // read data into a table
87+
headers = ["y", "z"] // headers of columns to be plotted
88+
histogram = SNTChart.getHistogram(table, headers, false) // table, col. headers, radial plot?
89+
histogram.setGMMFitVisible(true) // fit Gaussian mixed model to data
90+
histogram.show() // display histogram
91+
{% endhighlight %}
92+
93+
Alternatively, the same data could be plotted in a two-dimensional histogram:
94+
95+
{% highlight groovy %}
96+
import sc.fiji.snt.analysis.*
97+
import sc.fiji.snt.util.*
98+
99+
path = "https://raw.githubusercontent.com/morphonets/misc/master/dataset-demos/csv/demo-trees-coord.csv" // url or path to local file
100+
table = SNTTable.fromFile(path) // read data into a table
101+
SNTChart.showHistogram3D(table.get("y"), table.get("z"), ColorMaps.get("viridis")) // show 3D histogram of the same columns using viridis LUT
102+
{% endhighlight %}
103+
104+
Note that this approach would work for both local and remote files. The result of both snippets side-by-side:
105+
106+
<div align="center">
107+
<img src="/media/plugins/snt/snt-analysis-external-data.png" title="Analysis of tabular data in SNT" width="700px" />
108+
</div>
109+
110+
79111
# Python Notebooks
80112

81113
Direct access to the SNT API from the [Python](https://www.python.org/) programming language is made possible through the [PyImageJ](/scripting/pyimagej) module. This enables full integration between SNT and any library in the Python ecosystem (numpy, scipy, etc.). The [Notebooks](https://github.com/morphonets/SNT/tree/-/notebooks) directory in the SNT repository contains several examples at different complexity levels.
154 KB
Loading

0 commit comments

Comments
 (0)