Difference between revisions of "SNT: Manual"

(Default Path Colors)
(Default Path Colors)
Line 99: Line 99:
<li style="display:inline-block;"> [[Image:Path-manager-color-tag.png|none|thumb|260px|Color tagging]] </li>
<li style="display:inline-block;"> [[Image:Path-manager-color-tag.png|none|thumb|260px|Color tagging]] </li>
<li style="display:inline-block;"> [[Image:Color-tag-result-2.png|none|thumb|260px|Arbitrary path coloring]] </li>
<li style="display:inline-block;"> [[Image:Color-tag-result-2.png|none|thumb|260px|Arbitrary path coloring]] </li>
<li style="display:inline-block;"> [[Image:Color-tag-result-image.png|none|thumb|300px|Result]] </li>
<li style="display:inline-block;"> [[Image:Color-tag-result-image.png|none|thumb|350px|Result]] </li>

Revision as of 20:10, 21 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).


By default, SNT uses the A* search algorithm to automatically construct paths between two manually selected points. To manually place each node in a path, toggle this feature off.

Auto-tracing dialog

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 need to be chosen:

  • Sigma - Controls the spatial scale of the filtering. A lower value of sigma will capture small structural details but is more sensitive to noise. A larger value of sigma will consider larger scale structure, but may be less sensitive to local shape characteristics. It is generally advisable to pick a value which reflects the average radius of the structures you are tracing.
  • 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 portion of the image which has meaningful structure. Once you click there, a 9-square palette will be generated showing increasing values of sigma (from top-left to bottom-right) applied to that chunk of the image.

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

Experiment with moving the "Adjusted Max" slider to find a setting which captures the important 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. In the latter case, the search might take longer or not finish at all, since each pixel will carry greater cost than it should. 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, path-finding 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 pre-process your data. However, if your data requires tailored pre-processing, you may also choose to trace on a user-specified filtered image. For example, one might use the Frangi et al. 1998 method to enhance vessel-like structures.

A Single Image

To process a single image, load your image ("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 that you select two scales, from twice the x voxel separation to five times that value. We apply a Gaussian convolution at each scale. Assuming your image has isotropic resolution, the parameters would look like this.

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 "Tracing on Filtered Image". 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 path-finding will occur on the filtered image.

  • Step 1
  • Step 2

To display the image, 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 images, and then wrap it it in a loop to iterate over all the 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:

Path visibility dialog in SNT "Main" tab
  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 show nodes within X number of Z-slices on either side of the current slice.
  3. Only paths from active channel/frame - If tracing on a multi-channel image or an image with a time axis, only show paths from the active channel/frame

Any combination of these options may be toggled at once.

Default Path Colors

Path color in SNT indicates status of the path. The default color indicators are:
Path color dialog in SNT "Main" tab
CMYK color model
  • Green
    - Finished path, selected for interaction.
  • Magenta
    - Finished path, deselected meaning it cannot be extended or edited until selected.
  • Cyan
    - Temporary path segment, unconfirmed.
  • Red
    - Temporary path segment, confirmed.

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

The "Enforce default colors (ignore color tags)" checkbox, when enabled, 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 checkbox is toggled OFF.

Selected paths can be assigned custom color tags from 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


Temporary Paths

UI Interaction