フィルターのクリア

Create multiple structure properties from a stack of 3D images

1 回表示 (過去 30 日間)
Mario
Mario 2015 年 3 月 22 日
コメント済み: Mario 2015 年 3 月 23 日
Hello,
I have a stack of binary images(16 to be exact) in a 3D matrix that I named M2 and I wanted to extract centroids from each of those images inside that 3D matrix using regionprops using for loop, but without any success.
I labeled each of those images and stored them in a new 3D matrix called bw. I want to extract centroids of many labels contained by each image of that 3D matrix and store them in maybe separate structures. But I am not sure how to do that and use them later in my code. I want to be able to get perhaps separate sub-structures containing centroids of each labeled image so that I can access those centroids later on in my code.
I have done this so far:
numImages - is a number of images inside my 3D matrix
bw - is a 3D matrix of my labeled images
M2 - is a 3D matrix of my binary images
for i=1:numImages
s = regionprops(logical(bw(:,:,i)), M2(:,:,i), 'Centroid');
end
Here I am not sure how to get centroids stored in separate structures for each image of my 3D matrix. Any help would be much appreciated.
Thanks in advance!

採用された回答

Image Analyst
Image Analyst 2015 年 3 月 22 日
In the loop, put this
strCentroids(i).Centroids = [s.Centroid];
  1 件のコメント
Mario
Mario 2015 年 3 月 23 日
Thanks, that is working!
Now I have a 1x16 structure s containing all 16 labeled images with each of them having their regions centroids.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by