File Exchange

image thumbnail

regionprops3

version 1.3.0.0 by CY Y
Measure geometric properties (e.g. long axis, eccentricity, etc.) of image objects in 3D.

9 Downloads

Updated 04 Oct 2016

GitHub view license on GitHub

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

Comments and Ratings (12)

Came up with a simple fix for you problem @Ganesh, at least if you're trying to find the centroid as in my case. I inserted "if isempty(pixs) == 0" and put all of the code following that inside of this if statement

it doesnot compute area,diameter

Aya Eid

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);

Luke Xie

nice work

CY Y

CY Y

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

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.

Thanks.

CY Y

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

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

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!

Great function, thank you for sharing!

Updates

1.3.0.0

Updated description

1.3.0.0

linked to github

1.3.0.0

Correct minor mistake in the function

1.2.0.0

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

1.1.0.0

Summary edited

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