# Optimally Oriented Flux (OOF) for 3D Curvilinear Structure

Version 1.4.1.0 (6.74 KB) by
Optimally Oriented Flux curvilinear structure descriptor
Updated 30 Jan 2024

Compute the analytical 3D multi-radii optimally oriented flux responses for curvilinear structure analysis. Implementation based on,
[1] M.W.K. Law and A.C.S. Chung, Three Dimensional Curvilinear Structure Detection using Optimally Oriented Flux'', ECCV 2008, pp. 368--382.
[2] M.W.K. Law et al., Dilated Divergence based Scale-Space Representation for Curve Analysis'', ECCV 2012, pp. 557--571.
Syntax:
Explanation:
outputresponse: The final output response. 3D matrix.
image: The original image. (3D matrix)
radii: A vector containing all interested radii for computation of OOF. (N-D vector)
opts: A matlab struct. It contains 4 fields to specify 4 optional settings of OOF. If opts or any of these fields of opts is missing, default values are used. (Optional, struct)
opts.spacing: Voxel size of the input image. The pixel spacing can be isotropic or anisotropic. (default value = 1; Scalar, if voxels are isotropic; 3D vector, [x-length,y-length, z-length] if voxels zre anisotropic).
opts.sigma: For the image smoothing for the computation of OOF derivatives. (Scalar, default value = min(opts.spacing))
opts.useabsolute: Use the absolute value to sort the eigenvalues.
opts.useabsolute=1: Use the absolute value;
opts.useabsolute=(any other value): Use the original value;
opts.responsetype: There are six different responses implemented. This input specifies the output response type. Scalar, [0..5], default value = 0). At each detection radius, the response is:
opts.responsetype=0: l1; (default)
opts.responsetype=1: l1+l2;
opts.responsetype=2: sqrt(max(0, l1.*l2));
opts.responsetype=3: sqrt(max(0, l1) .*max(0, l2));
opts.responsetype=4: max(0, l1);
opts.responsetype=5: max(0, l1+l2).
Here l1 and l2 are the largest and the middle eigenvalues of OOF tensor. See opts.useabsolute about their order. The final response "outputresponse" is the maximum magnitude across radii of one of the above response.
opts.normalizationtype: There are four different schemes to normalize the responses across radii:
opts.normalizationtype=0: The surface-area based normalization in [1]. It is also identical to the normalization for blob-like structures in [2].
opts.normalizationtype=1: The advanced normalization for curvilinear structure in [2]. Default and recommended.
opts.normalizationtype=2: The advanced normalization for planar structures in [2].
If the type of the detection target is known (blob-like, curvilinear or planar) and the smallest detection radis is larger than/equal to sigma (i.e. min(radii)>=opts.sigma), it is highly recommended to use the more advanced normalization scheme in [2]. Details can be found in Appendix of [2].
Example:
result = oof3response(I, 1:5);
This gives a OOF detection results for general curvilinear structure detection. A highly recommended setting for subsequent centerline extraction and segmentation.
Return the result computed using the radii {1,2,3,4,5} on image I. The returned responses are very suitable to be zero-thresholded, followed by connectivity analysis to get a segmentation result. It is also helpful to serve as a speed field for level-set evolution, see more details in Max W. K. Law and Albert C. S. Chung, An Oriented Flux Symmetry based Active Contour Model for Three Dimensional Vessel Segmentation'', ECCV 2010, pp. 720--734.
clear opts; opts.spacing=0.4;
result = oof3response(I, 0.4:0.4:2.8, opts);
Return the result computed from the radii (0.4mm,0.8mm,1.2mm,1.6mm,2mm,2.4mm,2.8mm}, where the each pixel is 0.4mmx0.4mmx0.4mm and sigma is 0.4mm.
clear opts; opts.spacing=[0.4, 0.4, 1];
result = oof3response(I, 0.4:0.4:4, opts);
Return the result computed from the raddi {0.4mm...4mm}, where each pixel has a size of 0.4mm x 0.4mm x 1mm (w x l x h).
clear opts; opts.useabsolute=0; opts.responsetype=1; opts.normalizationtype=0;
result = oof3response(I, 1:10, opts);
Return the result S^Q_x as used in Section 3.1 in [1].
clear opts; opts.useabsolute=0; opts.responsetype=3; opts.normalizationtype=0;
result = oof3response(I, 1:10, opts);
Return the result S^Q_x as used in Section 3.2 in [1].
See more details in the header of this contribution.
Author: Max W.K. Law
Email: max.w.k.law@gmail.com
Page: http://www.cse.ust.hk/~maxlawwk/

### Cite As

Max W.K. Law (2024). Optimally Oriented Flux (OOF) for 3D Curvilinear Structure (https://www.mathworks.com/matlabcentral/fileexchange/41612-optimally-oriented-flux-oof-for-3d-curvilinear-structure), MATLAB Central File Exchange. Retrieved .

##### MATLAB Release Compatibility
Created with R2012b
Compatible with any release
##### Platform Compatibility
Windows macOS Linux

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.4.1.0

Corrected Typo. Thanks for everyone who pointed out the typo of "useabsolute". This contribution has been locked to an account tied with an expired email. I finally dealt with it and updated the file. Enjoy!

1.4.0.0

1.3.0.0

Improve computation efficiency and numerical stability

1.2.0.0

Updated info.

1.1.0.0

Updated info.

1.0.0.0