SNT: Step-By-Step Instructions
(Return to the main SNT page)
- 1 Tracing
- 1.1 I. Pick A Start Point
- 1.2 II. Pick A Subsequent Point
- 1.3 III. Confirm A Temporary Segment
- 1.4 Branching: Start A Path On An Existing Path
- 1.5 Joining: End A Path On An Existing Path
- 1.6 Filtered Image
- 1.7 Legacy 3D Viewer
- 2 Fitting
- 3 Filling
I. Pick A Start Point
You may notice that, by default, the cursor With snaps to the brightest pixel in its vicinity. If you prefer to manually control the placement of nodes, feel free to toggle feature by pressing S. Now, to begin tracing, move through the image stack to find the start point of a path then click there with the left mouse button.
II. Pick A Subsequent Point
A small circle should appear, highlighting the start of the path. Move through the stack to find a subsequent point further along the same structure to be traced (neuron, blood vessel, etc.), and click there.
If a path between the two points cannot be found immediately, you may see the animated progress of the search. You can scroll through the stack while such a search progresses: If it appears to not be making good progress, it's probably best to press the "Cancel/Esc" button (shortcut: C/⎋ Esc) and pick a point closer to the start point.
III. Confirm A Temporary Segment
Once the search has reached the target point, the path is shown in cyan (to indicate that this is still a temporary path) and you are asked to confirm (by clicking "Yes" or pressing Y) that this path is following the route through the image that you expect. If it is not, then click "No" N and you'll go back to the previous step. Assuming you confirmed the path, the confirmed path will appear in red. Now you are essentially back at step II. Normally you will go on to pick further points along the structure. However, if you have finished with that path, click "Finish Path" F and you will go back to step I. If you completed that path it would be shown in magenta.
Branching: Start A Path On An Existing Path
I. Select The Path To Branch Off
To select the path you want to branch off from, you can either select it in the Path Manager, or press G while the mouse pointer is near the path. When the path is first selected, it will be shown in the default green color.
II. Select The Fork Point
To force the start of the new path to be a branch of the selected path, hold down the ⎇ Alt+⇧ Shift keys while you move the mouse to find the branch point under the red cross-hairs, now decorated with a "Fork Point" annotation. With ⎇ Alt+⇧ Shift held down, click with the left mouse button. Finally, release the keys. Note that it is also possible to zoom into the branch point, right-click on the image and choose Fork at Nearest Node from the contextual menu.
III. Extend The Path
From this point on, you can carry on adding nodes to the branched path as above, i.e., Create a temporary path and confirm it. When you decide to complete the path you should see in the Path Manager that it has been recorded as a child of the existing path.
Joining: End A Path On An Existing Path
Supposing you want the end of a path that you're tracing to join onto an existing path, you just use the same modifier key when selecting the end point of the last part of the path. To go into that in more detail, if you're halfway through tracing a path like this:
... and you want the final part of that path to join up with the existing path running from the top-left to top-right of the image. First, select that path in the path list, so that it turns green:
Now hold down ⎇ Alt+⇧ Shift to restrict the endpoint to be a "join" on that existing path. Click (while still holding down the modifier keys) to start the search for that endpoint and make it join the existing path. If the search can find a path to the end point, the result should look like this:
If you're happy with that, confirming the temporary path will automatically complete the whole path, since if you're creating an end join there cannot be any more to the path. The result will look like this:
Note that the path list indicates that this new path (1) ends on the existing one (0).
Legacy 3D Viewer
SNT comes bundled with a 3D viewer with visualization and tracing capabilities.
I.Starting the Viewer
To open the viewer, navigate to the "3D" menu tab in the SNT dialog and look for "Legacy 3D Viewer". You will see 3 parameters:
- New with image - Instantiate viewer with the currently opened image. This enables one to trace in 3D as well as explore the image stack in an intuitive way.
- New without image - Instantiate viewer without an image. Useful for visualizing reconstructions and surface meshes (WaveFront or STL).
- Mode - the render style for the reconstruction
- Lines and discs
- Lines - Render paths as nodes connected by 1D lines
- Surface reconstructions - Render paths as tubular surfaces
- Apply Color Labels
- Compare reconstruction against
If you choose "New with image..." for Viewer and press "Apply", a prompt will appear asking you to choose the resampling factor for the image.
- Select points for tracing - select the "Wand" tool in the main Fiji toolbar and click over the region you want to trace. Tracing works the same way as in the 2.5D view, i.e., click somewhere in the image to create a starting point, then click further along the structure of interest to find a path between the two points, then confirm or deny the temporary segment, etc...
- Rotate the view - either use the "Hand" tool and left-click while dragging mouse or drag mouse while holding the scroll wheel.
- Translate the image - hold ⇧ Shift and the scroll wheel while dragging the mouse.
- Adjust zoom depth - scroll the mouse wheel.
The following key shortcuts also work in the 3D Viewer:
- Y confirm the temporary path segment
- N cancel the temporary path segment
- F complete the current path
- G select the current path under the mouse pointer
You can still create branches and joins in the 3D Viewer as you would in the 2D viewer. First, select the path you want to branch off, or join to by pressing G while the mouse pointer is over that path. (It should turn green.) Then create the join or branch by holding down the join modifier key (⎇ Alt and clicking at the right point on the selected path.
SNT can use the fluorescent signal around traced paths to optimize curvatures and estimate the thickness of traced structures. The optimization algorithm uses pixel intensities to fit circular cross-sections around each node. Once computed, fitted cross-sections can be used to: 1) Infer the radius of nodes, and/or 2) refine node positioning, by snapping their coordinates to the cross-section centroid. To fit path(s), select the desired paths in the Path Manager (or select none if you want to fit all paths) and go to the "Refine/Fit" menu in the same window. There are three options:
- Fit Paths/Un-fit paths/Apply Existing Fit - 1) Fits the selected paths or 2) un-fits them if they have alredy been fitted. 3) If you generated a preview of the fit you can apply that result to the path(s). This option will change depending on context.
- Explore/Preview Fit - Carves out a region of the image along and around the path. Scrolling through this image will display the result of the fitting operation for each node on the path.
- Discard Fit - Deletes the existing fit(s) for the selected path(s), or all fits if no paths are selected.
Before computing the fit, SNT will prompt you to specify two parameters:
- Type of Refinement
- 1) Assign radii of fitted cross-sections to nodes
- 2) Snap node coordinates to cross-section centroids
- 1) & 2) Assign fitted radii and snap node coordinates
- Max. Radius - Defines (in pixels) the largest radius allowed in the fit. It constrains the optimization to minimize fitting artifacts caused by neighboring structures
- Default = 40px on each side of the path
Assuming you chose options 1) & 2) for "Type of Refinement", a fit path might look like the rightmost image below. Notice how the nodes follow the center line of the structure more closely, and how each node now has a non-zero radius approximating that of the tube.
There is a simple facility in this plugin for "filling out" paths to volumes. This is not particularly sophisticated, but often good enough for a rough visualization of the shape of a neuron beyond what can be seen from the traced path.
I.Starting the Fill
First, select the one or more paths that you want to fill out from in the Path Manager and select "Fill -> Fill Out..." in the Path Manager menu options. The selected paths are shown in green so that you can check that you're starting from the right ones. After a couple of seconds if you scroll through the stack you should be able to see a thick green surround the path:
The filler continues to explore the image starting from the path until you click "Pause" or "Stop" in the dialog. However, the fill which is shown only includes those points up to a certain threshold distance from the path. (Note that in this section "distance" doesn't mean a real physical distance, but a measure which takes into account the intensity values of the pixels which must be passed through when moving away from the path.) Information about the current threshold and the progress of the search is shown in the dialog.
The "Cursor position:" state under "Search Status" is updated as you move your mouse over the image. If the point under the mouse has been reached by the search then it will show you that point's distance from the path. Otherwise, it will read "Not reached by search yet". Two lines above, the "Current threshold distance:" shows your current threshold distance: so if this is set to 0.2 then that means that all points less than 0.2 from the path are included in the fill (and shown in green in the image.) The "Max. explored distance:" state under this line shows the maximum distance from the path that has been completely explored.
II.Adjusting the Fill Threshold
You can change the fill threshold in one of three ways:
- Clicking on a point in the image that has been reached by the search (This is the most intuitive way of altering the threshold). It may be helpful to disable the "Enable Snapping within: XY-Z" feature for the cursor while doing this.
- Manually changing the threshold in the "Specify manually:" input box and clicking the "Apply" button beside it.
- Clicking the "Use explored maximum" button below the threshold input box and clicking "Apply", which sets the threshold to the maximum explored distance (the value shown in "Max. explored distance:" under the "Search Status" dialog).
Anyway, assuming that you want to use the first of these approaches, you should use the approach described below. It is difficult to set the threshold accurately from the image unless you zoom in, so first zoom on part of the path that you want to set the threshold for.
Since the the solid green fill obscures the intensity value of the points in the fill, I suggest that you switch to the semi-transparent view of the fill at this stage by selecting the "Transparent overlay" option in the "Rendering Options" dialog. Note that this may slow down filling.
As you can see in the middle image, the threshold is set too far from the path, since there are many completely dark points under the green fill, as well as points on different paths than those of interest. Experiment with clicking on different points closer to the path in order to adjust the threshold until you are happy with it. You might end up with something like the rightmost image:
III.Completing the Fill
If you are happy with this, then you might as well click "Pause" so that your computer isn't spending all its CPU on continuing to explore the image. Then you can either:
- Save the fill (which will add it to the fill list) by clicking "Stash Progress".
- Discard the fill by either clicking "Stop" while filling is in progress or, if you stashed the fill, select it in the fill list and click "Delete Fill(s)".
- Use the "Image Stack..." button to view the same image stack, but with only the points in that fill preserved. You can choose either a grayscale image or binary mask. One reason why you might want to do this is that you can then smooth that image and use the 3D Viewer to do a surface rendering of the neuron. Perhaps then you could overlay that onto a volume rendering of the complete image (see available tutorials). Or, you could save those fill stacks for each of the neurons you fill and then combine them in ImageJ using "RGB Merge".
The image stack you would get from the image used in this example might look something like this: