File Exchange

image thumbnail

image ellipsoid 3D

version 1.0 (55 KB) by

Inertia ellipsoid of a 3D grayscale image



View License

The function "imInertiaEllipsoid" computes inertia coefficients of the 3D image, and returns the associated equivalent 3D ellipsoid. The function "drawEllipsoid" can be used to display result.

The package also contains function imInertiaEllipse, that returns equivalent ellipse for 2D images. Results is similar to that obtained with IPT function regionprops, but with different output format. The result can be used directly with function 'drawEllipse'.

Display of 3D image in the example requires the "slicer" contribution, also on FileExchange (ID 27983).

Package includes functions from geom2d and geom3d contributions.

Comments and Ratings (4)

David Legland

David Legland (view profile)

For Kim (small update to my previous comment):
actually the coefficient of 2 produces an ellipsoid that encloses most of the image voxels. This can be seen as an analogy to the computation of the interval containing 95% of the values of a random variable following gaussian distribution: the interval is given by +/-1.96 times the square root of the variance around the mean.


David Legland

David Legland (view profile)

Hi Kim,
well, actually I do not remember where does the factor 2 comes from... I suppose I have adjusted manually such that the size of the resulting ellipsoid better fit the original image.


Kim (view profile)

I'm just wondering why you multiplied 2 by square root of eigenvalues (for covariance matrix of points) (i.e., singular values that means scaling factors in each dimension) when caculating lengths of semi-axes (radii) of an elllipsoid at the imInertiaEllipsoid.m

MATLAB Release
MATLAB 7.9 (R2009b)

Inspired by: geom2d, geom3d

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

» Watch video

Win prizes and improve your MATLAB skills

Play today