Sato filter¶
| Fact | Value |
|---|---|
| Also called | Sato tubeness, Line filter |
| Status | Implemented and tested |
| Family | Texture, corners, blobs and features |
| Engine | Science engine |
| Type | Nonlinear, spatial, Hessian eigenvalue tubeness |
| Output | Image |
| Operator shown as | algorithm (exact) |
| Support radius | global |
| Code | engine/src/pixelnexus_engine/filters/ridges.py, sato_filter |
| Operator code | engine/src/pixelnexus_engine/filters/ridges.py, ridge_representation |
| Packages | scikit-image |
| Channels | Brightness only, RGB |
Overview¶
The Sato filter finds tube-like lines. At each scale, it takes the larger curvature of the brightness, which is large across a dark line. It multiplies that by sigma squared, so that thin and wide lines are compared fairly. It keeps the strongest answer over the scales. The filter runs in the PixelNexus engine on your computer, with scikit-image.
How it works¶
- Blur the image with a Gaussian at each scale, and find the second derivatives.
- At each pixel, find the eigenvalues of the Hessian, the curvatures along and across.
- Turn them into the line measure of this filter.
- Keep the largest measure over the scales.
- Stretch the result so the strongest response is white.
Mathematical foundation¶
The formula shows the default parameter values.
where
- \(\lambda_{\max}\): The larger Hessian eigenvalue
- \(\sigma\): The scale
The Hessian is the matrix of second derivatives of the image smoothed by a Gaussian of sigma. Across a dark line, the brightness bends up, so the larger eigenvalue lambda_max is positive. Sato's measure in 2D is that eigenvalue, clipped at 0. Second derivatives shrink as the Gaussian grows, so the factor sigma^2 makes the scales comparable, as in scale-space theory. The filter keeps the largest T over the scales and stretches the result so the strongest response is white.
The Hessian is the matrix of the second derivatives of the image, after a Gaussian blur of sigma. Across a dark line, the brightness bends up, so the larger eigenvalue lambda_max is positive. Sato et al. use it as the line measure in 2D, clipped at 0.
Second derivatives get smaller as the blur grows. A line of width w and contrast C gives a curvature of about C / sigma^2 at its best scale. The factor sigma^2 cancels this, so lines of the same contrast give about the same value at their own best scale. This is the scale normalization of scale-space theory. The measure ignores the smaller eigenvalue, so dark blobs respond as strongly as lines.
Kernel or operator¶
The Inspector asks the engine for the stages with the current settings. They are the Hessian with the list of scales, the eigenvalues, the line measure with its constants, and the maximum over the scales.
Algorithm¶
- Compute the Hessian with Gaussian derivatives at each scale.
- Take the larger eigenvalue, clip it at 0 and multiply it by sigma squared.
- Keep the largest value over the scales.
- Stretch the result to the full range.
Parameters¶
| Parameter | Default | Values | Meaning |
|---|---|---|---|
Ridges ridges |
Dark ridges | Dark ridges, Bright ridges | Whether the lines to find are darker or brighter than their surroundings. Vessels in retinal photos are dark. |
Smallest scale sigmaMin |
1 | 0.5 to 20 px | The smallest Gaussian sigma. A line of width w responds most near sigma = w / 2 or a little less. |
Largest scale sigmaMax |
9 | 0.5 to 20 px | The largest Gaussian sigma. If it is below the smallest scale, only the smallest is used. |
Scale step sigmaStep |
2 | 0.5 to 10 px | The step between the scales. The defaults give 1, 3, 5, 7 and 9, the scikit-image defaults. |
Border mode border |
Reflect | Reflect 101 (default), Reflect, Replicate, Constant (zero), Wrap | How pixels outside the image are filled when the window reaches past the edge. |
Channels channelScope |
Brightness only | RGB, Brightness only | Which part of the color image the filter changes. |
Implementation¶
sato_filter in engine/src/pixelnexus_engine/filters/ridges.py calls skimage.filters.sato on each plane the scope names, in pixel levels from 0 to 255. Then it stretches the result so the strongest response is 255. The Hessian comes from two passes of a Gaussian derivative of sigma / sqrt(2), so the image is blurred by sigma in all. There is no live preview. The result arrives when you click Apply.
Worked example¶
| Scales | Width 1 | Width 2 | Width 4 | Width 8 | Disk |
|---|---|---|---|---|---|
| Defaults (1 to 9) | 127 | 171 | 222 | 252 | 192 |
| Scales 1 to 3 | 127 | 172 | 245 | 243 | 156 |
| Scales 5 to 9 | 42 | 83 | 158 | 252 | 192 |
The image of the figure: four dark waves on a ground of 200, at 70 before a blur of sigma 0.6 and noise of sigma 4, and a dark disk of radius 6. The numbers are the result of the Sato filter from 0 to 255, as the median along the middle of each wave and the value at the middle of the disk. Each result is stretched so its strongest response is 255.
Complexity¶
- Time: \(O(K N sigma)\)
- Memory: \(O(N)\)
N is the number of pixels, K the number of scales and sigma the largest scale. The Gaussian derivatives are separable, and their windows reach 8 sigma.
Artifacts and limitations¶
Limitations
- Also responds to the dark side of edges and to dark blobs, since it does not look at the smaller eigenvalue.
Artifacts
- Blobs and corners respond as strongly as lines.
Tests¶
The filter must equal skimage.filters.sato, stretched and rounded, with every border mode reaching scikit-image. Lines 3 and 10 pixels wide with the same contrast must give peaks within 20 percent of each other. A round blob must respond. The engine API tests run a job and check the stages of the representation.
References¶
- Sato, Y., Nakajima, S., Shiraga, N., Atsumi, H., Yoshida, S., Koller, T., Gerig, G., and Kikinis, R. Three-dimensional multi-scale line filter for segmentation and visualization of curvilinear structures in medical images. Medical Image Analysis 2(2), 143 to 168, 1998. DOI 10.1016/S1361-8415(98)80009-1.
- scikit-image documentation, skimage.filters.sato.