Finding Centroids in 3D using Regionprops

3 ビュー (過去 30 日間)
kishore
kishore 2014 年 4 月 1 日
回答済み: CJR 2016 年 8 月 11 日
I have a 3d binary segmentation result (logical array) in which there are a bunch of spheres (24 in number). I want to find their centroids. I used regionprops to find the centroids of these spheres as shown below
regionprops(image3D,'Centroid')
I do get a output which is a structure containing 3000 centroids which are all (NaN,NaN,NaN). I also tried to typecast image3D into double & uint8. Didnt work. Any suggestions welcome :-) Thanks. PS: Some of my slices have multiple spheres making it a little harder.

回答 (1 件)

CJR
CJR 2016 年 8 月 11 日
Are you using the bwconncomp function before regionprops? Do you have any noise in the images?
This is what I do:
cc=bwconncomp(image3D); centers=cell2mat(struct2cell(regionprops(cc,'Centroid')))

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by