3

我有一个经过分割过程的体积(3D 矩阵)。大部分卷由 NaN(或零)组成,除了通过某些标准的区域(见图)。我需要知道每个剩余部分的体素数量有多大,以及它们在 2D 平面(xy、xz、yz)上的分布情况。matlab 中是否有任何东西可以帮助我以有效的方式而不是直接搜索来做到这一点?体积可以相当大。例如。在附图中,有 7 个体素的黄色/棕色部分,并且比 xy 更垂直地延伸。提前致谢。在此处输入图像描述

4

2 回答 2

4

最方便的解决方案是使用REGIONPROPS。在您的示例中:

stats = regionprops(image, 'area', 'centroid')

对于每个特征,在结构统计中都有一个带有面积(即体素数)和质心的条目。

于 2012-10-18T16:14:03.047 回答
3

I think that what you are looking for is called bwlabeln. It allows you to find blobs in 3D space, just like bwlabel does in 2D. Afterwards, you can use regionprops to find out the properties of the data.

Taken directly from help:

bwlabeln Label connected components in binary image. L = bwlabeln(BW) returns a label matrix, L, containing labels for the connected components in BW. BW can have any dimension; L is the same size as BW. The elements of L are integer values greater than or equal to 0. The pixels labeled 0 are the background. The pixels labeled 1 make up one object, the pixels labeled 2 make up a second object, and so on. The default connectivity is 8 for two dimensions, 26 for three dimensions, and CONNDEF(NDIMS(BW),'maximal') for higher dimensions.

于 2012-10-18T16:14:24.653 回答