如何计算求和像素计数是分开的。

3视图(30天)
嗨,我有146片图像。dicom图像。每个像素都有自己的计数(指数)像下图一样。我使用下面这个命令先读它。
% %阅读主要集数据
clc
清晰的所有
(spect地图)= dicomread (“I131256x256 10 n1.dcm”);
信息= dicominfo (“I131256x256 10 n1.dcm”);
% gp = info.SliceThickness;
spect =(紧缩(spect));% smooth3
aa = aa aa =大小(spect); (3);
imshow3D (spect)
然后我使用下面命令用来做一些细分为4球团。二进制图像如下。
% %倪KALAU VOLUME1 en阿明prepapre 10:1
% BCKG 69 MAX 381 bckgratio = 5.52
seedR1 = 110;seedC1 = 149;seedP2 = 88;
W1 = graydiffweight (spect、seedC1 seedR1, seedP2,“GrayDifferenceCutoff”,1000000);
thresh1 = 0.004478;
[BW1, D1] = imsegfmm (W1、seedC1 seedR1, seedP2, thresh1);
%,imshow3D (BW1)
T1 = regionprops (“表”BW1,“区域”,“重心”)
%倪KALAU VOLUME2 en阿明prepapre 10:1
% BCKG 69 MAX 221 bckgratio = 3.20
seedR2 = 134;seedC2 = 148;seedP2 = 88;
W2 = graydiffweight (spect、seedC2 seedR2, seedP2,“GrayDifferenceCutoff”,1000000);
thresh2 = 0.001437;
(BW2 D2) = imsegfmm (W2、seedC2 seedR2, seedP2, thresh2);
%,imshow3D (BW2)
T2 = regionprops (“表”BW2,“区域”,“重心”)
%倪KALAU VOLUME3 en阿明prepapre 10:1
% BCKG 69 MAX 143 bckgratio = 2.07
seedR3 = 146;seedC3 = 127;seedP3 = 88;
W3 = graydiffweight (spect、seedC3 seedR3, seedP3,“GrayDifferenceCutoff”,1000000);
thresh3 = 0.000326;
(BW3, D3) = imsegfmm (W3、seedC3 seedR3, seedP3, thresh3);
%,imshow3D (BW3)
T3 = regionprops (“表”BW3,“区域”,“重心”)
%倪KALAU VOLUME4 en阿明prepapre 10:1
% BCKG 69 MAX 109 bckgratio = 1.57
seedR4 = 134;seedC4 = 107;seedP4 = 88;
W4 = graydiffweight (spect、seedC4 seedR4, seedP4,“GrayDifferenceCutoff”,1000000);
thresh4 = 0.000092;
[BW4, D4] = imsegfmm (W4、seedC4 seedR4, seedP4, thresh4);
%,imshow3D (BW4)
T4 = regionprops (“表”BW4,“区域”,“重心”)
allBW = BW1 | BW2 | BW3 | BW4;
imshow3D (allBW);
我的问题是如何让每个团的总数量?
我试试这个,但求和的计算像素团
> > totalcountseachblob =总和(spect (allBW = = 1))
totalcountseachblob =
722358年
任何人都可以帮我吗?

接受的答案

焉耆刘
焉耆刘 2021年11月13日
先生,可以使用
保存allBW.mat所有BW
这个垫子文件和上传,所以我们可以做一些代码来分析
5个评论

登录置评。

答案(1)

图像分析
图像分析 2021年11月13日
@mohd阿克毛马苏德• 你有四个团的形象,allBW,所以让你只需要做的每一个领域
totalcountseachblob = nnz (allBW);
这是在二进制图像像素的总数。如果你想要“综合灰色价值观”从原始灰度图像,您可以使用作为一个面具
pixelValues = spect (allBW);
igv =总和(pixelValues);
也有“总数量为每一个blob”如果你只是运行regionprops allBW形象():
allT = regionprops (“表”allBW,“区域”,“重心”)%表中各个领域的blob。
allAreas = allT.Area;%各个领域的blob双向量。

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!