View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Fast Eigenvalue Computation of Massive 3-by-3 Real Symmetric Matrices

5.0 | 1 rating Rate this file 15 Downloads (last 30 days) File Size: 2.17 KB File ID: #40677 Version: 1.13

Fast Eigenvalue Computation of Massive 3-by-3 Real Symmetric Matrices



08 Mar 2013 (Updated )

For multiple 3x3 real symmetric matrices, vectorized matrix operations, support GPU computation

| Watch this File

File Information

Calculate the eigenvalues of many 3x3 real symmetric matrices. Computation is non-iterative, based on fully vectorized matlab matrix operations, and GPU computation is supported. It is fast and efficient for processing a number of 3-by-3 matrices at once. This code particularly suits tensor/Riemannian calculus in 3D, visualization/analysis of volumetric tensor images, image Jacobian/Hessian analysis, stress/tensile strength computation on tensor fields, three dimensional diffusion processes, determining the rotation axes of a motion field, etc....

[eigenvalue1,eigenvalue2,eigenvalue3] = eigenvaluefield33( a11, a12, a13, a22, a23, a33);
a11, a12, a13, a22, a23 and a33 specify a set of symmetric 3x3 real matrices (a tensor field, a tensorial image, an array of matrices/tensors, etc....) as:
  a11 a12 a13
[ a12 a22 a13 ]
  a13 a23 a33
These six inputs must have the same size. They can be 2D, 3D or any dimension. The outputs eigenvalue1, eigenvalue2 and eigenvalue3 follow the size and dimension of these inputs. Trigonometric functions are used. The inputs must be double to maintain the accuracy.

eigenvalue1, eigenvalue2 and eigenvalue3 are the unordered eigenvalues. They are solved using the cubic equation solver, see
One can obtain the ordered eigenvalues by:
minEigenvalue = min(min(eigenvalue1, eigenvalue2), eigenvalue3);
maxEigenvalue = max(max(eigenvalue1, eigenvalue2), eigenvalue3);
midEigenvalue = eigenvalue1+eigenvalue2+eigenvalue3 - minEigenvalue - maxEigenvalue;

The peak memory consumption of the function is about 1.5 times of the total of all inputs, in addition to the original inputs. GPU computation is automatically enabled if all inputs are matlab GPU arrays.

The following research works exemplify the use of this fast eigenvalue computation routine on curvilinear/tubular structure detection:

1. Max W. K. Law, KengYeow Tay, Andrew E. Leung, Gregory J. Garvin and Shuo Li,
“Dilated Divergence based Scale-Space Representation for Curve Analysis”, ECCV 2012, pp. 557 – 571.
2. Max W. K. Law and Albert C. S. Chung, ``Three Dimensional Curvilinear Structure Detection using Optimally Oriented Flux'', ECCV 2008, pp. 368--382.
Matlab source:

3. 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.

4. Max W. K. Law and Albert C. S. Chung,
“Segmentation of Intracranial Vessels and Aneurysms in Phase Contrast Magnetic Resonance Angiography using Multi-Range Filters and Local Variances”, TIP 2013, 22(3), 845 – 859.

Please refer to for more details regarding the above publications.

Author: Max W.K. Law

MATLAB release MATLAB 8.0 (R2012b)
Other requirements Cuda 1.3, Matlab 2010b or later is required for GPU computation
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
12 Mar 2013 UWO

UWO (view profile)

08 Mar 2013 1.1

Updated info.

11 Mar 2013 1.3

Updated description

11 Mar 2013 1.4

Updated description

11 Mar 2013 1.5

Updated description

11 Mar 2013 1.6

Updated the title of this package

11 Mar 2013 1.7

Updated info., revised the code

12 Mar 2013 1.8

Updated info.

18 Mar 2013 1.9

Updated info.

18 Mar 2013 1.10

Updated info.

22 Mar 2013 1.11

Updated info.

07 May 2013 1.12

Updated info.

10 May 2013 1.13

Updated info.

Contact us