Difference between revisions of "SNT: Manual"

(Default Path Colors)
(Default Path Colors)
Line 83: Line 83:
Path coloring in SNT indicates status of the path. The default color indicators are: [[File:Default-path-colors.png|right|thumb|300px|"Default Path Colors" widget]]
Path coloring in SNT indicates status of the path. The default color indicators are: [[File:Default-path-colors.png|right|thumb|300px|"Default Path Colors" widget]]
[[File:CMYK-color-model.png|right|thumb|300px|CMYK color model]]
[[File:CMYK-color-model.png|right|thumb|300px|CMYK color model]]
* <pre style="color: green;font-size:20px">Green</pre> - Finished path, selected for interaction.
* <pre style="color: #00FF00;font-size:20px">Green</pre> - Finished path, selected.
* <pre style="color: #FF00FF;font-size:20px">Magenta</pre> - Finished path, deselected meaning it cannot be extended or edited until selected.
* <pre style="color: #FF00FF;font-size:20px">Magenta</pre> - Finished path, deselected. Cannot be extended or edited until selected.
* <pre style="color: #00FFFF;font-size:20px">Cyan</pre> - Temporary path segment, unconfirmed.
* <pre style="color: #00FFFF;font-size:20px">Cyan</pre> - Unconfirmed paths.
* <pre style="color: red;font-size:20px">Red</pre> - Temporary path segment, confirmed.
* <pre style="color: #FF0000;font-size:20px">Red</pre> - Temporary paths.
The default colors for finished paths can be changed to any color in the [https://en.wikipedia.org/wiki/CMYK_color_model CMYK color model]. To do so, press the "Selected" or "Deselected" button in the "Default Path Colors" widget.
The default colors for finished paths can be changed to any color in the [https://en.wikipedia.org/wiki/CMYK_color_model CMYK color model]. To do so, press the "Selected" or "Deselected" button in the "Default Path Colors" widget.

Revision as of 20:19, 22 April 2019


This tab aggregated widgets for tracing and frequent operations.

Cursor Auto-snapping

If active (the default) the cursor snaps to the brightest voxel in its vicinity. To accomplish this, SNT takes the cuboid of the specified dimensions (in pixels) centered on the current cursor position and searches quickly for local maxima in that neighborhood, moving the cursor to that position. The Z-plane in which the maximum was found is automatically selected if the "Z" parameter is greater than 0. Noteworthy:

  • This feature assumes the signal is brighter than the background as typically found in fluorescent images.
  • If multiple maxima exist (e.g., when the signal is saturated), it snaps to their centroid.
  • To streamline the computation: XYZ dimensions are constrained to even numbers and limited range.
  • Snapping occurs in 2D (i.e., in the active plane) if Z=0.
  • The XZ, ZY views are synchronized when 3D snapping is active (i.e., Z>0).


If active, SNT uses the A* search algorithm to automatically construct paths between two manually selected points. To manually place nodes in a path, toggle this feature OFF.

"Auto-tracing" widget

A quick way to improve the quality and efficiency of the pathfinding is to enable "Hessian-based analysis", which filters the image for tube-like structures. Two parameters should be specified:

  • Sigma - Controls the spatial scale of the filter. A lower value of sigma will capture small scale structure but is more sensitive to noise. A larger value of sigma will consider larger scale structure, but is less sensitive to local shape characteristics. It is generally advised to pick a value which reflects the average radius of the structures to be traced.
  • Maximum - The maximum pixel intensity on the Tubeness image beyond which the cost function for A* search is minimized.

These parameters may be chosen "Manually" (if you already have a quantitative understanding of the image) or "Visually" (generally more intuitive). If you choose "Visually", the dialog will prompt you to click on a representative region of the image which has meaningful structure. Once you click there, a 9-square palette is generated showing increasing values of sigma (from top-left to bottom-right) applied to that chunk of the image. The palette is an image stack which can be scrolled through with the mouse wheel.

Representative region in image
  • Adjusted Max - oversaturated
  • Adjusted Max - default
  • Adjusted Max - undersaturated

Experiment with different values of the "Adjusted Max" to find a setting which captures the structures you are interested in, while taking care to avoid over or under-saturation. In the former case, the search might consider pixels outside of the tubular structures, giving a less accurate result. In the latter case, the search might take significantly longer, since each pixel will carry greater cost than is reasonable. It is usually safe to choose a value somewhere near the median. Once you have chosen this value, click on the square in the palette with the sigma that best fits your application (its border will turn green) then press "Apply". The parameters will be transferred to the interface and a Gaussian convolution will be run over the image, which may take some time depending on its size. Once it's done, pathfinding will occur on the Hessian image. To display this image during tracing, go to View  › Show Hessian (Tubeness) Image from the SNT dialog.

Original (left) and Hessian (right)

Tracing on Filtered Image

SNT's "Hessian-based analysis" option provides a convenient and easy way to preprocess your data. However, if your data require tailored preprocessing, you may also trace on a user-specified filtered image. For example, one might use the Frangi et al. 1998 method to enhance vessel-like structures in the image.

A Single Image

To process a single image with the Frangi Vesselness filter, load it ("test.tif", say) into Fiji and select Process  › Filters  › Frangi Vesselness. (There is more information about this plugin on its page.) By way of example, let's say you select two scales, twice the x voxel separation and five times that value. We apply a Gaussian convolution at each scale. Assuming your image has isotropic resolution with pixel width = pixel height = pixel depth = 1, the parameters would be:

Frangi parameters

Save the result by doing File  › Save As with the same extension as the original image ("test-filtered.tif", for example). Then, with SNT open, go to the main dialog tab and look for the "Tracing on Filtered Image" widget. Click "Browse" to load the filtered image, select "SNT" for the parser and press "Load". Finally, toggle the "Trace on filtered Image" checkbox. Now the pathfinding will occur on the filtered image.

  • Step 1
  • Step 2

To display the image in a separate window, from the SNT dialog go to View  › Show Filtered Image

Side-by-side original and filtered images

Preprocess Multiple Images

The easiest way to preprocess multiple images is to record a macro for processing a single image, then wrap it in a loop to iterate over all files in a directory. For example:

d = getDirectory("Select a directory");
files = getFileList(d);

extension = ".tif";

for( i = 0; i < files.length; ++i ) {
    filename = files[i];
    if( endsWith(filename,extension) ) {
        l = lengthOf(filename);
        el = lengthOf(extension);
        basename = substring(filename,0,l-el);
        expected_window_name = "vesselness of "+filename;
        output_filename = d + File.separator + basename + ".tubes.tif";
        run("Frangi Vesselness (imglib, experimental)", "number=1 minimum=0.288387 maximum=0.288387");
        saveAs("Tiff", output_filename);

Filters for Visibility of Paths

By default, the entire path is projected onto the current Z-slice. This is useful to see how much has been completed, and gives a sense of the overall structure of the reconstruction. However, SNT provides 3 additional visibility options for paths:

"Filters for visibility of paths" widget
  1. Only selected paths (hide deselected) - Only show paths that have been manually selected in the Path Manger or with the G key ( Shift+G to select multiple paths).
  2. Only nodes within X nearby Z-slices - Only highlight nodes within X number of Z-slices on either side of the current slice. The projected skeletons of all paths remain visible.
  3. Only paths from active channel/frame - If tracing on a multichannel image or an image with a time axis, only show paths from the active channel or frame.

Any combination of these options may be toggled simultaneously.

Default Path Colors

Path coloring in SNT indicates status of the path. The default color indicators are:
"Default Path Colors" widget
CMYK color model
  • Green
    - Finished path, selected.
  • Magenta
    - Finished path, deselected. Cannot be extended or edited until selected.
  • Cyan
    - Unconfirmed paths.
  • Red
    - Temporary paths.

The default colors for finished paths can be changed to any color in the CMYK color model. To do so, press the "Selected" or "Deselected" button in the "Default Path Colors" widget.

The "Enforce default colors (ignore color tags)" option, if active, will force all paths to conform to the default colors specified by the "Selected" and "Deselected" color buttons. Any custom color tags will be ignored until the option is toggled OFF.

Selected paths can be assigned custom color tags in the Path Manager. To do so, go to Tag  › Color then choose the desired swatch. Each path can be assigned any color. To change color of all paths, deselect all paths first.

Tip: Hover the mouse cursor over a color swatch to display a tooltip with its RGB value.

  • Color tagging
  • Arbitrary path coloring
  • Result


This tab aggregated widgets for advanced settings.

Data Source


"Views" widget
  • Image without MIP overlay
  • Image with MIP overlay at 30%
  • Draw diameters in XY view - Display the stored diameter (if any) in the XY view for all existing nodes. Each diameter is drawn as a line segment with length = diameter, which is bisected by the orthogonal tangent vector to the path at that node.
  • Draw diameters in XY view - disabled
  • Draw diameters in XY view - enabled
  • Apply zoom changes to all views - If a zoom change is applied to any one of the XY, ZY or XZ views, apply the same change to the two other views if they are open. May resize windows.
  • Resize Canvas - If using a display canvas to view reconstructions, reset its dimensions to the default. (Currently, this command is only available for display canvases, to resize an image go to IJ's command Image  › Adjust  › Canvas Size...
  • Display ZY/XZ views - If currently using the XY only view, display the ZY and XZ views as well.

Temporary Paths

"Temporary Paths" widget
  • Confirm temporary segments - If active, prompts for either confirmation or denial of whether or not to keep a temporary path segment. If inactive, automatically confirms the path segment created on each left-click after starting a path (first click). Applies to both auto-traced and manually traced path segments. The following two settings are only toggle-able when this setting is active.
    • Pressing 'Y' twice finishes path - Finishes a temporary path on two successive Y key presses.
    • Pressing 'N' twice cancels path - Discards a temporary path, including the start node, on two successive N key presses.

UI Interaction