-
Notifications
You must be signed in to change notification settings - Fork 4
Source Steger's Algorithm
This is the main curve extraction algorithm that is based on the source code from this paper. Some time ago I wrote a blog post about it. It is very similar to the Ridge Detection plugin, they both are based on the same C code from the mentioned paper (but the user interface and implementations are different).
The plugin works with 8-,16-,32-bit images and stacks.
There are two steps in line detection.
The first one is a specification of parameters in dialog.
The second (see below) is a determination of lower and upper tracing thresholds.
Upon start, detection parameters window appears:
Here is a brief explanation:
Depending on the image type you have, the plugin can detect white lines in a black background, or on the opposite, dark lines on a white background.
This is the approximate width of lines/curves in pixels. For curves observed in microscopy images, their transverse intensity profile is very often Gaussian (reflecting PSF of a microscope). More precisely, this line width is a standard deviation of this Gaussian. For your specific images, before starting the plugin, you can draw a small line ROI perpendicular to a typical curve, get intensity profile (Analyze->Plot Profile), fit it to a Gaussian function (Data->Add Fit.../Fit Function: Gaussian) and get the value of SD (parameter d value, should be in pixels). It is an estimate, I recommend trying different values around it and choose the best result.
In this case, the plugin will try to continue (extend) ends of detected lines for the length of the value, specified by "Maximum line extension" parameter.
Apart from line segments, the algorithm is able to detect junctions (where ends of segments meet) or intersections of lines.
With this option selected, it will try to resolve these intersections, i.e. connect the ends of line segments that meet and join them together to a new line/curve. The resolution of intersections does not always work properly.
If the option is not selected, at each junction/intersection the algorithm will split lines to separate line segments.
Lines/curves containing fewer points than the number of this threshold will be omitted from detection/results.
After the line detection step, the algorithm will try to refine the central position of each point, using a simplified fit to the transverse profile (see the paper for details).
If this option is unchecked, the plugin returns only line segments (central position of lines). Upon selection of this option, the plugin tries to estimate line width by detecting its left and right boundaries (assuming Gaussian/parabolic profile). See the reference paper above for the details of the procedure. "Maximum width search" parameter limits the search of line boundaries to the provided range.
Detected curves will be added to the image overlay and RoiManager. The existing overlay will be removed, while new curves ROIs will be added to the ROI manager (any previously added ROIs will be preserved). "Average width" and "boundaries" option will work only if "Compute line width" option above was selected. The colors of added lines are specified by the selection box.
After clicking OK, line tracing threshold selection windows appear:
Here, on the left is an example image. In the middle is the saliency map, it is a kind of precomputed probability per each pixel that it contains a curve/line. On the right, there is a window with two thresholds selections sliders (high and low).
The upper threshold defines "seeds" of new curves, this is where tracing will start. Its corresponding area is marked with green color. All green pixels end up in curves.
The lower threshold defines the area (marked in blue), where the algorithm can "extend" curve tracings that will start from green nucleation "seeds". If there is a blue area without a green seed within it, it will not be traced.
The values of both thresholds can be fractional (the slider does not always allow it).
The remaining black area is excluded from curves.
All points of curves are reported in Results table. It can be stored (as csv, for example) and loaded using standard ImageJ function File->Import->Results. When loaded, tracings can be again added to overlay/ROI manager using Load and Show Curves command.
Columns are:
- Label = A text string that codes a unique contour (curve) name. The format is "contour_f_(stack's frame number)_c_(contour number)"
- Frame number = of the stack where contour was detected
- Contour Number = unique curve number. They are numbered independently on the detected frame
- Point number = number of a point in the curve
- X (px) = x coordinate of the point
- Y (px) = y coordinate of the point
- Angle of normal (radians) = direction of the vector, perpendicular to curve at the current point
- Response = the value of saliency (used in threshold map), i.e. kind of degree of probability that current point belongs to a curve.
- Width left/right (px) = if "Compute line width" option was selected, provides distance in pixels to the boundaries of the curve along the normal vector (#7) emanating from the current point's x,y coordinates. Left/right is defined by the direction of movement along point's numeration.
- Asymmetry = this value reports if the line's cross-section intensity profile at this point is asymmetric. Zero value corresponds to the symmetric profile, positive values correspond to the prevalence of the left half, negative values correspond to the prevalence of the right half of the curve.
- Contrast = a degree of line's brightness, i.e. its center intensity with respect to the background.
Developed in Cell Biology group of Utrecht University.
Check out Updates history. The plugin and this wiki are under constant development.
E-mail for any questions, feedback, errors or suggestion.