Enhance elongated or tubular structures in image using Frangi vesselness filter
elongated or tubular structures in the 2-D or 3-D grayscale image
J = fibermetric(
using a Hessian-based multiscale Frangi vesselness filter. The image returned,
J, contains the maximum response of the filter at a thickness that
approximately matches the size of the tubular structure in the image.
uses name-value pair arguments to control
different aspects of the filtering
J = fibermetric(___,
Find Threads Approximately Seven Pixels Thick
Read and display an image that contains tubular threads of varying thicknesses.
I = imread('threads.png'); imshow(I)
Create an enhanced version of the image that highlights threads that are seven pixels thick. Threads show up dark against a light background, therefore specify the object polarity as
'dark'. Display the enhanced image.
B = fibermetric(I,7,'ObjectPolarity','dark'); imshow(B) title('Enhanced Tubular Structures 7 Pixels Thick')
Threshold the enhanced image to create a binary mask image containing the threads with the specified thickness.
BW = imbinarize(B);
Display the mask over the original image by using the
labeloverlay function. The overlay has a blue tint where the mask is
true (where threads have the specified thickness).
imshow(labeloverlay(I,BW)) title('Detected Tubular Structures 7 Pixels Thick')
I — Image with elongated or tubular structures
2-D grayscale image | 3-D grayscale volume
Image with elongated or tubular structures, specified as 2-D grayscale image or 3-D grayscale volume.
thickness — Thickness of tubular structures
[4 6 8 10 12
14] (default) | positive integer | vector of positive integers
Thickness of tubular structures in pixels, specified as a positive integer or vector of positive integers.
Specify optional pairs of arguments as
the argument name and
Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
J = fibermetric(I,'StructureSensitivity',15)
StructureSensitivity — Structure sensitivity
Structure sensitivity, specified as the
comma-separated pair consisting of
'StructureSensitivity' and a
positive number. The structure sensitivity is a
threshold for differentiating the tubular
structure from the background.
The default value depends on the data type
I, and is calculated as
0.01*diff(. For example, the default threshold is
2.55 for images of data type
uint8, and the
0.01 for images of data type
with pixel values in the range [0, 1].
ObjectPolarity — Polarity of tubular structures
'bright' (default) |
Polarity of the tubular structures with the
background, specified as the comma-separated pair
and one of the following values:
|Structure is brighter than the background.|
|Structure is darker than the background.|
J — Enhanced image
Enhanced image, returned as a numeric array
of the same size as the input image
I. If the data type of
double, then the data type of
J is also
double. Otherwise, the data
fibermetricfunction does not perform segmentation. The function enhances an image to highlight structures and is typically used as a preprocessing step for segmentation.
Run code in the background using MATLAB®
backgroundPool or accelerate code with Parallel Computing Toolbox™
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Version HistoryIntroduced in R2017a
R2022b: Support for thread-based environments
fibermetric now supports thread-based
fibermetric calculates new default structural sensitivity
Starting in R2018b,
fibermetric calculates the default value of the
StructureSensitivity argument as
0.01*diff(. The change in the default value increases
computational efficiency and reduces memory usage. These improvements also enable processing
3-D volumetric images.
Previous versions of
fibermetric defined the default value of
StructureSensitivity as half of the maximum of the Hessian norm of
the image. If you want to reproduce the prior default value for 2-D images, then specify
maxhessiannorm function does not support 3-D input.