Code covered by the BSD License  

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

» Watch video

Highlights from

5.0 | 1 rating Rate this file 29 Downloads (last 30 days) File Size: 3.51 KB File ID: #47578 Version: 1.3
image thumbnail



Joe Yeh (view profile)


16 Aug 2014 (Updated )

Measure geometric properties (e.g. long axis, eccentricity, etc.) of image objects in 3D.

| Watch this File

File Information

    This function measures geometrical properties of image objects in 3D, including directions of three principal axes, lengths of the axes, eccentricity and centroid. The input can be either unlabeled 3d binary image or the 3d array of double type generated by the bwlabeln function if user wishes to specify connectivity other than default value. Alternatively, the function can take pixel list in the form of an Mx3 matrix or a structured array of Mx3 matrices (such as the output of regionprops) as input.
    This function treats pixels contained in an image object as a 3-variable normally distributed dataset and identifies the major axis by finding the most significant eigenvector of the covariance matrix between the three cooridanates(x,y,z).


This file inspired Microscopy Image Browser (Mib).

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.3 (R2014a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
10 Jul 2016 Ganesh P G

Can someone help me with this error, please?

"Error using eig
Input to EIG must not contain NaN or Inf.

Error in regionprops3 (line 55)
[eVectors, eValues] = eig(covmat);"

My input for regionprops3 is a 3-D binary image. I removed objects with single pixel, because that was mentioned as a problem. It still gave me the error.


Comment only
13 May 2016 Joe Yeh

Joe Yeh (view profile)

Serdar Yeralan, can you describe the difficulties in more details ? Did you get any error?

Comment only
29 Mar 2016 Serdar Yeralan

I am having difficulties with the function "struct2array" it calls. Any help would be greatly appreciated

Comment only
27 Nov 2014 Ilya Belevich

btw, could you please fix the function for the situations when the object consists of a single pixel.
For example,

L = zeros([5,5,5],'uint8');
L(3,3,3) = 1;
result = regionprops3(L, 'Eccentricity');
result = regionprops3(L, 'AllAxes');

thank you!

Comment only
26 Nov 2014 Ilya Belevich

Great function, thank you for sharing!

19 Aug 2014 1.1

Summary edited

07 Sep 2014 1.2

Correct a mistake in the previous version and add a few more outputs.

08 Sep 2014 1.3

Correct minor mistake in the function

Contact us