How to get total count

조회 수: 11 (최근 30일)
mohd akmal masud
mohd akmal masud 2021년 7월 22일
답변: Garmit Pant 2024년 3월 4일
Hi all,
i try use the Gradient Weight segmentation funtion (as script).
I binarize it. Only got the volume (T1) like below. Means 178 multiply by the volume of one voxel(0.1ml) = 17.8 ml.
Can someone help me how to get the total counts, mean count, max count inside the volume??
T1 =
1×2 table
Area Centroid
____ __________________________
178 75.893 58.36 44.539
[spect map]=dicomread('I-131sphere10nisbah1');
info = dicominfo('I-131sphere10nisbah1');
%gp=info.SliceThickness;
spect=(squeeze(spect));%smooth3
aa=size(spect);aa=aa(3);
% NI KALAU VOLUME 1 10 NISBAH V1
seedR1 = 58; seedC1 = 76; seedP1 = 45;
W1 = graydiffweight(spect, seedC1, seedR1, seedP1 , 'GrayDifferenceCutoff', 1415);
thresh = 0.004196;
[BW1, D1] = imsegfmm(W1, seedC1, seedR1, seedP1, thresh);
figure, imshow3D(BW1)
T1 = regionprops('table', BW1,'Area','Centroid')

답변 (1개)

Garmit Pant
Garmit Pant 2024년 3월 4일
Hello Mohd Akmal Masud
From what I gather, you are using gradient weight segmentation with a 3D DICOM image. You want to find the total counts, mean count, max count inside the volume.
Given that you have already segmented the image, you can use the segment mask to find the counts inside the volume. You can use the following code snippet as addition to your code and to find the necessary information.
% Index into the original image to get the counts inside the segmented volume.
countsInsideVolume = spect(BW1);
% Calculate the total counts by summing the values inside the volume.
totalCounts = sum(countsInsideVolume(:));
% Calculate the mean count by dividing the total counts by the number of voxels.
meanCount = totalCounts / nnz(BW1); % nnz(BW1) gives the number of non-zero (true) elements in BW1.
% Find the maximum count inside the volume.
maxCount = max(countsInsideVolume(:));
% Display the results.
fprintf('Total Counts: %f\n', totalCounts);
fprintf('Mean Count: %f\n', meanCount);
fprintf('Max Count: %f\n', maxCount);
I hope you find the above explanation and suggestions useful!

Community Treasure Hunt

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

Start Hunting!

Translated by