Skip to content

Meijering filter

Fact Value
Also called Neuriteness, Meijering neuriteness
Status Implemented and tested
Family Texture, corners, blobs and features
Engine Science engine
Type Nonlinear, spatial, Hessian eigenvalue neuriteness
Output Image
Operator shown as algorithm (exact)
Support radius global
Code engine/src/pixelnexus_engine/filters/ridges.py, meijering_filter
Operator code engine/src/pixelnexus_engine/filters/ridges.py, ridge_representation
Packages scikit-image
Channels Brightness only, RGB

Overview

The Meijering filter finds faint, thin lines such as neurites. It mixes each curvature of the brightness with a third of the other and keeps the larger in size. This favors long, flat lines. Each scale is divided by its own largest value, and the filter keeps the strongest answer over the scales. It runs in the PixelNexus engine on your computer, with scikit-image.

Four panels: four dark waves of growing width and a dark disk on a light ground with fine noise, and three Meijering results on black. The waves and the disk are bright with soft halos. With scales 1 to 3, the halos are narrower. With bright ridges, broad gray halos and lines along the edges of the waves show, and the disk becomes a ring. Four panels: four dark waves of growing width and a dark disk on a light ground with fine noise, and three Meijering results on black. The waves and the disk are bright with soft halos. With scales 1 to 3, the halos are narrower. With bright ridges, broad gray halos and lines along the edges of the waves show, and the disk becomes a ring.
Four dark waves 1, 2, 4 and 8 pixels wide and a dark disk, with noise. Then the filter with the defaults, with the scales 1 to 3 only, and with bright ridges.

How it works

  1. Blur the image with a Gaussian at each scale, and find the second derivatives.
  2. At each pixel, find the eigenvalues of the Hessian, the curvatures along and across.
  3. Turn them into the line measure of this filter.
  4. Keep the largest measure over the scales.
  5. Stretch the result so the strongest response is white.

Mathematical foundation

\[ \lambda' = \operatorname*{arg\,max}_{\mu \in \{\lambda_1 + \alpha\lambda_2,\ \lambda_2 + \alpha\lambda_1\}} \lvert\mu\rvert, \qquad N_\sigma = \frac{\max(\lambda', 0)}{\max_x \max(\lambda', 0)}, \qquad \alpha = \tfrac{1}{3} \]

The formula shows the default parameter values.

where

  • \(\lambda_1, \lambda_2\): The Hessian eigenvalues
  • \(\alpha\): The mixing constant, 1/3
  • \(N_\sigma\): The neuriteness at scale sigma, from 0 to 1

The Hessian is the matrix of second derivatives of the image smoothed by a Gaussian of sigma. Meijering's measure mixes each eigenvalue with a third of the other and keeps the one of the larger size. This changes the shape of the response across a line, so long, flat lines stand out. Negative values are set to 0, and each scale is divided by its largest value over the image, so every scale reaches 1. The filter keeps the largest value over the scales and stretches the result so the strongest response is white. scikit-image uses alpha = 1/3 by default.

The Hessian is the matrix of the second derivatives of the image, after a Gaussian blur of sigma. Meijering et al. mix the two eigenvalues: each one gets alpha times the other added, with alpha = 1/3 in scikit-image. Of the two mixed values, the larger in size is kept. Negative values are set to 0, since they belong to the wrong ridge color.

The mixing changes the shape of the response across a line, so the response stays high over the whole width of a flat line. Each scale is then divided by its largest value over the image, so every scale reaches 1. This makes faint thin lines stand out next to strong ones, but one strong feature also sets the scale for all others.

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

  1. Compute the Hessian with Gaussian derivatives at each scale.
  2. Mix each eigenvalue with a third of the other, and keep the larger in size.
  3. Clip at 0 and divide by the largest value of that scale.
  4. Keep the largest value over the scales and stretch it 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

meijering_filter in engine/src/pixelnexus_engine/filters/ridges.py calls skimage.filters.meijering 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) 170 225 228 252 254
Scales 1 to 3 170 225 245 247 211
Scales 5 to 9 42 83 157 251 254

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 Meijering 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

  • Each scale is normalized by its own maximum, so a single strong feature changes the scale of the whole result.
  • Like Sato, it also responds to blobs.

Artifacts

  • Broad halos around strong lines at large scales.

Tests

The filter must equal skimage.filters.meijering, stretched and rounded. With the RGB scope, each channel must be filtered on its own and alpha kept. The strongest response must be in the middle of a line, and bright ridges of a negated image must equal dark ridges of the image. The engine API tests run a job and check the stages of the representation.

References

  • Meijering, E., Jacob, M., Sarria, J.-C. F., Steiner, P., Hirling, H., and Unser, M. Design and validation of a tool for neurite tracing and analysis in fluorescence microscopy images. Cytometry Part A 58A(2), 167 to 176, 2004. DOI 10.1002/cyto.a.20022.
  • scikit-image documentation, skimage.filters.meijering.