Skip to content

Commit 17b06a4

Browse files
authored
Merge pull request #360 from imagej/snt-repl
SNT: document REPL and misc corrections
2 parents 462db74 + 9b84b86 commit 17b06a4

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

_pages/plugins/snt/analysis.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Similarly to _Sholl Analysis_, there are several entry points to Strahler Analys
9999
{% endcapture %}
100100
{% include notice icon="info" content=strahler %}
101101

102-
{% include img align="right" src="/media/plugins/strahler-classification-example.png" caption="Strahler classification"%}
102+
{% include img align="right" src="/media/plugins/snt/strahler-classification-example.png" caption="Strahler classification"%}
103103
{% include wikipedia title='Strahler number' text='Strahler numbering'%} is a numerical procedure that summarizes the branching complexity of mathematical trees. The {% include wikipedia title='Strahler number' text='Strahler classification'%} occurs as follows:
104104

105105
- If a brach is terminal (has no children), its Strahler number is one

_pages/plugins/snt/manual.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ The Legacy 3D Viewer is a functional tracing canvas and allows images to be trac
477477

478478
## Bookmarks Tab
479479

480-
This tab hosts the Bookmark Manager, a utility that stores image locations to be (re)visited during tracing (e.g., a location of an ambiguous branching point or an ambiguous cross-over between two neurites). The basic usage is as follows:
480+
This tab hosts the Bookmark Manager, a utility that stores image locations to be (re)visited during tracing (e.g., a location of an ambiguous branching point or an ambiguous cross-over between two neurites). Bookmarked locations can also be used as [spine/varicosity markers](/plugins/snt/walkthroughs#spinevaricosity-analysis). The basic usage is as follows:
481481

482482
<img align="right" width="300" src="/media/plugins/snt/snt-bookmarks-tab.png" title="Bookmarks tab" />
483483

_pages/plugins/snt/scripting.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ Any script saved into Fiji's "scripts" subdirectory containing *SNT* in the file
4242

4343
3. Run {% include bc path='Scripts|Reload...'%}, and your new script should appear in the full list of scripts found at {% include bc path='Scripts|Full List...'%}.
4444

45-
## Script Recorder
45+
# Script Recorder
4646

4747
SNT features a script recorder that similarly to _ImageJ's macro recorder_ converts menu and button clicks into executable code. Note however that while the recorder captures simple commands well, it struggles to capture those that are more complex or particularly interactive.
4848

4949
The goal of the recorder is twofold: 1) simplify prototyping of new scripts and 2) Log your actions during a tracing session. This is particularly useful to assemble reproducible records.
5050

51-
There are two ways to start the recorder: {% include bc path='Scripts|New|Record...'%} or by pressing the _Record_ button in [Command Palette](/plugins/snt/manual#command-palette).
51+
There are two ways to start the recorder: {% include bc path='Scripts|Record...'%} or by pressing the _Record_ button in [Command Palette](/plugins/snt/manual#command-palette).
5252

5353
As a rule-of-thumb, commands that are simple or do not involve prompts record flawlessly. This includes setting filters for visibility of tags, applying Tags, or filtering paths in the Path Manager. Commands for fully automated reconstructions, or generating secondary layers _should_ work well. However, many others remain limited.
5454

@@ -57,14 +57,24 @@ As a rule-of-thumb, commands that are simple or do not involve prompts record fl
5757
</div>
5858

5959

60-
## Script Interpreter
61-
62-
Some of SNT's functionality is conveniently accessible in the [Script Interpreter](/scripting/interpreter). Here is an example:
60+
# REPL
6361

62+
SNT's Scripting REPL (Read–Eval–Print Loop) is opened using {% include bc path='Scripts|New|REPL'%}. It is a [Script Interpreter](/scripting/interpreter) instance with pre-initialized variables that are entry-points to the API of current SNT session. The REPL serves as a commandline prompt with access to all of SNT classes.
6463
<div align="center">
65-
<img src="/media/plugins/snt/snt-scriptinterpreter.png" title="SNTService being accessed in the Script Interpreter" width="650px" />
64+
<img src="/media/plugins/snt/snt-repl.png" title="SNTService being accessed in SNT's Scripting REPL" width="700px" />
6665
</div>
67-
66+
The REPL has access to _all_ of SNT's API. The prompt does not feature auto-completion but you can use `api(object, 'optional keyword')` to obtain a list of methods associated with an object. Example: To find out all of the 'demo' methods in SNTService, one would use:
67+
68+
{% highlight java %}
69+
>>> api(snt, "demo")
70+
6 method(s) available in sc.fiji.snt.SNTService:
71+
demoImage(String arg0) -> ImagePlus
72+
demoTree(String arg0) -> Tree
73+
demoTree() -> Tree
74+
demoTreeImage() -> ImagePlus
75+
demoTrees() -> List
76+
demoTreesSWC() -> List
77+
{% endhighlight %}
6878

6979
# Python Notebooks
7080

_pages/plugins/snt/walkthroughs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ This type of analysis uses (manually placed) multi-Point ROIs along paths as mar
267267
2. Click over the features to be counted. Point placement may not need to be accurate, but with 3D images points should be placed on the same plane (Z-plane) the feature being counted
268268
3. Once you have placed all the points, select the Path(s) associated with the features (or select none, if all Paths are to be considered) and run Path Manager's {% include bc path='Analyze|Spine/Varicosity Utilities|Extract Counts from Multi-point ROIs...' %}. The dialog allows you to specify:
269269

270-
- **Source of Multi-point ROI(s)** The location of the markers. Particularly useful if the ROIs are being generated programmatically and stored in the ROI Manager
270+
- **Source of Multi-point ROI(s)** The location of the markers. Particularly useful if the ROIs are being generated programmatically and stored in the ROI Manager. It also allows [bookmarked locations](/plugins/snt/manual#bookmarks-tab) to be parsed as markers
271271

272272
- **Max. association distance** The maximum allowed distance between a point and its path in physical units. This option is ignored if set to -1 (the default). This works as follows: for every point ROI, the closest path node is identified. ROI is only considered to be associated with Path if its distance to the closest path node is less than or equal to _Max. association distance_.
273273

media/plugins/snt/snt-repl.png

282 KB
Loading
-396 KB
Binary file not shown.

0 commit comments

Comments
 (0)