Get from Ico-github-logo

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

» Watch video

Highlights from

  • regionprops3( input, vara...
    regionprops3 measures the geometric properties of image objects in
  • View all files
5.0 | 3 ratings Rate this file 16 Downloads (last 30 days) File Size: 0 Bytes 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

regionprops3 measures the geometric properties of image objects in 3D space, including 'MajorAxis', 'MajorAxisLength', 'Centroid', 'AllAxes', and 'Eccentricity'.


This file inspired Microscopy Image Browser (Mib).

Required Products Image Processing Toolbox
MATLAB release MATLAB 9.1 (R2016b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
12 Oct 2016 Myriam_06

Nice work! Like it a lot. But still figuring evertything out.

Maybe a very basic question but: what happens here exactly? What formula is this based on?

distMat = sum(pixs.*repmat(eVectors(:,idx(1))',size(pixs,1),1),2);
output(ii).FirstAxisLength = range(distMat1);

Comment only
05 Oct 2016 Luke Xie

Luke Xie (view profile)

nice work

04 Oct 2016 CY Y

CY Y (view profile)

19 Aug 2016 Joe Yeh

Joe Yeh (view profile)

@Ganesh, have you checked if your image data contains any NaN or Inf ? Use this to check : any(isnan(img(:))|isinf(img(:))). If the result comes back as one, you'll have to fix that in the image.

Comment only
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

14 Aug 2016 1.3

linked to github

04 Oct 2016 1.3

Updated description

Contact us